* sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
[glibc.git] / nptl / ChangeLog
blob132b2d07ef35b6926fc68d12fba51474c1aaf9e5
1 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
3         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4         Allocate new object which is passed to timer_sigev_thread so that
5         the timer can be deleted before the new thread is scheduled.
7 2006-04-26  Roland McGrath  <roland@redhat.com>
9         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
11 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
13         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
14         suffix for conditional jumps.
15         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
16         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
17         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
18         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
19         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
20         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
22         * init.c (sigcancel_handler): Compare with correct PID even if the
23         thread is in the middle of a fork call.
24         (sighandler_setxid): Likewise.
25         Reported by Suzuki K P <suzuki@in.ibm.com> .
27 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
29         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
31 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
33         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
34         fails [Coverity CID 105].
36 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
38         * sysdeps/pthread/pthread.h: Add nonnull attributes.
40 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
42         [BZ #2505]
43         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
44         Define __lll_rel_instr using lwsync.
46 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
48         * allocatestack.c (allocate_stack): Always initialize robust_head.
49         * descr.h: Define struct robust_list_head.
50         (struct pthread): Use robust_list_head in robust mutex list definition.
51         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
52         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
53         (__pthread_initialize_minimal_internal): Register robust_list with
54         the kernel.
55         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
56         Declare __set_robust_list_avail.
57         * pthread_create.c (start_thread): Register robust_list of new thread.
58         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
59         waiters.
60         * pthread_mutex_destroy.c: For robust mutexes don't look at the
61         number of users, it's unreliable.
62         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
63         set_robust_list syscall is available.
64         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
65         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
66         Set robust_head.list_op_pending before trying to lock a robust mutex.
67         * pthread_mutex_timedlock.c: Likewise.
68         * pthread_mutex_trylock.c: Likewise.
69         * pthread_mutex_unlock.c: Likewise for unlocking.
70         * Makefile (tests): Add tst-robust8.
71         * tst-robust8.c: New file.
73 2006-03-08  Andreas Schwab  <schwab@suse.de>
75         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
76         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
78 2006-03-05  Roland McGrath  <roland@redhat.com>
80         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
81         and $config_os doesn't match *linux*.
83 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
85         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
86         Use __syscall_error.
87         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
88         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
89         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
90         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
91         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
92         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
94 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
96         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
98 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
100         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
101         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
102         mutex.
103         (__lll_robust_timedlock_wait): Likewise.
104         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
105         (__lll_robust_lock_wait): Likewise.
106         (__lll_robust_timedlock_wait): Likewise.
107         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
108         (__lll_robust_lock_wait): Likewise.
109         (__lll_robust_timedlock_wait): Likewise.
111 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
113         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
114         lll_robust_mutex_trylock, lll_robust_mutex_lock,
115         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
116         lll_robust_mutex_unlock): Define.
117         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
119 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
121         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
122         instead of <clone.S>.
124 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
126         * Makefile (libpthread-routines): Add
127         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
128         and pthread_mutex_[sg]etprioceiling.
129         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
130         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
131         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
132         pthread_mutex_setprioceiling.
133         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
134         PTHREAD_PRIO_PROTECT): New enum values.
135         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
136         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
137         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
138         prototypes.
139         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
140         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
141         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
142         Define.
143         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
144         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
145         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
146         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
147         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
148         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
149         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
150         protocol mutexes.
151         * pthread_mutex_getprioceiling.c: New file.
152         * pthread_mutex_setprioceiling.c: New file.
153         * pthread_mutexattr_getprioceiling.c: New file.
154         * pthread_mutexattr_setprioceiling.c: New file.
155         * pthread_mutexattr_getprotocol.c: New file.
156         * pthread_mutexattr_setprotocol.c: New file.
158 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
160         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
162 2006-02-27  Roland McGrath  <roland@redhat.com>
164         * sysdeps/pthread/Subdirs: List nptl here too.
165         * configure (libc_add_on_canonical): New variable.
167         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
169         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
170         self to get main source tree's file.
171         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
172         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
173         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
174         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
175         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
176         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
177         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
178         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
179         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
180         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
181         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
182         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
183         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
185         * Makefile: Use $(sysdirs) in vpath directive.
187         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
188         (CPPFLAGS-timer_routines.c): Likewise.
190         * Makeconfig (includes): Variable removed.
192 2006-02-26  Roland McGrath  <roland@redhat.com>
194         * sysdeps/generic/pt-raise.c: Moved to ...
195         * pt-raise.c: ... here.
196         * sysdeps/generic/lowlevellock.h: Moved to ...
197         * lowlevellock.h: ... here.
199 2006-02-23  Roland McGrath  <roland@redhat.com>
201         * descr.h (struct pthread): Add final member `end_padding'.
202         (PTHREAD_STRUCT_END_PADDING): Use it.
204 2006-02-20  Roland McGrath  <roland@redhat.com>
206         * sysdeps/mips: Directory removed, saved in ports repository.
207         * sysdeps/unix/sysv/linux/mips: Likewise.
209 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
211         * tst-robust1.c: Add second mutex to check that the mutex list is
212         handled correctly.
214 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
216         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
217         lll_robust_mutex_trylock, lll_robust_mutex_lock,
218         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
219         lll_robust_mutex_unlock): New macros.
220         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
221         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
222         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
223         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
224         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
226 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
228         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
229         definitions.
230         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
232 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
234         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
235         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
236         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
237         (lll_robust_mutex_unlock): Likewise.
239 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
241         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
242         Set robust_list.__next rather than robust_list.
243         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
244         (__pthread_list_t): New typedef.
245         (pthread_mutex_t): Replace __next and __prev fields with __list.
246         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
247         (__pthread_list_t): New typedef.
248         (pthread_mutex_t): Replace __next and __prev fields with __list.
249         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
250         (__pthread_list_t, __pthread_slist_t): New typedefs.
251         (pthread_mutex_t): Replace __next and __prev fields with __list.
252         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
253         (__pthread_list_t, __pthread_slist_t): New typedefs.
254         (pthread_mutex_t): Replace __next and __prev fields with __list.
255         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
256         (__pthread_list_t, __pthread_slist_t): New typedefs.
257         (pthread_mutex_t): Replace __next and __prev fields with __list.
258         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
259         (__pthread_slist_t): New typedef.
260         (pthread_mutex_t): Replace __next field with __list.
262 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
264         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
265         PTHREAD_MUTEX_OWNERDEAD.
266         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
267         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
268         * Makefile (libpthread-routines): Add lowlevelrobustlock.
269         * pthread_create.c (start_thread): Very much simplify robust_list loop.
270         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
271         to PTHREAD_MUTEX_INCONSISTENT.
272         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
273         * pthread_mutex_lock.c: Reimplement robust mutex handling.
274         * pthread_mutex_trylock.c: Likewise.
275         * pthread_mutex_timedlock.c: Likewise.
276         * pthread_mutex_unlock.c: Likewise.
277         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
278         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
279         lowlevelrobustlock.sym.
280         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
281         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
282         definitions.
283         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
284         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
285         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
286         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
287         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
289 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
291         * allocatestack.c (allocate_stack): Initialize robust_list.
292         * init.c (__pthread_initialize_minimal_internal): Likewise.
293         * descr.h (struct xid_command): Pretty printing.
294         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
295         robust_list.  Adjust macros.
296         * pthread_create.c (start_thread): Adjust robust_list handling.
297         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
298         but the owner for all robust mutex types.
299         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
300         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
301         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
302         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
304         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
305         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
307 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
309         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
310         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
312 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
314         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
315         Return status.
316         (lll_futex_timed_wait): Define.
318 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
320         * tst-cancel4.c: Test ppoll.
322 2006-01-18  Andreas Jaeger  <aj@suse.de>
324         [BZ #2167]
325         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
326         (pthread_mutex_t): Follow changes for other archs.  Based on patch
327         by Jim Gifford <patches@jg555.com>.
329 2006-01-13  Richard Henderson  <rth@redhat.com>
331         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
333 2006-01-10  Roland McGrath  <roland@redhat.com>
335         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
336         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
337         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
338         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
339         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
340         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
341         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
342         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
343         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
344         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
346 2006-01-09  Roland McGrath  <roland@redhat.com>
348         * tst-initializers1-c89.c: New file.
349         * tst-initializers1-c99.c: New file.
350         * tst-initializers1-gnu89.c: New file.
351         * tst-initializers1-gnu99.c: New file.
352         * Makefile (tests): Add them.
353         (CFLAGS-tst-initializers1-c89.c): New variable.
354         (CFLAGS-tst-initializers1-c99.c): New variable.
355         (CFLAGS-tst-initializers1-gnu89.c): New variable.
356         (CFLAGS-tst-initializers1-gnu99.c): New variable.
358         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
359         Use __extension__ on anonymous union definition.
360         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
361         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
362         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
363         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
364         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
366 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
368         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
369         Don't give the union a name because it changes the mangled name.
370         Instead name the struct for __data.
371         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
372         Likewise.
373         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
374         Likewise.
376 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
378         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
379         stack bias to mc_ftp field.
381 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
383         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
384         being too clever and reloading the futex value where it shouldn't.
386 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
388         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
389         correct type.
391 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
393         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
394         Add cfi directives.
396 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
398         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
399         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
400         rename in tcbhead_t.
402         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
403         Don't give the union a name because it changes the mangled name.
404         Instead name the struct for __data.
405         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
406         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
407         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
408         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
409         * pthread_create.c (start_thread): Adjust robust mutex free loop.
410         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
412 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
414         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
415         Return status.
416         (lll_futex_timed_wait): Define.
417         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
418         * sysdeps/pthread/aio_misc.h: New file.
420 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
422         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
424 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
426         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
427         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
428         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
430 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
432         * tst-cancel24.cc: Use C headers instead of C++ headers.
434 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
436         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
437         sparc-linux configured glibc.
438         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
439         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
440         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
441         atomic_compare_and_exchange_val_24_acq instead of
442         atomic_compare_and_exchange_val_acq.
443         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
444         instead of atomic_exchange_rel.
445         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
446         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
447         file.
448         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
449         file.
450         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
451         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
452         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
453         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
454         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
455         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
456         New file.
457         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
458         New file.
459         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
460         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
461         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
462         file.
463         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
464         file.
465         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
467 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
469         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
470         mutex initializers.
472 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
474         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
475         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
476         THREAD_COPY_POINTER_GUARD): Define.
477         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
478         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
480 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
482         * version.c: Update copyright year.
484 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
486         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
487         .eh_frame section, use cfi_* directives.
488         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
490 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
492         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
493         now.
495 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
497         * sysdeps/pthread/sigaction.c: Removed.
498         * sigaction.c: New file.
499         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
501 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
503         * Makefile (tests): Add tst-signal7.
504         * tst-signal7.c: New file.
506 2005-12-27  Roland McGrath  <roland@redhat.com>
508         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
509         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
510         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
511         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
512         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
513         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
514         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
515         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
516         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
517         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
518         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
520 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
522         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
523         and __prev field to pthread_mutex_t.
524         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
525         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
526         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
527         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
528         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
529         to pthread_mutex_t.
531 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
533         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
534         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
535         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
536         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
537         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
538         and PTHREAD_MUTEXATTR_FLAG_BITS.
539         * descr.h (struct pthread): Add robust_list field and define
540         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
541         * pthread_mutexattr_getrobust.c: New file.
542         * pthread_mutexattr_setrobust.c: New file.
543         * pthread_mutex_consistent.c: New file.
544         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
545         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
546         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
547         Adjust pthread_mutex_t initializers.
548         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
549         field to pthread_mutex_t.
550         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
551         and __prev field to pthread_mutex_t.
552         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
553         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
554         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
555         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
556         * pthread_mutexattr_gettype.c: Likewise.
557         * pthread_mutexattr_setpshared.c: Likewise.
558         * pthread_mutexattr_settype.c: Likewise.
559         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
560         Initialize mutex kind according to robust flag.
561         * pthread_mutex_lock.c: Implement local robust mutex.
562         * pthread_mutex_timedlock.c: Likewise.
563         * pthread_mutex_trylock.c: Likewise.
564         * pthread_mutex_unlock.c: Likewise.
565         * pthread_create.c (start_thread): Mark robust mutexes which remained
566         locked as dead.
567         * tst-robust1.c: New file.
568         * tst-robust2.c: New file.
569         * tst-robust3.c: New file.
570         * tst-robust4.c: New file.
571         * tst-robust5.c: New file.
572         * tst-robust6.c: New file.
573         * tst-robust7.c: New file.
574         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
575         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
576         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
577         tst-robust5, tst-robust6, and tst-robust7.
579         * tst-typesizes.c: New file.
580         * Makefile (tests): Add tst-typesizes.
582         * tst-once3.c: More debug output.
584 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
586         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
587         missing after last change.
589         * version.c: Update copyright year.
591 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
593         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
594         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
595         * pthread_mutex_trylock.c: Likewise.
596         * pthread_mutex_timedlock.c: Likewise.
597         * pthread_mutex_unlock.c: Likewise.
599 2005-12-22  Roland McGrath  <roland@redhat.com>
601         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
602         so that #include_next's search location is not reset to the -I..
603         directory where <nptl/...> can be found.
605 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
607         [BZ #1913]
608         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
609         Fix unwind info.  Remove useless branch prediction prefix.
610         * tst-cancel24.cc: New file.
611         * Makefile: Add rules to build and run tst-cancel24.
613 2005-12-21  Roland McGrath  <roland@redhat.com>
615         * libc-cancellation.c: Use <> rather than "" #includes.
616         * pt-cleanup.c: Likewise.
617         * pthread_create.c: Likewise.
618         * pthread_join.c: Likewise.
619         * pthread_timedjoin.c: Likewise.
620         * pthread_tryjoin.c: Likewise.
621         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
622         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
623         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
624         * unwind.c: Likewise.
626 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
628         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
629         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
630         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
631         THREAD_COPY_POINTER_GUARD): Define.
633 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
635         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
636         rather than one.
637         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
638         THREAD_COPY_POINTER_GUARD): Define.
639         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
640         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
641         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
642         THREAD_COPY_POINTER_GUARD): Define.
643         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
644         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
645         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
646         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
647         Use PTR_DEMANGLE for B0 if defined.
649 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
651         * pthread_create.c (__pthread_create_2_1): Use
652         THREAD_COPY_POINTER_GUARD if available.
653         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
654         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
655         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
656         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
657         * sysdeps/x86_64/tls.h: Likewise.
659 2005-12-15  Roland McGrath  <roland@redhat.com>
661         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
663 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
665         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
666         sysdeps/generic.
667         * errno-loc.c: New file.
669 2005-12-12  Roland McGrath  <roland@redhat.com>
671         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
672         adjustments before choosing stack size.  Update minimum stack size
673         calculation to match allocate_stack change.
675 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
677         * allocatestack.c (allocate_stack): Don't demand that there is an
678         additional full page available on the stack beside guard, TLS, the
679         minimum stack.
681 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
683         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
684         (__cleanup_fct_attribute): Use __regparm__ not regparm.
686         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
687         compiling 32-bit code we must define __cleanup_fct_attribute.
689 005-11-24  Jakub Jelinek  <jakub@redhat.com>
691         [BZ #1920]
692         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
693         __attribute__ instead of __attribute.
694         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
695         (__cleanup_fct_attribute): Likewise.
697 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
699         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
700         a write barrier before writing libgcc_s_getcfa.
702 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
704         * sysdeps/unix/sysv/linux/configure: Removed.
706 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
708         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
709         optional init_array/fini_array support.
711 2005-10-24  Roland McGrath  <roland@redhat.com>
713         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
714         versioned_symbol use.
716 2005-10-16  Roland McGrath  <roland@redhat.com>
718         * init.c (__pthread_initialize_minimal_internal): Even when using a
719         compile-time default stack size, apply the minimum that allocate_stack
720         will require, and round up to page size.
722 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
724         * Makefile ($(test-modules)): Remove static pattern rule.
726 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
727             Ulrich Drepper  <drepper@redhat.com>
729         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
730         alignment in callback function.
731         * Makefile: Add rules to build and run tst-align3.
732         * tst-align3.c: New file.
734 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
736         * allocatestack.c (setxid_signal_thread): Add
737         INTERNAL_SYSCALL_DECL (err).
739 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
741         * allocatestack.c (setxid_signal_thread): Need to use
742         atomic_compare_and_exchange_bool_acq.
744 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
745             Jakub Jelinek  <jakub@redhat.com>
747         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
748         CANCEL_RESTMASK.
749         (struct pthread): Move specific_used field to avoid padding.
750         Add setxid_futex field.
751         * init.c (sighandler_setxid): Reset setxid flag and release the
752         setxid futex.
753         * allocatestack.c (setxid_signal_thread): New function.  Broken
754         out of the bodies of the two loops in __nptl_setxid.  For undetached
755         threads check whether they are exiting and if yes, don't send a signal.
756         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
757         * pthread_create.c (start_thread): For undetached threads, check
758         whether setxid bit is set.  If yes, wait until signal has been
759         processed.
761         * allocatestack.c (STACK_VARIABLES): Initialize them.
762         * pthread_create.c (__pthread_create_2_1): Initialize pd.
764 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
766         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
767         waiters, awake all waiters on the associated mutex.
769 2005-09-22  Roland McGrath  <roland@redhat.com>
771         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
772         ../sysdeps/x86_64/hp-timing.h).
774 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
776         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
777         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
778         (lll_futex_wake_unlock): Define.
779         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
780         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
781         (lll_futex_wake_unlock): Define.
782         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
783         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
784         (lll_futex_wake_unlock): Define.
785         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
786         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
787         (lll_futex_wake_unlock): Define.
788         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
789         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
790         (lll_futex_wake_unlock): Define.
791         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
792         lll_futex_wake_unlock.
793         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
794         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
795         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
796         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
797         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
798         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
800 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
802         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
803         Fix typo in register name.
805 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
807         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
808         Use __sigfillset.  Document that sigfillset does the right thing wrt
809         to SIGSETXID.
811 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
813         [BZ #1102]
814         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
815         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
816         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
817         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
818         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
819         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
820         in the structure.
821         * Makefile (tests): Add tst-initializers1.
822         (CFLAGS-tst-initializers1.c): Set.
823         * tst-initializers1.c: New test.
825 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
827         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
828         Make sure __flags are located at offset 48 from the start of the
829         structure.
831 2005-07-02  Roland McGrath  <roland@redhat.com>
833         * Makeconfig: Comment fix.
835 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
837         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
838         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
839         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
840         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
841         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
842         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
843         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
844         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
845         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
846         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
848 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
850         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
851         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
852         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
853         fields.
854         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
855         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
856         field.  Put in sysinfo field unconditionally.
857         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
858         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
859         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
860         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
861         fields.
862         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
863         * pthread_create.c (__pthread_create_2_1): Use
864         THREAD_COPY_STACK_GUARD macro.
865         * Makefile: Add rules to build and run tst-stackguard1{,-static}
866         tests.
867         * tst-stackguard1.c: New file.
868         * tst-stackguard1-static.c: New file.
870 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
872         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
873         Invoke CGOTSETUP and CGOTRESTORE.
874         (CGOTSETUP, CGOTRESTORE): Define.
876 2005-05-29  Richard Henderson  <rth@redhat.com>
878         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
879         (tf_write, tf_writev): Use it.
880         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
881         the system minimum.
883 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
885         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
886         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
887         __librt_*_asynccancel@local.
889 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
891         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
892         all occurrences of JUMPTARGET.  Instead append @local to labels.
894 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
896         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
897         size/alignment of struct pthread rather than tcbhead_t.
898         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
899         Likewise.
900         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
901         Likewise.
902         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
903         Likewise.
905 2005-05-19  Richard Henderson  <rth@redhat.com>
907         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
908         __sync_val_compare_and_swap, not explicit _si variant.
909         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
911 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
913         [BZ #915]
914         * sysdeps/pthread/pthread.h: Avoid empty initializers.
916 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
918         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
919         .eh_frame section, use cfi_* directives.
921 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
923         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
924         of "" includes.
926 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
928         [BZ #1075]
929         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
930         aio_write blocks.
932 2005-04-27  Roland McGrath  <roland@redhat.com>
934         * Makefile (tests): Remove tst-clock2.
936         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
937         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
938         translating to the kernel clockid_t for our own process/thread clock.
940         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
942 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
944         * old_pthread_cond_init.c: Include <errno.h>.
945         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
946         process shared or uses clock other than CLOCK_REALTIME.
947         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
949 2005-04-13  David S. Miller  <davem@davemloft.net>
951         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
952         * sysdeps/sparc/sparc64/clone.S: New file.
954 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
956         [BZ #1102]
957         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
958         __inline instead of inline.
959         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
961 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
963         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
964         functionally equivalent, but shorter instructions.
965         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
966         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
967         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
968         Likewise.
969         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
970         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
971         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
972         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
973         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
974         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
975         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
976         Likewise.
977         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
978         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
979         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
980         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
981         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
983 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
985         * sysdeps/mips/Makefile: New file.
986         * sysdeps/mips/nptl-sysdep.S: New file.
987         * sysdeps/mips/tcb-offsets.sym: New file.
988         * sysdeps/mips/pthread_spin_lock.S: New file.
989         * sysdeps/mips/pthread_spin_trylock.S: New file.
990         * sysdeps/mips/pthreaddef.h: New file.
991         * sysdeps/mips/tls.h: New file.
992         * sysdeps/mips/jmpbuf-unwind.h: New file.
993         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
994         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
995         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
996         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
997         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
998         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
999         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
1000         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
1001         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
1002         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
1004 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
1006         [BZ #1112]
1007         * pthread_create.c (__pthread_create_2_1): Rename syscall error
1008         variable to scerr.
1010 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
1012         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
1014 2005-02-25  Roland McGrath  <roland@redhat.com>
1016         * alloca_cutoff.c: Correct license text.
1017         * tst-unload.c: Likewise.
1018         * sysdeps/pthread/allocalim.h: Likewise.
1019         * sysdeps/pthread/pt-initfini.c: Likewise.
1020         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1021         * sysdeps/pthread/bits/sigthread.h: Likewise.
1022         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
1023         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
1025 2005-02-16  Roland McGrath  <roland@redhat.com>
1027         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1028         Use unsigned int * for ptr_nthreads.
1030 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
1032         [BZ #721]
1033         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
1034         gcc4.
1036 2005-02-07  Richard Henderson  <rth@redhat.com>
1038         [BZ #787]
1039         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
1040         argument.
1042 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
1044         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
1045         order of arguments in invocation of atomic_add_zero.
1047 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
1049         [BZ #737]
1050         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
1051         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
1052         at least gotntpoff relocation and addition.
1053         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1054         Likewise.
1055         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
1056         Likewise.
1057         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
1058         Likewise.
1060 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
1062         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
1063         entry for static tls deallocation fix.
1064         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
1065         also contains information whether the memory pointed to is static
1066         TLS or not.
1067         * sysdeps/i386/tls.h: Likewise.
1068         * sysdeps/ia64/tls.h: Likewise.
1069         * sysdeps/powerpc/tls.h: Likewise.
1070         * sysdeps/s390/tls.h: Likewise.
1071         * sysdeps/sh/tls.h: Likewise.
1072         * sysdeps/sparc/tls.h: Likewise.
1073         * sysdeps/x86_64/tls.h: Likewise.
1075 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
1077         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
1079 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
1081         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
1082         %esp.
1083         * Makefile (tests): Add tst-align2.
1084         * tst-align2.c: New test.
1085         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
1086         -mpreferred-stack-boundary=4.
1088 2004-12-18  Roland McGrath  <roland@redhat.com>
1090         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
1091         New file removed withdrawn for the moment.
1093 2004-12-17  Richard Henderson  <rth@redhat.com>
1095         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
1096         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
1098 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
1100         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
1101         Increased PTHREAD_STACK_MIN.
1103         * tst-context1.c (stacks): Use bigger stack size.
1105 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
1107         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
1108         * sysdeps/sparc/tcb-offsets.sym: Add TID.
1110 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
1112         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
1113         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
1114         * sysdeps/s390/tcb-offsets.sym (TID): Add.
1116 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
1118         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
1120 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
1122         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
1123         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
1125         * tst-getpid1.c: If child crashes, report this first.  Print which
1126         signal.
1128 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
1130         * init.c (__pthread_initialize_minimal_internal): Also unblock
1131         SIGSETXID.
1133 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
1135         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
1136         _POSIX_THREAD_CPUTIME): Define to 0.
1137         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
1138         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
1139         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
1140         __timer_signal_thread_tclk): Remove.
1141         (init_module): Remove their initialization.
1142         (thread_cleanup): Remove their cleanup assertions.
1143         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
1144         __timer_signal_thread_tclk): Remove.
1145         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
1146         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
1147         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
1149 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
1151         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
1152         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
1154         * Makefile (tests): Add tst-getpid2.
1155         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
1156         (do_test): Use it.  Use __clone2 instead of clone on ia64.
1157         * tst-getpid2.c: New test.
1159 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1161         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
1163 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
1165         * Makefile (tests): Add tst-getpid1.
1166         * tst-getpid1.c: New file.
1167         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
1168         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
1170 2004-12-02  Roland McGrath  <roland@redhat.com>
1172         * Makefile (libpthread-nonshared): Variable removed.
1173         ($(objpfx)libpthread_nonshared.a): Target removed.
1174         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
1175         These are now handled by generic magic from
1176         libpthread-static-only-routines being set.
1178 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
1180         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
1181         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
1182         _POSIX_THREAD_PRIO_PROTECT): Define.
1183         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1184         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1185         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1187 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
1189         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
1190         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
1191         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
1192         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
1193         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1194         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1195         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1197 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
1199         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
1201         * Makefile (libpthread-routines): Add pthread_setschedprio.
1202         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
1203         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
1204         * pthread_setschedprio.c: New file.
1206 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
1208         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
1209         * pthread_cancel.c (pthread_create): Likewise.
1211         * Makefile (libpthread-routines): Add vars.
1212         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
1213         * init.c (__default_stacksize, __is_smp): Remove.
1214         * vars.c: New file.
1215         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
1216         and define a wrapper macro.
1217         (PTHREAD_STATIC_FN_REQUIRE): Define.
1218         * allocatestack.c (__find_thread_by_id): Undefine.
1219         * pthread_create (__pthread_keys): Remove.
1220         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
1221         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
1222         PTHREAD_STATIC_FN_REQUIRE.
1224 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1226         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
1227         parameter to REGISTER macro.
1229 2004-11-17  Roland McGrath  <roland@redhat.com>
1231         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
1232         Make sure SIGCANCEL is blocked as well.
1234 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
1236         * sysdeps/pthread/setxid.h: New file.
1237         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
1238         (struct xid_command): Add forward decl.
1239         (struct pthread_functions): Change return type of __nptl_setxid hook
1240         to int.
1241         * pthreadP.h (__nptl_setxid): Change return type to int.
1242         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
1243         calling thread, return its return value and set errno on failure.
1244         * descr.h (struct xid_command): Change id type to long array.
1246         * Makefile: Add rules to build and test tst-setuid1 and
1247         tst-setuid1-static.
1248         * tst-setuid1.c: New test.
1249         * tst-setuid1-static.c: New test.
1251 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
1253         * Makefile (tests): Add tst-exit3.
1254         * tst-exit3.c: New test.
1256 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
1258         * Makefile (tests): Add tst-exit2.
1259         * tst-exit2.c: New file.
1261 2004-11-09  Roland McGrath  <roland@redhat.com>
1263         [BZ #530]
1264         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
1265         here, before calling clone.
1266         * pthread_create.c (start_thread): Don't do it here.
1268 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
1270         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
1272 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
1274         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1275         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
1276         assembler warning.
1278 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
1280         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
1281         if sched_priority is not between minprio and maxprio.
1283 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1285         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1286         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
1288         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1289         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
1291 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
1293         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
1294         not-cancelable I/O functions.
1296 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1298         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1299         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
1300         make sure 2 is stored in the futex and we looked at the old value.
1301         Fix a few other problems to return the correct value.
1303 2004-10-14  Richard Henderson  <rth@redhat.com>
1305         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
1306         make gcc4 happy.
1308 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
1310         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
1311         of pthread-functions.h and pthreaddef.h.
1312         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
1314         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1315         Change __data.__nwaiters from int to unsigned int.
1317         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
1318         sysconf (_SC_THREAD_CPUTIME) returns negative value.
1320         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
1321         before return type.
1323         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
1324         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
1326 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
1328         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
1329         test fails, remove message queue.
1330         (tf_msgsnd): Likewise.
1332 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
1334         * tst-clock1.c: Change #ifdef to #if defined.
1335         * tst-clock2.c: Likewise.
1336         * tst-cond11.c: Likewise.
1338         * sysdeps/pthread/timer_create.c (timer_create): Use
1339         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
1340         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
1341         THREAD_CPUTIME.
1343 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
1345         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
1346         _POSIX_THREAD_CPUTIME): Define to 0.
1348 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
1350         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
1351         and _POSIX_THREAD_CPUTIME to zero.
1352         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1353         * tst-barrier2.c: Fix testing for POSIX feature.
1354         * tst-clock1.c: Likewise.
1355         * tst-clock2.c: Likewise.
1356         * tst-cond11.c: Likewise.
1357         * tst-cond4.c: Likewise.
1358         * tst-cond6.c: Likewise.
1359         * tst-flock2.c: Likewise.
1360         * tst-mutex4.c: Likewise.
1361         * tst-mutex9.c: Likewise.
1362         * tst-rwlock12.c: Likewise.
1363         * tst-rwlock4.c: Likewise.
1364         * tst-signal1.c: Likewise.
1365         * tst-spin2.c: Likewise.
1366         * sysdeps/pthread/posix-timer.h: Likewise.
1367         * sysdeps/pthread/timer_create.c: Likewise.
1368         * sysdeps/pthread/timer_routines.c: Likewise.
1370 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
1372         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1373         (__lll_mutex_timedlock_wait): Address futex correctly.
1375         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1376         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
1377         make sure 2 is stored in the futex and we looked at the old value.
1378         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1379         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
1380         which might very well made the code not working at all before.
1381         [BZ #417]
1383 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
1385         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
1386         allow SIGSETXID to be sent.
1387         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
1388         for SIGSETXID to be defined.
1389         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
1390         SIGSETXID cannot be blocked.
1392         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1393         Add __extension__ to long long types.
1394         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1395         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1396         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1397         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1398         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1399         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1400         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1402 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
1404         * descr.h (struct pthread): Add stopped_start field.
1405         * sysdeps/pthread/createthread.c (create_thread): Set
1406         start_stopped flag in descriptor for new thread appropriately.
1407         * pthread_create.c (start_thread): Only take lock to be stopped on
1408         startup if stopped_start flag says so.
1410 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
1412         * pthread_create.c (__pthread_create_2_1): Remember whether thread
1413         is created detached and if yes, do not try to free the stack in case
1414         the thread creation failed.
1415         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
1416         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
1417         case there has been no error.  [BZ #405]
1419         * pthread_create.c (start_thread): Don't wait for scheduler data
1420         etc to be set at the beginning of the function.  The cancellation
1421         infrastructure must have been set up.  And enable async
1422         cancellation before potentially going to sleep.  [BZ #401]
1424 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
1426         * Versions: Remove exports for pthread_set*id_np functions.
1427         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
1428         for now.
1429         * Makefile: Don't build pthread_set*id code for now.
1431 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
1433         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
1434         internal use.
1435         * allocatestack.c (__nptl_setxid): New function.
1436         * descr.h (struct xid_command): Define type.
1437         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
1438         (sighandler_setxid): New function.
1439         (__pthread_initialize_minimal): Register sighandler_setxid for
1440         SIGCANCEL.
1441         * pt-allocrtsig.c: Update comment.
1442         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
1443         Declare __nptl_setxid.
1444         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
1445         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
1446         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1447         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1448         and pthread_setresuid_np.
1449         * pthread_setgid_np.c: New file.
1450         * pthread_setuid_np.c: New file.
1451         * pthread_setegid_np.c: New file.
1452         * pthread_seteuid_np.c: New file.
1453         * pthread_setregid_np.c: New file.
1454         * pthread_setreuid_np.c: New file.
1455         * pthread_setresgid_np.c: New file.
1456         * pthread_setresuid_np.c: New file.
1457         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
1458         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1459         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1460         and pthread_setresuid_np.
1461         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
1462         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
1463         pthread_setregid, and pthread_setresgid.
1465 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
1467         * allocatestack.c (allocate_stack): Return EAGAIN instead of
1468         ENOMEM when out of memory.
1470 2004-09-10  Roland McGrath  <roland@redhat.com>
1472         [BZ #379]
1473         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
1474         code, since we don't try to use the broken CLONE_STOPPED any more.
1475         * pthread_create.c (start_thread): Likewise.
1477 2004-09-15  Richard Henderson  <rth@redhat.com>
1479         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
1481 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
1483         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
1484         (__libc_unwind_longjmp): Delete macro and declare as function.
1485         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
1486         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
1487         nptl directory.
1488         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
1489         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
1490         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
1492 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
1494         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
1495         for __USE_XOPEN2K.
1496         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
1497         types also for __USE_XOPEN2K.
1498         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1499         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1500         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1501         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1502         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1503         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1504         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1505         [BZ #320]
1507 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
1509         * sysdeps/pthread/pthread.h
1510         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
1511         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
1512         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
1513         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
1514         [BZ #375]
1516 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
1518         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
1519         PSEUDO to be used with . prefix.
1521         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
1522         Use atomic_increment instead of atomic_exchange_and_add.
1523         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
1524         Likewise.
1525         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
1526         Likewise.
1527         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1528         Likewise.
1530         * allocatestack.c (allocate_stack): Use atomic_increment_val
1531         instead of atomic_exchange_and_add.
1532         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
1533         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1534         Likewise.
1535         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1536         Likewise.
1538         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
1539         the initialization function might throw.
1541 2005-09-05  Richard Henderson  <rth@redhat.com>
1543         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1544         Move definition inside libpthread, libc, librt check.  Provide
1545         definition for rtld.
1547 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
1549         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
1550         * sysdeps/i386/jmpbuf-unwind.h: Likewise
1551         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
1552         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
1553         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
1554         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
1555         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
1556         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
1557         * unwind.c: Use it.
1559         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1560         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
1561         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1562         Likewise.
1563         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1564         Decrement __nwaiters.  If pthread_cond_destroy has been called and
1565         this is the last waiter, signal pthread_cond_destroy caller and
1566         avoid using the pthread_cond_t structure after unlock.
1567         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1568         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1569         Read clock type from the least significant bits of __nwaiters instead
1570         of __clock.
1571         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1572         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
1574 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
1576         [BZ #342]
1577         * Makefile (tests): Add tst-cond20 and tst-cond21.
1578         * tst-cond20.c: New test.
1579         * tst-cond21.c: New test.
1580         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1581         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
1582         it unsigned int.
1583         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1584         Likewise.
1585         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1586         (pthread_cond_t): Likewise.
1587         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1588         Likewise.
1589         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1590         Likewise.
1591         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1592         Likewise.
1593         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
1594         (cond_nwaiters): New.
1595         (clock_bits): New.
1596         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
1597         if there are waiters not signalled yet.
1598         Wait until all already signalled waiters wake up.
1599         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
1600         __nwaiters.  If pthread_cond_destroy has been called and this is the
1601         last waiter, signal pthread_cond_destroy caller and avoid using
1602         the pthread_cond_t structure after unlock.
1603         (__pthread_cond_wait): Increment __nwaiters in the beginning,
1604         decrement it when leaving.  If pthread_cond_destroy has been called
1605         and this is the last waiter, signal pthread_cond_destroy caller.
1606         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1607         Likewise.  Read clock type from the least significant bits of
1608         __nwaiters instead of __clock.
1609         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
1610         whether clock ID can be encoded in COND_CLOCK_BITS bits.
1611         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
1612         clock type just from the last COND_CLOCK_BITS bits of value.
1613         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
1614         instead of __clock, just from second bit of condattr's value.
1616 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
1618         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
1619         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
1620         != 64.
1621         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1623 2004-08-15  Roland McGrath  <roland@frob.com>
1625         * pthread_atfork.c: Update copyright terms including special exception
1626         for these trivial files, which are statically linked into executables
1627         that use dynamic linking for the significant library code.
1629 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
1631         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
1632         pthread_rwlock_rdlock.
1633         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
1634         Decrease __nr_readers_queued after reacquiring lock.
1635         * sysdeps/pthread/pthread_rwlock_timedrdlock
1636         (pthread_rwlock_timedrdlock): Likewise.
1637         Reported by Bob Cook <bobcook47@hotmail.com>.
1639 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
1641         * tst-rwlock14.c (tf): Read main thread handle from *ARG
1642         before pthread_barrier_wait.
1644 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
1646         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1647         Remove unnecessary exception handling data.
1649 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
1651         [BZ #284]
1652         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
1653         instead of clockid_t.
1655 2004-07-21  Roland McGrath  <roland@redhat.com>
1657         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
1659 2004-07-19  Roland McGrath  <roland@redhat.com>
1661         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
1663 2004-07-02  Roland McGrath  <roland@redhat.com>
1665         * configure: Don't exit.
1667 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1669         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1670         (__pthread_cond_timedwait): Check for invalid nanosecond in
1671         timeout value.
1673 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
1675         * Makefile: Add rules to build and run tst-fini1.
1676         * tst-fini1.c: New file.
1677         * tst-fini1mod.c: New file.
1679 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
1681         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
1682         if no cancellation support is needed.
1683         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1684         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1685         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1686         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1687         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1688         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1689         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1690         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1691         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1693         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
1694         only if not already defined.
1696 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
1698         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
1699         constraint "m" instead of "0" for futex.
1701         * shlib-versions: Add powerpc64-.*-linux.*.
1703 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
1705         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
1706         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
1707         for valid tv_nsec.
1708         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
1709         1 billion and 64-bit tv_nsec which is valid when truncated to 32
1710         bits.
1712 2004-06-29  Roland McGrath  <roland@redhat.com>
1714         * Banner: NPTL no longer has its own version number.
1715         * Makefile (nptl-version): Variable removed.
1716         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
1717         using $(version), the glibc version number.
1719 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1721         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
1722         Fix branch offset for a PLT entry.
1723         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
1724         Likewise.
1725         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1726         Likewise.
1727         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
1728         Likewise.
1729         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
1730         Likewise.
1732 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1734         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
1735         unconditionally.
1737 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1739         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1740         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
1741         instead of tv_sec.
1742         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
1743         (pthread_rwlock_timedrdlock): Likewise.
1745 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
1747         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1748         Set __r7 to val, not mutex.
1750 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
1752         * Makefile: Add rules to build tst-rwlock14.
1753         * tst-rwlock14.c: New file.
1755 2004-06-24  Boris Hu  <boris.hu@intel.com>
1757         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
1758         check.
1759         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1761 2004-06-19  Andreas Jaeger  <aj@suse.de>
1763         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
1764         assembler in last patch.
1766 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
1768         * sysdeps/pthread/pthread_cond_timedwait.c
1769         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
1770         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1771         (__pthread_cond_timedwait): Check for invalid nanosecond in
1772         timeout value.
1773         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1774         * tst-cond19.c: New file.
1775         * Makefile: Add rules to build and run tst-cond19.
1777 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
1779         * tst-context1.c (GUARD_PATTERN): Defined.
1780         (tst_context_t): Define struct containing ucontext_t & guard words.
1781         (ctx): Declare as an array of tst_context_t.
1782         (fct): Verify uc_link & guard words are still valid.
1783         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
1785 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1787         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1788         Add __data.__futex field, reshuffle __data.__clock.
1789         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
1790         (__pthread_cond_signal): Increment __futex at the same time as
1791         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1792         address of low 32-bits of __wakeup_seq to futex syscall.
1793         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
1794         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1795         releasing internal lock to FUTEX_WAIT.
1796         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1797         (__pthread_cond_timedwait): Likewise.
1798         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1799         (FUTEX_CMP_REQUEUE): Define.
1800         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1801         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1802         Pass __futex value from before the unlock and __futex address instead
1803         of address of low 32-bits of __wakeup_seq to futex syscall.
1804         Fallback to FUTEX_WAKE all on any errors.
1806 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
1808         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
1809         comment typo.
1810         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
1811         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
1812         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
1813         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
1814         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
1816 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1818         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
1819         Add memory clobber to inline assembly.
1820         (__lll_mutex_trylock): Likewise.
1821         (__lll_mutex_cond_trylock): Likewise.
1823 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1825         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1826         Pass val argument as 6th system call argument in %r7.
1828 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1830         * Makefile (tests): Add tst-cond16.
1831         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
1832         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
1833         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1834         Add __data.__futex field, reshuffle __data.__clock.
1835         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
1836         (__pthread_cond_signal): Increment __futex at the same time as
1837         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1838         address of low 32-bits of __wakeup_seq to futex syscall.
1839         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
1840         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1841         releasing internal lock to FUTEX_WAIT.
1842         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
1843         (__pthread_cond_timedwait): Likewise.
1844         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
1845         (FUTEX_CMP_REQUEUE): Define.
1846         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1847         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1848         Pass __futex value from before the unlock and __futex address instead
1849         of address of low 32-bits of __wakeup_seq to futex syscall.
1850         Fallback to FUTEX_WAKE all on any errors.
1851         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
1852         Define.
1853         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1854         internally.  Return non-zero if error, zero if success.
1855         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1856         Add __data.__futex field, reshuffle __data.__clock.
1857         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
1858         Define.
1859         (lll_futex_requeue): Add val argument, return 1 unconditionally
1860         for the time being.
1861         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1862         Add __data.__futex field, reshuffle __data.__clock.
1863         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1864         Define.
1865         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1866         internally.  Return non-zero if error, zero if success.
1867         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1868         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
1869         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1870         Define.
1871         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1872         internally.  Return non-zero if error, zero if success.
1873         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1874         Add __data.__futex field, reshuffle __data.__clock.
1875         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
1876         Define.
1877         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1878         internally.  Return non-zero if error, zero if success.
1879         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1880         Add __data.__futex field, reshuffle __data.__clock.
1881         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1882         Add __data.__futex field, reshuffle __data.__clock.
1883         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
1884         Increment __futex at the same time as __wakeup_seq or __total_seq.
1885         Pass address of __futex instead of address of low 32-bits of
1886         __wakeup_seq to futex syscall.
1887         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1888         Pass __futex value from before releasing internal lock
1889         to FUTEX_WAIT.
1890         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1891         Likewise.  Avoid unnecessary shadowing of variables.
1892         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
1893         Set __futex to 2 * __total_seq.  Pass __futex value from before the
1894         unlock and __futex address instead of address of low 32-bits of
1895         __wakeup_seq to futex_requeue macro, adjust for new return value
1896         meaning.
1897         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1898         (__pthread_cond_signal): Increment __futex at the same time as
1899         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1900         address of low 32-bits of __wakeup_seq to futex syscall.
1901         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1902         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1903         releasing internal lock to FUTEX_WAIT.
1904         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1905         (__pthread_cond_timedwait): Likewise.
1906         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1907         (FUTEX_CMP_REQUEUE): Define.
1908         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1909         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1910         Pass __futex value from before the unlock and __futex address instead
1911         of address of low 32-bits of __wakeup_seq to futex syscall.
1912         Fallback to FUTEX_WAKE all on any errors.
1914 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1916         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
1917         Add nop to align the end of critical section.
1918         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
1920 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1922         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1923         Add __broadcast_seq field.
1924         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
1925         all waiters as woken with woken_seq and bump broadcast counter.
1926         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
1927         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
1928         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1929         Comment typo fixes.  Avoid returning -ETIMEDOUT.
1931 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
1933         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1934         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
1935         Reported by Kaz Kojima.
1937 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
1939         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
1941 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1943         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
1944         __broadcast_seq with bc_seq after acquiring internal lock instead of
1945         before it.
1947 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
1949         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
1950         compilation.
1951         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1952         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
1953         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1954         (pthread_cond_t): Add __data.__broadcast_seq field.
1955         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1956         (FRAME_SIZE): Define.
1957         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
1958         Comment typo fixes.
1959         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
1960         Define.
1961         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
1962         typo fixes.
1963         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1964         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
1965         fixes.
1967 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
1969         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
1970         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1971         Add __broadcast_seq field.
1972         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1973         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1974         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1975         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1976         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1977         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
1978         all waiters as woken with woken_seq and bump broadcast counter.
1979         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
1980         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
1981         __broadcast_seq field.
1982         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1983         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1984         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1985         * pthread_cond_init.c: Initialize __broadcast_seq field.
1986         * Makefile (tests): Add tst-cond17 and tst-cond18.
1987         Add .NOTPARALLEL goal.
1988         * tst-cond16.c: New file.  From Jakub.
1989         * tst-cond17.c: New file.  From Jakub.
1990         * tst-cond18.c: New file.  From Jakub.
1992 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
1994         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
1995         unwind info.
1997         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1998         Parametrize frame size.  Correct some unwind info.
1999         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2001 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
2003         * tst-stack3.c: Note testing functionality beyond POSIX.
2005 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
2007         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
2008         Change conditional from ifdef to if.
2010 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
2012         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
2013         SYSDEP_CANCEL_ERROR): Define.
2014         (PSEUDO): Use it.
2016 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
2018         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
2020 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
2022         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
2024 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2026         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
2027         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2028         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
2029         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2031 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
2033         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
2034         thread has all signals blocked.
2036 2004-04-18  Andreas Jaeger  <aj@suse.de>
2038         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
2039         (SEM_VALUE_MAX): Add missing brace.
2041 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
2043         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
2044         in rt subdir.
2045         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
2046         * sysdeps/pthread/tst-mqueue8x.c: New test.
2047         * tst-cancel4.c: Update comment about message queues.
2049         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
2050         return it_value { 0, 0 }.
2051         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
2052         like SIGEV_SIGNAL.
2053         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
2054         assertion for SIGEV_NONE.
2055         (thread_attr_compare): Compare all attributes, not just a partial
2056         subset.
2058 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
2060         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
2062 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
2064         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
2065         Just use a plain number.
2066         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
2067         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2068         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2069         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2070         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2071         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2072         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2074 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2076         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
2077         frame info.
2078         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2080 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
2082         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
2083         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
2084         of calling sigwaitinfo.
2086 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
2088         * allocatestack.c (allocate_stack): Set reported_guardsize
2089         unconditionally.
2090         * pthread_getattr_np.c (pthread_getattr_np): Use
2091         reported_guardsize instead of guardsize.
2092         * descr.h (struct pthread): Add reported_guardsize field.
2094 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
2096         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
2098 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
2100         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
2102 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
2104         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
2105         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
2106         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
2107         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
2108         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
2109         Define.
2110         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
2111         (_POSIX_MESSAGE_PASSING): Define.
2112         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
2113         (_POSIX_MESSAGE_PASSING): Define.
2114         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
2115         (_POSIX_MESSAGE_PASSING): Define.
2117 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
2119         * tst-context1.c (fct): Check whether correct stack is used.
2121 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
2123         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
2124         matching constraints for asm mem parameters.
2126         * tst-clock2.c (tf): Don't define unless needed.
2128 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
2130         * Makefile (link-libc-static): Use $(static-gnulib) instead of
2131         $(gnulib).
2133 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
2135         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
2136         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
2137         * pthreadP.h: Declare __nptl_deallocate_tsd.
2138         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
2139         Adjust caller.
2141         * Makefile (tests): Add tst-tsd5.
2142         * tst-tsd5.c: New file.
2144 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
2146         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2147         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
2148         is SHLIB_COMPAT check.
2149         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
2150         (__pthread_attr_getaffinity_old): Likewise.
2151         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2152         (__pthread_getaffinity_old): Likewise.
2153         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2154         (__pthread_setaffinity_old): Likewise.
2156 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
2158         * allocatestack.c (_make_stacks_executable): Call
2159         _dl_make_stack_executable first.
2161 2004-03-24  Roland McGrath  <roland@redhat.com>
2163         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
2164         constraint instead of "0".
2166 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
2168         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2169         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
2171         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
2172         code to avoid warning.
2174 2004-03-24  Andreas Jaeger  <aj@suse.de>
2176         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2177         (__pthread_attr_setaffinity_old): Remove const.
2179 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
2181         * sysdeps/unix/sysv/linux/smp.h: New file.
2182         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
2183         * init.c: Define __is_smp.
2184         (__pthread_initialize_minimal_internal): Call is_smp_system to
2185         initialize __is_smp.
2186         * pthreadP.h: Declare __is_smp.
2187         Define MAX_ADAPTIVE_COUNT is necessary.
2188         * pthread_mutex_init.c: Add comment regarding __spins field.
2189         * pthread_mutex_lock.c: Implement adaptive mutex type.
2190         * pthread_mutex_timedlock.c: Likewise.
2191         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2192         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2193         Add __spins field.
2194         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2195         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2196         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2197         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2198         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2199         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2200         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2201         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
2202         lll_mutex_cond_trylock.
2203         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2204         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2205         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2206         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2207         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2208         Define BUSY_WAIT_NOP.
2209         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2210         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2212         * tst-mutex5.c: Add support for testing adaptive mutexes.
2213         * tst-mutex7.c: Likewise.
2214         * tst-mutex5a.c: New file.
2215         * tst-mutex7a.c: New file.
2216         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
2218         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2219         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
2220         vgettimeofday call might destroy the content.
2222         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
2223         @pause in the loop.
2225         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
2226         No need to restrict type of ret.  Make it int.  Add comment.
2228         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
2229         Remove unnecessary setne instruction.
2231 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
2233         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2234         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
2235         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
2236         If realloc fails, break out of the loop.
2238 2004-03-20  Andreas Jaeger  <aj@suse.de>
2240         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2241         (__pthread_setaffinity_old): Fix interface.
2242         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2243         (__pthread_getaffinity_old): Likewise.
2245         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2246         (__pthread_setaffinity_new): Remove duplicate declaration.
2248 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2250         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
2251         the return value to a safe register.
2252         (CDISABLE): Set the function argument correctly.
2254 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2256         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
2257         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
2258         Rewrite so that only one locked memory operation per round is needed.
2259         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
2260         (pthread_barrier_wait): After wakeup, release lock only when the
2261         last thread stopped using the barrier object.
2262         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
2263         (__pthread_cond_wait): Don't store mutex address if the current
2264         value is ~0l.  Add correct cleanup support and unwind info.
2265         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2266         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
2267         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
2268         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
2269         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
2270         Add correct cleanup support and unwind info.
2271         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
2272         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
2273         information for syscall wrappers.
2275 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
2277         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2278         cpusetsize field, remove next.
2279         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
2280         parameter for size of the CPU set.
2281         (pthread_setaffinity_np): Likewise.
2282         (pthread_attr_getaffinity_np): Likewise.
2283         (pthread_attr_setaffinity_np): Likewise.
2284         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
2285         interface change, keep compatibility code.
2286         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2287         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
2288         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
2289         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
2290         __pthread_getaffinity_np.
2291         * Versions: Add version for changed interfaces.
2292         * tst-attr3.c: Adjust test for interface change.
2293         * pthread_getattr_np.c: Query the kernel about the affinity mask with
2294         increasing buffer sizes.
2295         * pthread_attr_destroy.c: Remove unused list handling.
2296         * pthread_attr_init.c: Likewise.
2298 2004-03-17  Roland McGrath  <roland@redhat.com>
2300         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
2301         first argument to clock_getres so we ever enable kernel timers.
2303 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
2305         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
2307 2004-03-12  Richard Henderson  <rth@redhat.com>
2309         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
2310         oldvalue from CENABLE to CDISABLE.
2312 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
2314         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
2315         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2316         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2317         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2319 2004-03-11  Richard Henderson  <rth@redhat.com>
2321         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
2322         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
2323         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
2325 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
2327         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
2328         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
2329         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
2331 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
2333         * forward.c (__pthread_cond_broadcast_2_0,
2334         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
2335         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
2336         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
2338 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2340         * sysdeps/sh/tcb-offsets.sym: Add PID.
2341         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
2342         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
2344 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
2346         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
2347         include <sysdep-cancel.h>, vfork is no cancellation point.
2348         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
2349         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
2350         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
2352 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
2354         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
2355         libc_hidden_def.
2356         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
2357         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
2358         Likewise.
2359         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
2360         Likewise.
2361         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
2362         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
2363         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
2364         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
2365         of DO_CALL_VIA_BREAK.  Work around a gas problem.
2367         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
2368         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
2369         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
2370         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
2371         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
2372         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
2374         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
2375         a local register for saving old PID.  Negate PID in parent upon exit.
2377         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
2378         tcb-offsets.h.
2379         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2380         before syscall, set to the old value in the parent afterwards.
2381         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
2382         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
2383         tcb-offsets.h.
2384         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2385         before syscall, set to the old value in the parent afterwards.
2386         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
2387         * sysdeps/s390/tcb-offsets.sym: Add PID.
2389         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
2390         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
2391         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
2392         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
2393         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
2394         * sysdeps/sparc/tcb-offsets.sym: Add PID.
2396 2004-03-10  Andreas Schwab  <schwab@suse.de>
2398         * sysdeps/ia64/tcb-offsets.sym: Add PID.
2399         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
2400         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
2402 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
2404         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
2405         * tst-cancel21.c (do_one_test): Likewise.
2406         Reported by Gordon Jin <gordon.jin@intel.com>.
2408 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
2410         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
2411         if non-zero and set to INT_MIN if zero.
2412         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
2413         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
2414         (SAVE_PID, RESTORE_PID): Define.
2415         (__vfork): Use it.
2416         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
2417         Use relative path to avoid including NPTL i386/vfork.S.
2418         (SAVE_PID, RESTORE_PID): Define.
2419         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
2420         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
2421         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
2422         tst-vfork2x.
2423         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
2424         * tst-vfork1.c: New test.
2425         * tst-vfork2.c: New test.
2426         * tst-vfork1x.c: New test.
2427         * tst-vfork2x.c: New test.
2429 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
2431         * sysdeps/i386/tcb-offsets.sym: Add PID.
2432         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2433         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
2434         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
2436 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
2438         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
2440 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2442         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2443         _rtld_global_ro.
2445 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
2447         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2448         _rtld_global_ro.
2450         * tst-once4.c: Remove unnecessary macro definition.
2452         * tst-mutex7.c (do_test): Limit thread stack size.
2453         * tst-once2.c (do_test): Likewise.
2454         * tst-tls3.c (do_test): Likewise.
2455         * tst-tls1.c (do_test): Likewise.
2456         * tst-signal3.c (do_test): Likewise.
2457         * tst-kill6.c (do_test): Likewise.
2458         * tst-key4.c (do_test): Likewise.
2459         * tst-join4.c (do_test): Likewise.
2460         * tst-fork1.c (do_test): Likewise.
2461         * tst-context1.c (do_test): Likewise.
2462         * tst-cond2.c (do_test): Likewise.
2463         * tst-cond10.c (do_test): Likewise.
2464         * tst-clock2.c (do_test): Likewise.
2465         * tst-cancel10.c (do_test): Likewise.
2466         * tst-basic2.c (do_test): Likewise.
2467         * tst-barrier4.c (do_test): Likewise.
2469 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
2471         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
2473 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
2475         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2476         (__pthread_cond_timedwait): Optimize wakeup test.
2477         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2478         (__pthread_cond_wait): Likewise.
2479         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2480         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2481         Likewise.
2483 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
2485         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2486         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
2487         the atomic instruction needed.
2488         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2489         (__lll_mutex_lock_wait): Likewise.
2491 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
2493         * Makefile (tests): Add tst-cond14 and tst-cond15.
2494         * tst-cond14.c: New file.
2495         * tst-cond15.c: New file.
2497 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
2499         * sysdeps/pthread/createthread.c (create_thread): Remove use of
2500         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
2501         needs to be implemented differently to be useful.
2503 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
2505         * pthread_attr_setschedparam.c: Don't test priority against limits
2506         here.  Set ATTR_FLAG_SCHED_SET flag.
2507         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
2508         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
2509         from parent thread to child.  If attribute is used and scheduling
2510         parameters are not inherited, copy parameters from attribute or
2511         compute them.  Check priority value.
2512         * pthread_getschedparam.c: If the parameters aren't known yet get
2513         them from the kernel.
2514         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
2515         ATTR_FLAG_POLICY_SET flag for thread.
2516         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
2517         and ATTR_FLAG_POLICY_SET.
2519         * sysdeps/pthread/createthread.c: Use tgkill if possible.
2521         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
2522         fail if stack address hasn't been set.  Just return 0.
2524 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
2526         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
2527         libpthread for the files in this list.
2528         (CFLAGS-tst-unload): Removed.
2529         * tst-unload.c (do_test): Don't use complete path for
2530         LIBPHREAD_SO.
2532         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
2533         tst-_res1mod2.
2535 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
2537         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2538         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
2539         operation per round is needed.
2540         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2541         (__lll_mutex_lock_wait): Likewise.
2543 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
2545         * tst-cancel9.c (cleanup): Don't print to stderr.
2547 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2549         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
2551 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
2553         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2554         (__syscall_error_handler2): Call CDISABLE.
2555         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2556         (__syscall_error_handler2): Call CDISABLE.
2558         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2559         Release lock before the loop, don't reacquire it.
2561         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
2563 2004-02-19  Andreas Schwab  <schwab@suse.de>
2565         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2566         Fix last change.
2568 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
2570         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
2571         (pthread_barrier_wait): After wakeup, release lock only when the
2572         last thread stopped using the barrier object.
2573         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
2574         (pthread_barrier_wait): Likewise.
2575         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2576         Likewise.
2577         * Makefile (tests): Add tst-barrier4.
2578         * tst-barrier4.c: New file.
2580         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2581         (__pthread_cond_timedwait): Perform timeout test while holding
2582         internal lock to prevent wakeup race.
2583         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2584         * sysdeps/pthread/pthread_cond_timedwait.c
2585         (__pthread_cond_timedwait): Likewise.
2586         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2587         (__pthread_cond_timedwait): Likewise.
2589 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
2591         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
2592         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
2593         * Makefile (tests): Add tst-rwlock13.
2594         * tst-rwlock13.c: New test.
2596 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
2598         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2599         (__condvar_tw_cleanup): Little optimization.
2600         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2602 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
2604         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
2605         libpthread as "lib" parameter to SHLIB_COMPAT.
2606         (__novmx_siglongjmp): Fix typo in function name.
2607         (__novmx_longjmp): Fix typo in function name.
2609 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2611         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
2612         __builtin_expect.
2614         * sysdeps/generic/pt-longjmp.c: Moved to...
2615         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
2617 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
2619         * Makefile (libpthread-routines): Add pt-cleanup.
2620         * pt-longjmp.c: Removed.
2621         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
2622         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
2623         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
2624         Version longjmp, siglongjmp for GLIBC_2.3.4.
2625         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
2627 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2629         * sysdeps/pthread/pthread_cond_timedwait.c
2630         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
2631         Reuse code.  Add __builtin_expects.
2633         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2634         (__pthread_cond_timedwait): Get internal lock in case timeout has
2635         passed before the futex syscall.
2636         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2638 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
2640         * allocatestack.c: Pretty printing.
2642         * sysdeps/pthread/createthread.c (create_thread): Don't add
2643         CLONE_DETACHED bit if it is not necessary.
2645 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
2647         * pthread_getattr_np.c: Include ldsodefs.h.
2649 2004-01-16  Richard Henderson  <rth@redhat.com>
2651         * allocatestack.c: Don't declare __libc_stack_end.
2652         * init.c (__pthread_initialize_minimal_internal): Likewise.
2653         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
2655 2004-01-15  Richard Henderson  <rth@redhat.com>
2657         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
2658         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
2659         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
2660         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
2661         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
2662         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
2663         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
2664         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
2666 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
2668         * init.c (pthread_functions): Make array const.
2670 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
2672         * allocatestack.c (__make_stacks_executable): Change interface.
2673         Check parameters.  Pass parameter on to libc counterpart.
2674         * pthreadP.h: Change declaration.
2676 2004-01-13  Richard Henderson  <rth@redhat.com>
2678         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
2679         prototype form.
2680         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
2681         Likewise.
2683         * sysdeps/alpha/Makefile: New file.
2684         * sysdeps/alpha/tcb-offsets.sym: New file.
2685         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2686         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
2688         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
2689         on powerpc version.
2691 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
2693         * Makefile (tests): Add tst-backtrace1.
2694         * tst-backtrace1.c: New test.
2696 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
2698         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
2699         register as second parameter to the REGISTER macro.
2700         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
2701         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
2702         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
2703         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
2704         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
2705         of thread register as second parameter to REGISTER macro in 64 case.
2707 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
2709         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
2710         (CFLAGS-getpid.o): Defined.
2711         (CFLAGS-getpid.os): Defined.
2713 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
2715         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
2716         returned for main thread does not overlap with any other VMA.
2717         Patch by Jakub Jelinek.
2719 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
2721         * tst-raise1.c: Include stdio.h.
2723 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
2725         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
2726         setting with __ASSUME_TGKILL || defined __NR_tgkill.
2727         If pid is 0, set it to selftid.
2728         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
2729         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
2730         != 0, return self->tid without doing a syscall.
2731         * descr.h (struct pthread): Move pid field after tid.
2733         * Makefile (tests): Add tst-raise1.
2734         * tst-raise1.c: New file.
2736 2003-12-23  Roland McGrath  <roland@redhat.com>
2738         * tst-oddstacklimit.c: New file.
2739         * Makefile (tests): Add it.
2740         (tst-oddstacklimit-ENV): New variable.
2742         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
2743         value up to page size for __default_stacksize.
2745 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
2747         * Makefile (tests): Add tst-eintr5.
2748         * tst-eintr5.c: New file.
2750         * eintr.c (eintr_source): Prevent sending signal to self.
2752         * tst-eintr2.c (tf1): Improve error message.
2754 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
2756         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
2757         * sysdeps/unix/sysv/linux/getpid.c: New file.
2758         * pthread_cancel.c: Add comment explaining use of PID field.
2759         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2760         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
2761         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
2762         temporarily to signal the field must not be relied on and updated
2763         by getpid().
2764         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
2765         temporarily negative.
2766         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2768 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
2770         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
2771         (eintr_source): If ARG != NULL, use pthread_kill.
2772         * tst-eintr1.c: Adjust for this change.
2773         * tst-eintr2.c: Likewise.
2774         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
2775         * tst-eintr3.c: New file.
2776         * tst-eintr4.c: New file.
2778 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
2780         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
2781         if CANCELSTATE_BITMASK is set.
2782         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
2783         Likewise.
2785         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
2786         (tests-reverse): Add tst-cancel23.
2787         * tst-cancel22.c: New test.
2788         * tst-cancel23.c: New test.
2790 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
2792         * tst-eintr1.c: Better error messages.
2794         * Makefile (tests): Add tst-eintr2.
2795         * tst-eintr2.c: New file.
2797 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
2799         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
2800         (CFLAGS-tst-cancelx21.c): Set.
2801         * tst-cancel21.c: New test.
2802         * tst-cancelx21.c: New test.
2804         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
2805         comparison operand.
2806         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
2807         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
2808         * pt-longjmp.c: Include jmpbuf-unwind.h.
2809         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
2810         _JMPBUF_UNWINDS.  Adjust compared pointers.
2811         * init.c (__pthread_initialize_minimal_internal): Initialize
2812         pd->stackblock_size.
2813         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
2814         * sysdeps/alpha/jmpbuf-unwind.h: New file.
2815         * sysdeps/i386/jmpbuf-unwind.h: New file.
2816         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
2817         * sysdeps/s390/jmpbuf-unwind.h: New file.
2818         * sysdeps/sh/jmpbuf-unwind.h: New file.
2819         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
2820         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
2821         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
2822         (_JMPBUF_CFA_UNWINDS): Remove.
2823         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
2825 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
2827         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
2828         (CFLAGS-tst-cancelx20.c): Set.
2829         * tst-cancel20.c: New test.
2830         * tst-cancelx20.c: New test.
2832 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
2834         * init.c (__pthread_initialize_minimal_internal): Don't treat
2835         architectures with separate register stack special here when
2836         computing default stack size.
2838 2003-12-17  Roland McGrath  <roland@redhat.com>
2840         * Makefile (tst-cancelx7-ARGS): New variable.
2841         Reportd by Greg Schafer <gschafer@zip.com.au>.
2843 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
2845         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
2846         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
2847         (tst-stack3-ENV): Set.
2848         ($(objpfx)tst-stack3-mem): New.
2849         * tst-stack3.c: New test.
2851 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
2853         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
2854         Add unwind directives.  Drop unused .regstk directive.
2855         (_fini_EPILOG_BEGINS): Add unwind directives.
2857 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
2859         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2860         Assume parameter is a pointer.
2861         (lll_futex_wake): Likewise.
2862         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
2863         Likewise.
2864         (lll_futex_wake): Likewise.
2865         Reported by Boris Hu.
2866         * sysdeps/unix/sysv/linux/unregister-atfork.c
2867         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
2869         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
2871 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
2873         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
2874         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
2875         __rtld_lock_initialize for ld.so lock.
2876         Patch in part by Adam Li <adam.li@intel.com>.
2878 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
2880         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
2881         in $(gnulib).  Also, remove stale comment.
2883 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
2885         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
2886         advantage of new syscall stub and optimize accordingly.
2888         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
2889         from SYS_futex, to match expectations of
2890         sysdep.h:DO_INLINE_SYSCALL.
2891         (lll_futex_clobbers): Remove.
2892         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
2893         (lll_futex_wake): Likewise.
2894         (lll_futex_requeue): Likewise.
2895         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
2896         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
2897         Jelinek).
2898         (__lll_mutex_lock): Likewise.
2899         (__lll_mutex_cond_lock): Likewise.
2900         (__lll_mutex_timed_lock): Likewise.
2901         (__lll_mutex_unlock): Likewise.
2902         (__lll_mutex_unlock_force): Likewise.
2904         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
2905         comes before the include of <sysdep.h>.
2906         (THREAD_SELF_SYSINFO): New macro.
2907         (THREAD_SYSINFO): Likewise.
2908         (INIT_SYSINFO): New macro.
2909         (TLS_INIT_TP): Call INIT_SYSINFO.
2911         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
2913         * sysdeps/pthread/createthread.c (create_thread): Use
2914         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
2915         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
2916         THREAD_SELF_SYSINFO instead of open code.
2917         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
2918         (THREAD_SYSINFO): Likewise.
2920         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
2922         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
2924 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
2926         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
2927         instead of .init.  Patch by David Mosberger.
2929 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
2931         * sysdeps/pthread/configure.in: Remove broken declaration in C
2932         cleanup handling check.
2934 2003-11-30  Andreas Jaeger  <aj@suse.de>
2936         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
2937         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
2938         Likewise.
2940 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
2942         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
2943         * pthread_attr_destroy.c: Include shlib-compat.h.
2944         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
2945         is set in iattr->flags.
2946         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
2948 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
2950         * Makefile (distribute): Add tst-cleanup4aux.c.
2952         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
2953         include.
2955 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
2957         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
2958         pthread_cond_signal.
2960         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
2961         store mutex address if the current value is ~0l.
2962         * sysdeps/pthread/pthread_cond_timedwait.c
2963         (__pthread_cond_timedwait): Likewise.
2964         * sysdeps/pthread/pthread_cond_broadcast.c
2965         (__pthread_cond_broadcast): Don't use requeue for pshared
2966         condvars.
2968         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2969         (__pthread_cond_wait): Don't store mutex address if the current
2970         value is ~0l.
2971         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2972         (__pthread_cond_timedwait): Likewise.
2973         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2974         (__pthread_cond_broadcast): Don't use requeue for pshared
2975         condvars.
2977         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
2978         element with ~0l for pshared condvars, with NULL otherwise.
2980         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2981         (__pthread_cond_wait): Don't store mutex address if the current
2982         value is ~0l.
2983         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2984         (__pthread_cond_timedwait): Likewise.
2985         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2986         (__pthread_cond_broadcast): Don't use requeue for pshared
2987         condvars.
2989         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
2990         * tst-cond12.c: New file.
2991         * tst-cond13.c: New file.
2993 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
2995         * sysdeps/pthread/configure.in: Make missing forced unwind support
2996         fatal.
2998 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
3000         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
3002 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
3004         * Makefile: Add magic to clean up correctly.
3006 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
3008         * unwind.c (FRAME_LEFT): Define.
3009         (unwind_stop): Handle old style cleanups here.
3010         (__pthread_unwind): Handle old style cleanups only if
3011         !HAVE_FORCED_UNWIND.
3012         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
3013         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
3014         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
3015         ($(objpfx)tst-cleanupx4): Likewise.
3016         * tst-cleanup4.c: New test.
3017         * tst-cleanup4aux.c: New.
3018         * tst-cleanupx4.c: New test.
3020 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
3022         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
3023         lll_mutex_*lock macros to skip atomic operations on some archs.
3025 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
3027         * sysdeps/pthread/tst-timer.c (main): Initialize
3028         sigev2.sigev_value as well.
3030 2003-10-15  Roland McGrath  <roland@redhat.com>
3032         * sysdeps/pthread/configure.in: Barf if visibility attribute support
3033         is missing.
3034         * sysdeps/pthread/configure: Regenerated.
3036 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3038         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
3039         locking macros.  No distinction between normal and mutex locking
3040         anymore.
3041         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
3042         Merge bits from lowlevelmutex.S we still need.
3043         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
3044         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
3045         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
3046         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
3047         new mutex implementation.
3048         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
3049         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
3050         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3051         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3052         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
3053         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3054         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3055         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3056         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3057         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
3058         symbol for entry point to avoid cancellation.
3060 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
3062         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
3063         changes.
3064         (SAVE_OLDTYPE_0): Fix a typo.
3066 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
3068         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3069         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
3071 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
3073         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
3074         correct offset.
3076 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
3078         * Makefile (tests): Add tst-cancel19.
3079         * tst-cancel19.c: New test.
3081 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
3083         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
3084         restoring of the old cancellation type.
3086 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
3088         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
3090 2003-09-27  Wolfram Gloger  <wg@malloc.de>
3092         * sysdeps/pthread/malloc-machine.h: New file
3094 2003-09-24  Roland McGrath  <roland@redhat.com>
3096         * allocatestack.c (__make_stacks_executable): Don't ignore return
3097         value from _dl_make_stack_executable.
3099 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
3101         * allocatestack.c (__make_stacks_executable): Also change
3102         permission of the currently unused stacks.
3104         * allocatestack.c (change_stack_perm): Split out from
3105         __make_stacks_executable.
3106         (allocate_stack): If the required permission changed between the time
3107         we started preparing the stack and queueing it, change the permission.
3108         (__make_stacks_executable): Call change_stack_perm.
3110         * Makefile: Build tst-execstack-mod locally.
3111         * tst-execstack-mod.c: New file.
3113 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
3115         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
3117 2003-09-23  Roland McGrath  <roland@redhat.com>
3119         * tst-execstack.c: New file.
3120         * Makefile (tests): Add it.
3121         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
3122         (LDFLAGS-tst-execstack): New variable.
3124         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
3125         whether to use PROT_EXEC for stack mmap.
3126         (__make_stacks_executable): New function.
3127         * pthreadP.h: Declare it.
3128         * init.c (__pthread_initialize_minimal_internal): Set
3129         GL(dl_make_stack_executable_hook) to that.
3131 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
3133         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
3134         recommendation from AMD re avoidance of lock prefix.
3136 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
3138         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
3139         lll_futex_timed_wait instead of lll_futex_wait.
3140         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
3141         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
3142         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
3143         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
3144         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
3145         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
3146         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
3147         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
3148         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
3149         Completely revamp the locking macros.  No distinction between
3150         normal and mutex locking anymore.
3151         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3152         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
3153         __lll_lock_timedwait): Fix prototypes.
3154         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
3155         __lll_lock_timedwait): Likewise.
3156         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
3157         macros, add __builtin_expect.
3158         (lll_mutex_timedlock): Likewise.  Fix return value.
3159         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
3160         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
3161         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
3162         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
3163         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
3164         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
3165         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
3166         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
3168 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
3170         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3171         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
3172         operation if possible.
3174         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
3175         like jumping over the lock prefix.
3177 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
3179         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
3180         locking macros.  No distinction between normal and mutex locking
3181         anymore.
3182         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3183         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3184         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3185         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
3186         locking.  Merge bits from lowlevelmutex.S we still need.
3187         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3188         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
3189         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
3190         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
3191         * Makefile (routines): Remove libc-lowlevelmutex.
3192         (libpthread-rountines): Remove lowlevelmutex.
3193         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
3194         for new mutex implementation.
3195         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3196         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3197         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3198         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3199         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3200         Likewise.
3201         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3202         Likewise.
3203         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
3204         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3205         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
3206         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3207         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3208         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3209         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3210         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3211         Likewise.
3212         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3213         Likewise.
3214         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
3215         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3216         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3217         Don't use requeue.
3218         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3219         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
3221 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
3223         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
3224         in parameters of asm with output parameters.
3226         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
3227         type of DECR parameter to int.
3228         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
3230 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
3232         * tst-attr3.c (tf, do_test): Print stack start/end/size and
3233         guardsize for each thread.
3235 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
3237         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
3238         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
3239         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
3241         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
3242         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
3243         NULL.
3244         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
3245         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
3246         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
3247         (pthread_getaffinity_np): Add hidden_def.
3249         * Makefile (tests): Add tst-attr3.
3250         * tst-attr3.c: New test.
3252         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
3254 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
3256         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
3257         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
3259 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
3261         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
3262         * tst-align.c: Include tst-stack-align.h.
3263         (tf, do_test): Use TEST_STACK_ALIGN macro.
3265 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
3267         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
3268         variable.
3270 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
3272         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
3273         stack-related values for the initial thread.
3275 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
3277         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
3279 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
3281         * pthread_mutex_lock.c: Minor code rearrangements.
3283 2003-09-05  Roland McGrath  <roland@redhat.com>
3285         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
3286         Instead, include ../nptl_db/db_info.c to do its magic.
3287         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
3288         (__pthread_pthread_key_2ndlevel_size): Likewise.
3289         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
3290         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
3291         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
3292         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
3293         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
3294         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
3295         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
3296         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
3297         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
3298         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
3299         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
3300         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
3301         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
3302         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
3303         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
3304         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
3305         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
3307 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
3309         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
3310         of pthread_t to be compatible with LT.
3311         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3312         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3313         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3314         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3315         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3316         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3317         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3319 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
3321         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
3323 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
3325         * unwind-forcedunwind.c: Move to...
3326         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
3327         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
3328         * sysdeps/pthread/jmpbuf-unwind.h: New file.
3329         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
3330         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
3331         * unwind.c: Include jmpbuf-unwind.h.
3332         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
3334 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
3336         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
3337         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
3338         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
3339         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
3340         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
3341         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
3342         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
3343         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
3344         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
3345         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
3346         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
3347         function.
3348         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
3349         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
3350         * Makefile (tests): Add tst-stack2.
3351         * tst-stack2.c: New test.
3352         * tst-stack1.c: Include limits.h and sys/param.h.
3353         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
3355         * pthread_condattr_setpshared.c: Include errno.h.
3356         (pthread_condattr_setpshared): Return EINVAL if pshared
3357         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
3359         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
3360         defined symbol for entry point to avoid cancellation.
3361         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3362         Likewise.
3363         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3364         Likewise.
3365         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3366         Likewise.
3367         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
3368         Likewise.
3369         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3370         Likewise.
3371         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
3372         __close_nocancel, __read_nocancel, __write_nocancel,
3373         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
3374         libpthread.so or librt.so, define to corresponding function
3375         without _nocancel suffix.
3376         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
3377         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
3378         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
3380         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
3382 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
3384         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
3385         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
3387         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
3388         in subsections has a symbol associated with it.
3390         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
3391         defined symbol for entry point to avoid cancellation.
3392         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
3394 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3396         * Makefile (tests): Add tst-tls5.
3397         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
3398         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
3399         ($(objpfx)tst-tls5): New.
3400         ($(objpfx)tst-tls6.out): Likewise.
3401         (tests): Depend on $(objpfx)tst-tls6.out.
3402         * tst-tls3.c: Include stdint.h and pthreaddef.h.
3403         (do_test): Check pthread_self () return value alignment.
3404         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
3405         (tf): Check pthread_self () return value alignment.
3406         * tst-tls5.c: New test.
3407         * tst-tls5.h: New.
3408         * tst-tls5mod.c: New.
3409         * tst-tls5moda.c: New.
3410         * tst-tls5modb.c: New.
3411         * tst-tls5modc.c: New.
3412         * tst-tls5modd.c: New.
3413         * tst-tls5mode.c: New.
3414         * tst-tls5modf.c: New.
3415         * tst-tls6.sh: New test.
3417         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
3418         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
3419         * init.c (pthread_functions): Initialize them.
3420         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
3421         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
3422         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
3423         pthread_cond_timedwait@@GLIBC_2.3.2.
3425 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3427         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
3428         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
3429         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
3430         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
3431         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
3432         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
3434         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
3436         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
3437         _POSIX_THREAD_PRIORITY_SCHEDULING.
3438         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3440 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
3442         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
3443         nested function, use static inline function from libio.h.
3444         Code by Richard Henderson.
3446         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
3447         weak.
3449 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
3451         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
3452         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
3453         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
3454         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
3455         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
3456         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
3457         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
3458         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
3459         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
3460         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
3461         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
3462         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
3463         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
3464         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
3465         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
3466         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
3467         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
3468         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
3469         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
3470         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
3471         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
3472         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
3473         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
3474         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
3475         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
3476         * sysdeps/sparc/tls.h: New file.
3477         * sysdeps/sparc/tcb-offsets.sym: New file.
3478         * sysdeps/sparc/Makefile: New file.
3479         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
3480         * init.c [__sparc__] (__NR_set_tid_address): Define.
3482 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
3484         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
3485         _IO_release_lock): Define.
3487 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
3489         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
3490         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
3492 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
3494         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
3495         (__pthread_cleanup_class): Add missing return types of member
3496         functions.
3498 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
3500         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3501         (lll_mutex_unlock_force): Add memory barrier between store and futex
3502         syscall.
3504 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
3506         * tst-cancel4.c (do_test): Also unlink tempfname and remove
3507         tempmsg in first loop.
3509 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
3511         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3512         _POSIX_THREAD_PRIORITY_SCHEDULING.
3513         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3515 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3517         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
3518         (__rtld_lock_default_lock_recursive,
3519         __rtld_lock_default_unlock_recursive): Define.
3520         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
3521         __rtld_lock_unlock_recursive): Define using
3522         GL(_dl_rtld_*lock_recursive).
3523         * init.c (__pthread_initialize_minimal_internal): Initialize
3524         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
3525         Lock GL(_dl_load_lock) the same number of times as
3526         GL(_dl_load_lock) using non-mt implementation was nested.
3528         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
3529         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
3531 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
3533         * tst-cancel17.c (do_test): Make len2 maximum of page size and
3534         PIPE_BUF.
3536 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3538         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
3540 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
3542         * sysdeps/pthread/createthread.c (do_clone): Move error handling
3543         to first syscall error check.  Move syscall error check for tkill
3544         into __ASSUME_CLONE_STOPPED #ifdef.
3546 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
3548         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
3549         is not defined, do explicit synchronization.
3550         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
3551         is not defined also unlock pd->lock for non-debugging case in case
3552         it is necessary.
3553         * pthread_create.c (start_thread): Always get and release pd->lock
3554         if __ASSUME_CLONE_STOPPED is not defined.
3555         (start_thread_debug): Removed.  Adjust users.
3556         * allocatestack.c (allocate_stack): Always initialize lock if
3557         __ASSUME_CLONE_STOPPED is not defined.
3558         * Makefile (tests): Add tst-sched1.
3559         * tst-sched1.c: New file.
3561         * sysdeps/pthread/createthread.c (do_clone): Only use
3562         sched_setschduler and pass correct parameters.
3564 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3566         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
3567         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
3568         PTHREAD_STACK_MIN in comments.
3570 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3572         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3573         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
3574         argument.
3575         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
3576         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
3577         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
3578         (__pthread_cleanup_upto): Fix prototype.
3579         (_longjmp_unwind): Adjust caller.
3580         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
3581         Change second argument to const struct pointer.
3582         * tst-sem8.c (main): Remove unused s2 and s3 variables.
3583         * tst-sem9.c (main): Likewise.
3584         * unwind.c: Include string.h for strlen prototype.
3586 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
3588         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3589         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
3590         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
3591         Define HAVE_CMOV.
3592         Patch by Nicholas Miell <nmiell@attbi.com>.
3594 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
3596         * init.c (__pthread_initialize_minimal_internal): Initialize
3597         GL(dl_init_static_tls).
3598         * pthreadP.h (__pthread_init_static_tls): New prototype.
3599         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
3600         New functions.
3601         * Makefile (tests): Add tst-tls4.
3602         (modules-names): Add tst-tls4moda and tst-tls4modb.
3603         ($(objpfx)tst-tls4): Link against libdl and libpthread.
3604         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
3605         tst-tls4modb.so.
3606         * tst-tls4.c: New file.
3607         * tst-tls4moda.c: New file.
3608         * tst-tls4modb.c: New file.
3610 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
3612         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
3613         before __timer_dealloc.
3614         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
3615         Don't call list_unlink.
3617 2003-07-29  Roland McGrath  <roland@redhat.com>
3619         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
3621 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
3623         * tst-cancel17.c (do_test): Check if aio_cancel failed.
3624         Don't reuse struct aiocb A if it failed.
3625         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
3626         not just one byte, as that does not block.
3628 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
3630         * sysdeps/pthread/unwind-resume.c: New file.
3631         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
3632         unwind-resume in csu subdir.
3633         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
3634         exceptions.
3635         (librt-sysdep_routines, librt-shared-only-routines): Add
3636         rt-unwind-resume.
3637         * sysdeps/pthread/rt-unwind-resume.c: New file.
3638         * unwind-forcedunwind.c: New file.
3639         * Makefile (libpthread-routines): Add unwind-forcedunwind.
3640         (libpthread-shared-only-routines): Likewise.
3641         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
3642         * pthreadP.h (pthread_cancel_init): New prototype.
3643         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
3645         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
3646         attr argument const struct pthread_attr *.
3648         * res.c (__res_state): Return __resp.
3649         * descr.h: Include resolv.h.
3650         (struct pthread): Add res field.
3651         * pthread_create.c: Include resolv.h.
3652         (start_thread): Initialize __resp.
3653         * Makefile (tests): Add tst-_res1.
3654         (module-names): Add tst-_res1mod1, tst-_res1mod2.
3655         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
3656         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
3657         libpthread.
3658         * tst-_res1.c: New file.
3659         * tst-_res1mod1.c: New file.
3660         * tst-_res1mod2.c: New file.
3662 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
3664         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
3666         * Makefile: Define various *-no-z-defs variables for test DSOs
3667         which has undefined symbols.
3669 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
3671         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3672         Retry if the stwcx fails to store once_control.
3674 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
3676         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
3677         pthread_attr_setaffinity.
3678         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
3679         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
3680         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
3681         * pthread_attr_destroy.c: Free cpuset element if allocated.
3682         * pthread_create.c: Pass iattr as additional parameter to
3683         create_thread.
3684         * sysdeps/pthread/createthread.c: If attribute is provided and
3685         a new thread is created with affinity set or scheduling parameters,
3686         start thread with CLONE_STOPPED.
3687         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
3688         pthread_attr_setaffinity.
3689         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
3690         cpuset element.
3692 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
3694         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
3696 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
3698         * sysdeps/pthread/configure.in: Require CFI directives also for
3699         ppc and s390.
3701 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
3703         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3704         Add cfi directives.
3706 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3708         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
3709         CLEANUP_JMP_BUF.
3710         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
3711         registers as variables.  Call __pthread_mutex_unlock_usercnt.
3712         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3713         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
3714         not self pointer in __writer.  Compare with TID to determine
3715         deadlocks.
3716         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3717         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
3718         Likewise.
3719         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
3720         Likewise.
3721         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
3722         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
3723         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
3724         macros also when compiling librt.
3726 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
3728         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
3729         -fasynchronous-unwind-tables.
3730         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3731         (PSEUDO): Add cfi directives.
3732         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
3733         Likewise.
3734         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3735         Likewise.
3737 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
3739         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
3740         __pthread_unregister_cancel): Add prototypes and hidden_proto.
3741         * unwind.c (__pthread_unwind_next): Add hidden_def.
3742         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
3743         Likewise.
3744         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3745         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
3746         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3747         Likewise.
3748         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
3749         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
3750         Likewise.
3751         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
3752         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
3753         __pthread_unregister_cancel and __pthread_unwind_next.
3755 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
3757         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
3758         different symbol for the cancellation syscall wrapper and
3759         non-cancellation syscall wrapper.
3760         (PSEUDO_END): Define.
3762 2003-07-05  Richard Henderson  <rth@redhat.com>
3764         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
3765         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
3766         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3767         return actual return value from the syscall, not 0.
3769 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
3771         * descr.h (struct pthread): Add pid field.
3772         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
3773         (__reclaim_stacks): Likewise.
3774         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
3775         also check for PID of the signal source.
3776         (__pthread_initialize_minimal_internal): Also initialize pid field
3777         of initial thread's descriptor.
3778         * pthread_cancel.c: Use tgkill instead of tkill if possible.
3779         * sysdeps/unix/sysv/linux/fork.c: Likewise.
3780         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
3781         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
3782         * sysdeps/unix/sysv/linux/raise.c: Likewise.
3784 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
3786         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
3787         Fix use of parameter.
3788         (__libc_cleanup_pop): Likewise.
3790 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
3792         * init.c (sigcancel_handler): Change parameters to match handler
3793         for SA_SIGACTION.  Check signal number and code to recognize
3794         invalid invocations.
3796 2003-07-03  Roland McGrath  <roland@redhat.com>
3798         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
3799         Apply sizeof (struct pthread) bias to r13 value.
3801 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
3803         * sysdeps/pthread/configure.in: Require CFI directives.
3805         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
3806         definition.
3807         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
3808         libpthread compilation.
3809         * unwind.c (__pthread_unwind): Add hidden_def.
3810         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
3812 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3814         * libc-cancellation.c (__libc_cleanup_routine): Define.
3815         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
3816         (__pthread_cleanup_pop): Define.
3818 2003-07-01  Richard Henderson  <rth@redhat.com>
3820         * sysdeps/alpha/elf/pt-initfini.c: New file.
3821         * sysdeps/alpha/pthread_spin_lock.S: New file.
3822         * sysdeps/alpha/pthread_spin_trylock.S: New file.
3823         * sysdeps/alpha/pthreaddef.h: New file.
3824         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
3825         * sysdeps/alpha/tls.h: New file.
3826         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
3827         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
3828         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
3829         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
3830         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
3831         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
3832         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
3833         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
3834         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
3835         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
3837 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3839         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
3840         cleanup support and unwind info.
3842 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
3844         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3845         Use correct cleanup handler registration.  Add unwind info.
3846         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
3847         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
3848         * tst-once3.c: Add cleanup handler and check it is called.
3849         * tst-once4.c: Likewise.
3850         * tst-oncex3.c: New file.
3851         * tst-oncex4.c: New file.
3852         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
3854 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
3856         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
3858 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
3860         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
3861         (tf_msgsnd): Likewise.
3863         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
3864         premature returns a bit more.
3866 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
3868         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
3869         definition to the front.
3871         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
3872         the cleanup functions to make the names unique.  Fix dwarf opcode
3873         un unwind table.
3874         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
3875         functions to make the names unique.  Fix CFA offset for two blocks.
3877 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
3879         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
3880         missing closing braces.
3881         Patch by Christophe Saout <christophe@saout.de>.
3883 2003-06-24  Roland McGrath  <roland@redhat.com>
3885         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
3887 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
3889         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
3890         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
3892         * pthreadP.h: Declare __find_thread_by_id.
3893         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
3894         * pthread_clock_gettime.c: Allow using other thread's clock.
3895         * pthread_clock_settime.c: Likewise.
3896         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
3897         * Makefile: Add rules to build and run tst-clock2.
3898         * tst-clock2.c: New file.
3900 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
3902         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
3903         to use exception-based cleanup handler.
3904         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3906         * tst-cond8.c (ch): Announce that we are done.
3908         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
3910         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
3911         Also test aio_suspend with timeout value.
3913 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
3915         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
3916         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
3917         attribute_hidden.
3919         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
3920         (__pthread_mutex_lock_internal): Likewise.
3921         (__pthread_mutex_unlock_internal): Likewise.
3922         (__pthread_mutex_unlock_usercnt): Declare.
3923         * pthread_mutex_destroy.c: Always fail if used in any way.
3924         * pthread_mutex_init.c: Update comment.
3925         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
3926         * pthread_mutex_timedlock.c: Adjust __nusers.
3927         * pthread_mutex_trylock.c: Adjust __nusers.
3928         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
3929         and public interfaces are wrapper with pass additional parameter.
3930         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
3931         parameter zero.
3932         * tst-mutex8.c: New file.
3933         * Makefile (tests): Add tst-mutex8.
3934         * sysdeps/pthread/pthread_cond_timedwait.c: Call
3935         __pthread_mutex_unlock_usercnt.
3936         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3937         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3938         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3939         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3940         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3941         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
3942         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3943         Add __nusers.
3944         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3945         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3946         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3947         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3948         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3950         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
3951         * pthread_mutex_timedlock.c: Likewise.
3952         * pthread_mutex_trylock.c: Adjust __nusers.
3953         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
3954         * tst-mutex9.c: New file.
3955         * Makefile (tests): Add tst-mutex9.
3956         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
3957         * sysdeps/ia64/tls.h: Likewise.
3958         * sysdeps/powerpc/tls.h: Likewise.
3959         * sysdeps/s390/tls.h: Likewise.
3960         * sysdeps/sh/tls.h: Likewise.
3961         * sysdeps/x86_64/tls.h: Likewise.
3962         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3963         Change type of __owner.
3964         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3965         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3966         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3967         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3968         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3970 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
3972         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
3973         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
3975         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
3976         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
3977         instead of nr to lll_futex_wake.  Only set errno and return -1
3978         if err < 0.
3980         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
3981         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3982         return actual return value from the syscall, not 0.
3984 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
3986         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
3987         find a random value.
3988         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
3989         errno==EIDRM.
3991         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
3992         compat_timer_settime.
3993         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
3994         compat_timer_gettime.
3995         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
3996         compat_timer_getoverrun.
3997         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
3998         compat_timer_delete.
4000         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
4001         error-checking mutex detect busy mutexes.
4003 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
4005         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
4006         Add ax to clobber list.
4007         (lll_mutex_cond_lock): Likewise.
4008         (lll_mutex_unlock): Likewise.
4009         (lll_lock): Likewise.
4010         (lll_unlock): Likewise.
4012         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
4013         * tst-cancel18.c: New file.
4014         * tst-cancelx18.c: New file.
4016         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
4017         and tcdrain.
4019         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
4020         * tst-cancel17.c: New file.
4021         * tst-cancelx17.c: New file.
4023         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
4024         * sysdeps/unix/sysv/linux/sigwait.c: New file.
4025         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
4027         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
4029 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
4031         * sysdeps/pthread/createthread.c (create_thread): Set
4032         header.multiple_threads unconditionally.
4033         * allocatestack.c (allocate_stack): Likewise.
4034         * descr.h (struct pthread): Add header.multiple_threads
4035         unconditionally.
4036         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
4037         Define for librt.  #error if neither libpthread, libc nor librt.
4038         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
4039         Likewise.
4040         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
4041         CDISABLE): Likewise.
4042         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
4043         CDISABLE): Likewise.
4044         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
4045         CDISABLE): Likewise.
4046         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
4047         CDISABLE): Likewise.  Access header.multiple_threads outside of
4048         libc and libpthread.
4049         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
4050         Likewise.
4051         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
4052         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
4054 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
4056         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
4057         Also test early cancellation before the thread reaches the cancellation
4058         point.
4060         * Makefile: Compile forward.c with exceptions.
4062         * sysdeps/unix/sysv/linux/sleep.c: New file.
4064 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
4066         * Makefile: Add CFLAGS definition to compile function wrappers
4067         duplicated from libc with exceptions.
4068         * tst-cancel4.c: Also check cancellation handlers.
4070         * Makefile: Add rules to build and run tst-cancel16 and
4071         tst-cancelx16.  Add missing CFLAGS definitions.
4072         * tst-cancel16.c: New file.
4073         * tst-cancelx16.c: New file.
4075 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
4077         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4078         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
4079         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
4080         (DL_SYSINFO_IMPLEMENTATION): Likewise.
4082         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
4083         (LIBC_CANCEL_RESET): Likewise.
4084         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
4085         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
4086         librt-cancellation.
4087         (CFLAGS-libcrt-cancellation.c): Define.
4088         * sysdeps/pthread/librt-cancellation.c: New file.
4089         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
4090         macros also when compiling librt.
4091         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4092         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4093         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4094         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4095         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4096         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4097         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4099         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
4100         compat_timer_create.
4102 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
4104         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
4106         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
4107         __register_atfork.
4108         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
4109         Add libc_hidden_def.
4111 2003-06-13  Roland McGrath  <roland@redhat.com>
4113         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
4114         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
4116 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
4118         * allocatestack.c (queue_stack): Always inline.
4119         * ptreadhP.h (__do_cancel): Likewise.
4121 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
4123         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
4124         a typo.
4126 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
4128         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4129         (__pthread_cond_signal): Remove incorrect second addition for
4130         cond_lock!=0.
4132 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
4134         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4135         (__pthread_cond_signal): Use correct futex pointer in
4136         __lll_mutex_lock_wait call.
4138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4139         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
4141 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
4143         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
4144         cancelable.
4145         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
4146         Likewise.
4148         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
4149         hand-written CFI generation code.  Since ENTRY/END also initiated
4150         CFI frames this caused two CFI sets to be generated.
4152 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
4154         * cleanup_routine.c: New file.
4155         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
4156         * sysdeps/pthread/pthread.h: Add support for fully exception-based
4157         cleanup handling.
4158         * Makefile (libpthread-routines): Add cleanup_routine.
4159         Add more CFLAGS variables to compile with exceptions.  Add comments
4160         why which file needs unwind tables.
4161         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
4162         tests.
4163         * tst-cancelx1.c: New file.
4164         * tst-cancelx2.c: New file.
4165         * tst-cancelx3.c: New file.
4166         * tst-cancelx4.c: New file.
4167         * tst-cancelx5.c: New file.
4168         * tst-cancelx6.c: New file.
4169         * tst-cancelx7.c: New file.
4170         * tst-cancelx8.c: New file.
4171         * tst-cancelx9.c: New file.
4172         * tst-cancelx10.c: New file.
4173         * tst-cancelx11.c: New file.
4174         * tst-cancelx12.c: New file.
4175         * tst-cancelx13.c: New file.
4176         * tst-cancelx14.c: New file.
4177         * tst-cancelx15.c: New file.
4178         * tst-cleanupx0.c: New file.
4179         * tst-cleanupx0.expect: New file.
4180         * tst-cleanupx1.c: New file.
4181         * tst-cleanupx2.c: New file.
4182         * tst-cleanupx3.c: New file.
4184         * tst-cleanup0.c: Make standard compliant.
4185         * tst-cleanup1.c: Likewise.
4187         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
4188         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
4189         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4190         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
4191         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4192         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4193         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
4194         CLEANUP_JMP_BUF.
4195         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4196         * tst-cancel12.c: New file.
4197         * tst-cancel13.c: New file.
4198         * tst-cancel14.c: New file.
4199         * tst-cancel15.c: New file.
4200         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
4201         and tst-cancel15.
4203         * tst-cancel1.c: Add some comments.
4205         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
4206         timeout correctly.
4208 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
4210         * Makefile (CFLAGS-pthread_cancel.c): Define.
4212 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
4214         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
4215         Change type of __writer element to int.
4216         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4217         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4218         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4219         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4220         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4221         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
4222         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4223         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
4224         Compare with TID to determine deadlocks.
4225         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
4226         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4227         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
4228         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4229         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4230         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4231         Likewise.
4232         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4233         Likewise.
4234         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4235         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4236         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4237         Likewise.
4238         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4239         Likewise.
4240         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4241         * Makefile (tests): Add tst-rwlock12.
4242         * tst-rwlock12.c: New file.
4244 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
4246         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
4247         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
4248         Remove bogus hidden_proto.
4249         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
4250         Likewise.
4251         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
4252         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
4253         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
4254         ___lll_mutex_timedlock): Likewise.
4256 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
4258         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4259         (__pthread_cond_signal): Add some code to eventually handle
4260         cond_lock!=0.
4262 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
4264         * Makefile (tests): Add tst-exec4.
4265         (tst-exec4-ARGS): Define.
4266         * tst-exec4.c: New file.
4268 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
4270         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
4271         Also fail if tv_nsec < 0.
4272         (__lll_timedwait_tid): Likewise.
4273         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
4274         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
4275         Likewise.
4276         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
4277         Likewise.
4278         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
4279         Likewise.
4280         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
4281         Likewise.
4282         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
4283         Likewise.
4284         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
4285         Likewise.
4287         * Makefile (tests): Add tst-sem8 and tst-sem9.
4288         * tst-sem8.c: New file.
4289         * tst-sem9.c: New file.
4290         * sem_open.c: Fix creation of in_use record if the file exists but
4291         no internal record.
4293         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
4294         definitions.
4296         * sysdeps/pthread/timer_create.c (timer_create): In case
4297         evp==NULL, assign timer ID to sival_ptr.
4299         * descr.h (struct pthread_unwind_buf): Change type of prev element to
4300         struct pthread_unwind_buf *.
4301         (struct pthread): Likewise for cleanup_jmp_buf element.
4303         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
4304         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
4305         * unwind.c (__pthread_unwind_next): Likewise.
4307 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
4309         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4310         (lll_futex_timed_wait): Use int for futex value parameter.
4311         (lll_futex_wake): Likewise.
4312         (lll_futex_requeue): Likewise.
4314         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
4315         Replace one memory operation with one register operation.
4317         * tst-join4.c (do_test): Fix error message.
4319         * tst-rwlock6.c (do_test): Use correct format specifier.
4321         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4322         (__lll_mutex_lock_wait): Replace one memory operation with one
4323         register operation.
4324         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
4325         (__lll_mutex_lock_wait): Likewise.
4327         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4328         (__lll_mutex_cond_lock): Add one to value parameter of
4329         __lll_lock_wait to reflect reality in the futex syscall.
4330         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4331         (lll_mutex_cond_lock): Likewise.
4333 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
4335         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
4336         New function.
4337         (lll_mutex_cond_lock): Define.
4339 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
4341         * Makefile (tests): Add tst-signal6.
4342         * tst-signal6.c: New file.
4344         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
4345         (__lll_mutex_unlock_force): New function
4346         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
4348         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4349         (__lll_mutex_unlock_force): New function.
4350         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
4352         * tst-rwlock7.c (do_test): Use correct format specifier.
4354         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
4355         Find break parameter in correct asm argument.
4357 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
4359         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
4360         Remove out4.
4361         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
4362         error occured.
4363         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4364         Add __mutex.
4365         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
4366         lll_futex_requeue, lll_mutex_unlock_force): Define.
4368 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
4370         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4371         (pthread_cond_t): Add __mutex.
4372         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
4373         lll_futex_requeue, lll_mutex_unlock_force): Define.
4375 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4377         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
4378         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4379         Add __mutex field.
4380         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
4381         Define.
4382         (lll_futex_wait, lll_futex_wake): Define.
4383         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
4384         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
4385         FUTEX_REQUEUE instead of FUTEX_WAIT.
4386         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
4387         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
4388         mutex which was used in condvar structure.  Call
4389         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
4390         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
4392         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
4393         include tcb-offsets.h.  Read wakeup value in locked region.
4394         Use the value of gbr register as THREAD_ID.
4395         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4396         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4397         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4399         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
4400         macros.
4402 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
4404         * sysdeps/pthread/pthread_cond_broadcast.c
4405         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
4407 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
4409         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
4410         typo in register name.
4411         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
4412         correctly.  Actually use requeue.  Little optimization.
4413         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
4414         mutex address early.  Handle cancellation state as 32-bit value.
4415         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4416         Remove unnecessary label.
4418 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
4420         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
4421         instead of FUTEX_WAIT.
4422         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
4423         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4424         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4425         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4426         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4427         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
4428         used in condvar structure.  Call __pthread_mutex_cond_lock instead
4429         of __pthread_mutex_lock_internal.
4430         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4431         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4432         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4433         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
4434         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4435         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4436         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
4437         Add pthread_mutex_cond_lock.
4438         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
4439         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
4440         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
4441         lll_mutex_cond_lock.
4442         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
4443         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4444         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4445         Add __mutex field.
4446         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4447         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4449         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
4450         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4452         * pthreadP.h: Declare __pthread_mutex_cond_lock.
4453         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
4454         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
4455         macro don't define aliases.
4457         * cancellation.c: Remove __pthread_enable_asynccancel_2.
4458         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
4459         * sysdeps/pthread/pthread_cond_timedwait.c: Use
4460         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
4461         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4462         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4463         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4464         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4465         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4467 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
4469         * sem_open.c: Fix one endless loop.  Implement correct semantics
4470         wrt opening the same semaphore more then once.
4471         * sem_close.c: Adjust for sem_open change.
4472         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
4473         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
4474         * Makefile (tests): Add tst-sem7.
4475         * tst-sem7.c: New file.
4477 2003-05-16  Roland McGrath  <roland@redhat.com>
4479         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
4480         uninitialized variable braino.
4482 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
4484         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
4485         test for syscall availability.
4487         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
4488         __no_posix_timers to -1 if the syscalls don't exist.
4490         * pthread_join.c (pthread_join): Set tid field of the joined
4491         thread to -1.  This isn't necessary but helps to recognize some
4492         error conditions with almost no cost.
4494         * allocatestack.c (FREE_P): Also negative values indicate an
4495         unused stack.
4497         * unwind.c: Include <unistd.h>.
4499 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
4501         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
4503 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
4505         * Makefile (crti-objs, crtn-objs): New variables.
4506         (omit-deps, extra-objs): Add crtn.
4507         ($(objpfx)libpthread.so): Depend on both crti and crtn
4508         and links to them in multidir.
4509         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
4511 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
4513         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4514         (lll_mutex_unlock): Use atomic_exchange_rel.
4516 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
4518         * cond-perf.c (cons): Add missing locking around setting of alldone.
4520 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
4522         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
4523         related macros.
4524         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4526 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
4528         * tst-sem6.c: New file.
4529         * Makefile (tests): Add tst-sem6.
4531         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
4532         Use atomic_exchange_rel instead of atomic_exchange.
4533         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
4534         Likewise.
4536         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
4537         code for lll_futex_wait and lll_futex_wake in static apps.  Use
4538         vsyscall is possible.
4540         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
4541         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
4542         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
4543         pthread_setaffinity_np.
4544         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
4545         and pthread_setaffinity_np.
4546         * Makefile (libpthread-routines): Add pthread_getaffinity and
4547         pthread_setaffinity.
4549         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
4550         use it in case mmap to allocate the stack fails.
4551         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
4552         ARCH_MAP_FLAGS here.
4553         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
4554         ARCH_RETRY_MMAP.
4556 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
4558         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
4559         handler implementation.  It is now lockless in fork().
4560         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
4561         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
4562         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
4563         declare the __fork_*_lists.
4564         (struct fork_handler): Include pointers to all three functions.
4565         Add next, refcntr and need_signal elements.
4566         (__fork_handlers): New declaration.
4567         (__register_atfork_malloc): Remove declaration.
4568         (HAVE_register_atfork_malloc): Remove definition.
4569         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
4570         __pthread_child_handler variable.
4571         (__libc_pthread_init): Use __register_atfork instead of explicitly
4572         adding to the list.
4573         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
4574         and lll_futex_wake.
4575         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4577         * unwind.c (unwind_cleanup): Print error message and then abort.  This
4578         function must never be reached.
4580         * cond-perf.c: New file.
4582 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
4584         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
4586 2003-05-04  Roland McGrath  <roland@redhat.com>
4588         * Makefile ($(objpfx)../libc.so): New target.
4590 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
4592         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4593         (pthread_condattr_t): Size is only an int, don't use long for
4594         alignment.
4595         (pthread_mutexattr_t): Likewise.
4596         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4597         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4598         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4600 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
4602         * sysdeps/i386/tls.h: Define THREAD_ID.
4603         * sysdeps/ia64/tls.h: Likewise.
4604         * sysdeps/powerpc/tls.h: Likewise.
4605         * sysdeps/s390/tls.h: Likewise.
4606         * sysdeps/sh/tls.h: Likewise.
4607         * sysdeps/x86_64/tls.h: Likewise.
4608         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
4609         record ownership.
4610         * pthread_mutex_timedlock.c: Likewise.
4611         * pthread_mutex_trylock.c: Likewise.
4612         * pthread_mutex_unlock.c: Likewise.
4613         * pthread_rwlock_trywrlock.c: Likewise.
4614         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
4615         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4616         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4617         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4619         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
4620         flag.
4622 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
4624         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4625         (__SIZEOF_PTHREAD_COND_T): Define to 48.
4626         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
4627         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4628         Make __align long long instead of long.
4629         (pthread_rwlock_t): Formatting.
4630         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
4631         (pthread_rwlock_t): Formatting.
4632         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4633         (pthread_cond_t): Make __align long long instead of long.
4634         (pthread_rwlock_t): Move __flags field to the same position as in
4635         linuxthreads.
4637 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
4639         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
4640         * tst-rwlock7.c (do_test): Likewise.
4642 2003-04-26  Roland McGrath  <roland@redhat.com>
4644         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
4646 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
4648         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
4649         sizeof (struct pthread).
4650         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
4651         1 struct pthread.
4652         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
4653         to 0.
4654         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
4655         struct pthread.
4656         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
4657         to 32-bit bytes.
4658         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
4659         tcbp.
4660         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
4661         unneccessarily.
4662         (NO_TLS_OFFSET): Define.
4663         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
4664         add TLS_TCB_SIZE unnecessarily.
4666 2003-04-22  Roland McGrath  <roland@redhat.com>
4668         * Makeconfig (shared-thread-library): Reverse link order to work
4669         around linker bug.
4671 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
4673         * semaphore.h: Fix typo in comment.
4675 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
4677         * sysdeps/pthread/sigfillset.c: New file.
4679         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
4680         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
4681         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
4682         * sysdeps/pthread/sigaction.c: Likewise.
4683         * sysdeps/pthread/sigprocmask.c: New file.
4684         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
4685         __SIGRTMIN+1.
4686         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4687         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
4688         in this case.
4690 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
4692         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4693         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
4695         * sysdeps/unix/sysv/linux/unregister-atfork.c
4696         (__unregister_atfork): Don't free memory not allocated dynamically.
4698         * semaphore.h: Remove __THROW marker from cancellation points.
4699         * nptl/sysdeps/pthread/pthread.h: Likewise.
4701 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
4703         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
4704         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
4705         __THROW.
4707 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
4709         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
4711 2003-04-15  Roland McGrath  <roland@redhat.com>
4713         * forward.c (__pthread_unwind): Tweak to avoid warning.
4715 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
4717         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
4719 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
4721         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
4722         overflow CFA advance instructions.
4723         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4725 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
4727         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
4728         * sysdeps/i386/pthread_spin_lock.c: Likewise.
4729         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
4730         defined.
4732         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
4733         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
4734         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
4735         DW_CFA_advance_loc for .Laddl-.Lsubl.
4737 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
4739         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
4740         position-independent unwind data for static libraries.
4741         Add missing unwind info.  Add comments.
4743         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
4744         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4745         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4746         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4748 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
4750         * Makefile: Make sure all cancellation points are compiled with
4751         exception and asynchronous unwind tables.
4753         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
4754         which mishandles loading of global object addresses in PIC.
4755         (THREAD_SETMEM_NC): Likewise.
4757 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4759         * pthread.h: Define new data structure for cleanup buffer.  Declare
4760         new cleanup handler interfaces.
4761         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
4762         (struct pthread): Add cleanup_jmp_buf pointer.  Define
4763         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
4764         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
4765         it.  Declare old cleanup handler installation functions.
4766         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
4767         handling.
4768         * cleanup_defer.c: Likewise.
4769         * cleanup_compat.c: New file.  Old cleanup code.
4770         * cleanup_def_compat.c: New file.  Old cleanup code.
4771         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
4772         if own thread descriptor.
4773         * unwind.c: New file.
4774         * forward.c: Add __pthread_unwind.
4775         * init.c (pthread_functions): Add __pthread_unwind.
4776         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
4777         Add ptr___pthread_unwind.
4778         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
4779         and unwind function.
4780         * Makefile (libpthread-routines): Add cleanup_compat,
4781         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
4782         table generation if necessary.
4783         * version.c: Record whether unwind support is compiled in.
4784         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
4785         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
4786         handler interfaces.
4787         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
4788         complication to generate unwind information for syscall wrappers.
4789         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4790         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
4791         __cleanup_fct_attribute.
4793         * Makefile: Add rules to build and run tst-cleanup0.
4794         * tst-cleanup0.c: New file.
4795         * tst-cleanup0.expect: New file.
4797         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
4798         caller.  Optimize to avoid often unecessary local variable.
4800 2003-04-11  Roland McGrath  <roland@redhat.com>
4802         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
4803         sets variable `multidir'; include that.
4804         (generated): Add it.
4805         ($(objpfx)$(multidir)/crti.o): New target.
4806         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
4808 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4810         * tst-attr2.c (do_test): Add cast to avoid warning.
4811         * tst-mutex4.c (do_test): Likewise.
4813 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
4815         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
4816         in child.
4818 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
4820         * Makefile (tests): Add tst-detach1.
4821         * tst-detach1.c: New file.
4823 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
4825         * sysdeps/pthread/pthread.h: Remove duplicate
4826         pthread_cleanup_{push,pop} definitions.
4828         * tst-barrier2.c: Eliminate warnings.
4829         * tst-cancel4.c: Likewise.
4830         * tst-cond4.c: Likewise.
4831         * tst-cond6.c: Likewise.
4832         * tst-detach1.c: Likewise.
4833         * tst-rwlock4.c: Likewise.
4834         * tst-rwlock6.c: Likewise.
4835         * tst-rwlock7.c: Likewise.
4836         * tst-sem3.c: Likewise.
4837         * tst-spin2.c: Likewise.
4838         * tst-umask1.c: Likewise.
4840 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
4842         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
4844 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
4846         * descr.h (struct pthread): Move cancelhandling member to the front.
4848 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
4850         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
4851         malloc_parent, and malloc_child statically.
4852         (__register_atfork_malloc): New function.
4853         (free_mem): Don't free any of the malloc_* variables on the list.
4854         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
4855         Define HAVE_register_atfork_malloc.
4857 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
4859         * sysdeps/pthread/createthread.c (create_thread): Add some more
4860         comments explaining when to set multiple_threads and when not.
4862         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4863         THREAD_ATOMIC_BIT_SET if not already defined.
4864         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4865         THREAD_ATOMIC_BIT_SET:
4866         * sysdeps/x86_64/tls.h: Likewise.
4867         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
4868         THREAD_ATOMIC_CMPXCHG_VAL.
4869         (_pthread_cleanup_pop_restore): Likewise.
4870         * cancellation.c (__pthread_enable_asynccancel): Likewise.
4871         (__pthread_enable_asynccancel_2): Likewise.
4872         (__pthread_disable_asynccancel): Likewise.
4873         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4874         (__libc_disable_asynccancel): Likewise.
4875         * init.c (sigcancel_handler): Likewise.
4876         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
4877         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
4879 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
4881         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
4882         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4883         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
4884         * Makefile (tests): Add tst-cancel11.
4885         * tst-cancel11.c: New file.
4887 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
4889         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
4890         round, not the first.  Use specific_used flag instead of local
4891         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
4892         (__free_tcb): Don't call deallocate_tsd here.
4893         (start_thread): Call deallocate_tsd here.
4894         * pthread_setspecific.c: Set specific_used flag really only when
4895         needed.
4896         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
4897         * tst-tsd3.c: New file.
4898         * tst-tsd4.c: New file.
4900 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4902         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
4903         Use atomic_exchange_and_add instead of __lll_add.
4904         (__lll_mutex_timedlock): Likewise.
4905         Patch by Ian Wienand.
4907 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
4909         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4910         (SINGLE_THREAD_P): Fix typo.
4911         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
4913 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4915         * Makefile (tests): Add tst-align.
4916         * tst-align.c: New file.
4917         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
4919         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
4920         function correctly.
4922         * tst-tsd2.c: Add casts to avoid warnings.
4924 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
4926         * descr.h (struct pthread): Move most often used elements to the front.
4928 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
4930         * Makefile (libpthread-routines): Add pthread_atfork.
4931         (libpthread-static-only-routines): Add pthread_atfork.
4933 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4935         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
4936         of TLS_DTV_AT_TP.
4937         (INSTALL_DTV): Add parens.
4938         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
4939         Use passed descr instead of THREAD_SELF.
4940         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
4941         (__lll_mutex_timedlock_wait): Correct expected value after
4942         spurious wakeup.
4943         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
4944         Release lock before waking up the waiters.
4945         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
4946         criteria.  Reorderstruct passed to cleanup handler.  Fix
4947         handling of cancellation and failung pthread_mutex_unlock call.
4948         Use __pthread_enable_asynccancel_2 instead of
4949         __pthread_enable_asynccancel.
4950         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4951         Return result of lock re-get if it fails.
4952         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
4953         for __pthread_cleanup_push.
4954         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
4955         completely broken rwlock implementation.
4956         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4957         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4958         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4959         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
4960         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4961         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
4962         versioned_symbol macro.
4963         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
4964         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4966 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
4968         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
4969         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
4970         and __helper_tid.
4971         (struct timer): Remove th and bar field.
4972         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
4973         debugging code.  Create only one helper thread.
4974         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
4975         helper thread.
4976         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4977         Renamed.  Define statically.  Use thread info from siginfo.
4978         (__helper_once): New variable.
4979         (__helper_tid): New variable.
4980         (__reset_helper_control): New function.
4981         (__start_helper_thread): New function.
4983         * pthread_create.c (start_thread): Don't use setjmp inside
4984         __builtin_expect to work around gcc bug.
4986         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
4987         timer_delete syscall fails, but not with ENOSYS, set
4988         __no_posix_timers.
4990         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
4991         (timer_settime): Fix typo.
4992         * sysdeps/unix/sysv/linux/timer_getoverr.c
4993         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
4995 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
4997         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
4998         offset of cleanupbuf.__prev.
5000 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
5002         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
5003         of included file.
5005 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
5007         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
5008         NULL provide default definition to syscall.
5010 2003-03-25  Roland McGrath  <roland@redhat.com>
5012         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
5013         (timer_id2ptr): Fix typo.
5015 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
5017         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
5018         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
5019         * sysdeps/ia64/pthreaddef.h: Likewise.
5020         * sysdeps/powerpc/pthreaddef.h: Likewise.
5021         * sysdeps/s390/pthreaddef.h: Likewise.
5022         * sysdeps/sh/pthreaddef.h: Likewise.
5023         * sysdeps/x86_64/pthreaddef.h: Likewise.
5024         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
5025         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
5026         being changed.
5027         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
5028         SIGTIMER is not unblocked.
5029         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
5030         RT signal taken.
5031         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
5032         be send.
5033         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
5034         pass pointer through as ID.
5035         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
5036         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
5037         * sysdeps/unix/sysv/linux/timer_create.c: New file.
5038         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
5039         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
5040         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
5041         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
5042         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
5043         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
5044         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
5045         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
5046         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
5047         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
5048         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
5049         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
5050         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
5051         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
5052         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
5053         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
5054         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
5055         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
5056         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
5057         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
5058         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
5059         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
5060         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
5061         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
5062         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
5063         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
5064         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
5065         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
5066         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
5067         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
5069         * pthreadP.h: Remove FRAME_LEFT definition.
5070         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
5071         already left frame.  Programs which have this problem are not POSIX
5072         compliant.
5073         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
5075 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
5077         * sysdeps/pthread/tst-timer.c: Check return values of the
5078         functions we test.
5080 2003-03-23  Roland McGrath  <roland@redhat.com>
5082         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
5083         * tst-tls3mod.c: Likewise.
5084         * tst-tls1.c: Likewise.
5085         * tst-tls2.c: Likewise.
5087         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
5088         undefined behavior.
5090         * tst-join5.c (tf1, tf2): Add a cast.
5092         * Makeconfig (includes): Append -I$(..)nptl to this variable.
5094         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
5095         Don't test anything.
5096         * tst-cond4.c: Likewise.
5097         * tst-cond6.c: Likewise.
5098         * tst-flock2.c: Likewise.
5099         * tst-mutex4.c: Likewise.
5100         * tst-rwlock4.c: Likewise.
5101         * tst-signal1.c: Likewise.
5102         * tst-spin2.c: Likewise.
5103         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
5105         * tst-mutex4.c: Use test-skeleton.c.
5106         * tst-spin2.c: Likewise.
5107         * tst-sysconf.c: Likewise.
5108         * tst-barrier2.c: Likewise.
5109         * tst-cond4.c: Likewise.
5110         * tst-cond6.c: Likewise.
5111         * tst-rwlock4.c: Likewise.
5112         * tst-unload.c: Likewise.
5113         * tst-flock2.c (do_test): Use return instead of exit.
5115 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
5117         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
5119 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
5121         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
5122         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
5123         instead of __lll_compare_and_swap.
5124         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
5125         Likewise.
5126         Removed definition if __lll_compare_and_swap.
5128         * cancellation.c: Adjust for new form of compare&exchange macros.
5129         * cleanup_defer.c: Likewise.
5130         * init.c: Likewise.
5131         * libc-cancellation.c: Likewise.
5132         * old_pthread_cond_broadcast.c: Likewise.
5133         * old_pthread_cond_signal.c: Likewise.
5134         * old_pthread_cond_timedwait.c: Likewise.
5135         * old_pthread_cond_wait.c: Likewise.
5136         * pthread_cancel.c: Likewise.
5137         * pthread_create.c: Likewise.
5138         * pthread_detach.c: Likewise.
5139         * pthread_join.c: Likewise.
5140         * pthread_key_delete.c: Likewise.
5141         * pthread_setcancelstate.c: Likewise.
5142         * pthread_setcanceltype.c: Likewise.
5143         * pthread_timedjoin.c: Likewise.
5144         * pthread_tryjoin.c: Likewise.
5145         * sysdeps/pthread/createthread.c: Likewise.
5147 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
5149         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
5150         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
5151         definitions.  Replace uses with calls to atomic_* functions.
5152         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5153         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
5154         __lll_test_and_set calls with atomic_exchange_and_add and
5155         atomic_exchange calls respectively.
5156         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
5157         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
5158         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
5159         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
5160         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
5161         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
5162         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
5164         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
5165         returns the old value.
5167 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
5169         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
5170         int for variable OLDVAL and correct inline assembler contraint.
5171         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
5172         type int for variable OLD.
5174         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
5175         only for s390-32.
5176         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
5177         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
5178         instead of multiple_threads field in the TCB.
5180 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
5182         * sysdeps/i386/i686/bits/atomic.h: Removed.
5183         * sysdeps/i386/i586/bits/atomic.h: Removed.
5184         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
5185         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
5186         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
5187         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
5188         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
5189         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
5190         * atomic.h: Removed.  Moved to glibc.
5192         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
5193         support for clock selection.
5195         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
5196         signalling waiters.
5198 2003-03-18  Roland McGrath  <roland@redhat.com>
5200         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
5201         Add __lll_rel_instr first.  Add memory clobber.
5202         (lll_mutex_unlock): Use __lll_test_and_set.
5203         From Paul Mackerras <paulus@samba.org>.
5205         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
5206         unconditionally.
5207         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
5208         (SINGLE_THREAD_P):  Add `header.' prefix.
5209         From Paul Mackerras <paulus@samba.org>.
5211         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
5212         pthread_timedjoin_np to ...
5213         (libpthread: GLIBC_2.3.3): ... here.
5214         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
5216         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5217         Avoid shadowing VAL variable.
5219         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
5220         New macro.
5222 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
5224         * Makefile (tests): Add tst-cond11.
5225         * tst-cond11.c: New file.
5227         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
5228         struct passed to cleanup handler to eliminate one more
5229         instruction.
5230         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5232         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5233         (pthrad_cond_t): Replace __unused field with __clock.
5235         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
5236         waken all waiters in cleanup handler.
5237         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5238         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5240         * pthread_condattr_getclock.c: New file.
5241         * pthread_condattr_setclock.c: New file.
5242         * sysdeps/pthread/pthread.h: Declare these new functions.
5243         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
5244         * Makefile (libpthread-routines): Add the new functions.
5245         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
5246         Renamed field to value.  Document use of the bits.
5247         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
5248         change.
5249         * pthread_condattr_setpshared.c: Likewise.
5250         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
5251         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
5252         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5253         Add __clock field.
5254         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5255         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5256         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5257         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5258         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
5259         Implement clock selection.
5260         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5261         * pthread-errnos.sym: Add ENOSYS.
5262         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5263         _POSIX_CLOCK_SELECTION.
5264         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5266         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
5267         invalid .size directive.
5269 2003-03-17  Roland McGrath  <roland@redhat.com>
5271         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
5272         Formatting tweaks.
5274 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
5276         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
5277         Use __lll_add instead of spelling it out.  Use protected symbol names.
5278         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
5279         Use __lll_add.
5280         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
5281         Renamed from lll_compare_and_swap.  Use new name where necessary.
5282         (__lll_add): Defined.
5283         (__lll_dec_if_positive): Defined.
5284         (__lll_test_and_set): Defined.
5285         * sysdeps/ia64/pthread_spin_init.c: Removed.
5286         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
5287         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
5288         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
5289         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
5290         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
5291         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
5292         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
5293         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
5294         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
5295         __sync_lock_release_si.
5296         Patch by Jakub Jelinek.
5298         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
5299         Fix timeout handling.
5300         (__lll_timedwait_tid): Likewise.
5301         (lll_unlock_wake_cb): Wake up other waiters if necessary.
5302         Patch by Jakub Jelinek.
5304         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
5306 2003-03-17  Roland McGrath  <roland@redhat.com>
5308         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
5309         * sysdeps/pthread/pthread_spin_init.c: New file.
5310         * sysdeps/pthread/pthread_spin_unlock.c: New file.
5311         * sysdeps/powerpc/Makefile: New file.
5312         * sysdeps/powerpc/pthread_spin_lock.c: New file.
5313         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
5314         * sysdeps/powerpc/pthreaddef.h: New file.
5315         * sysdeps/powerpc/tcb-offsets.sym: New file.
5316         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
5317         * sysdeps/powerpc/tls.h: New file.
5318         * sysdeps/powerpc/bits/atomic.h: New file.
5319         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
5320         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
5321         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
5323         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
5324         * sysdeps/unix/sysv/linux/sem_post.c: New file.
5325         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
5326         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
5327         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
5328         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
5329         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
5330         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
5331         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
5332         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
5333         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
5334         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
5335         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
5336         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
5337         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
5339         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
5340         not gettimeofday.
5341         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
5342         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
5343         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
5344         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
5345         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5347 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
5349         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
5350         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5351         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5352         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5353         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
5355 2003-03-16  Roland McGrath  <roland@redhat.com>
5357         * tst-fork4.c: Include <string.h>.
5358         * tst-signal2.c: Likewise.
5359         * tst-mutex5.c (do_test): exit -> return.
5360         * tst-mutex2.c: Include <stdlib.h>.
5362 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
5364         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
5365         (__lll_mutex_timedlock_wait): Correct expected value after
5366         spurious wakeup.  Otherwise we would never wait again.
5368         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
5369         zone versus inline asm stupidity.  Use correct instructions.
5371         * tst-rwlock6.c: Add some more status output.
5373 2003-03-15  Roland McGrath  <roland@redhat.com>
5375         * sysdeps/pthread/configure.in: New file.
5376         * sysdeps/pthread/configure: New file (generated).
5378 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5380         * allocatestack.c (allocate_stack): Store the exact stack size of
5381         user allocated stacks.
5383 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
5385         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
5386         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
5387         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5388         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
5389         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
5390         Use `header.' prefix.
5391         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5393 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5395         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
5396         __builtin_frame_address, use stack pointer.
5398         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
5399         instead of __builtin_frame_pointer.
5401 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5403         * tst-basic1.c (do_test): Add cast to avoid warning.
5404         * tst-basic2.c (do_test): Likewise.
5406         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
5407         amount of stack correction.
5409         * tst-fork4.c: Use test-skeleton.c.
5411 2003-03-14  Roland McGrath  <roland@redhat.com>
5413         * init.c: Fix typo "#eli" for "#else".
5415 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
5417         * allocatestack.c (__stack_user): Use hidden_data_def.
5418         * pthread_create.c (__pthread_keys): Likewise.
5420         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
5422 2003-03-14  Roland McGrath  <roland@redhat.com>
5424         * tst-fork4.c: New file.
5425         * Makefile (tests): Add it.
5427         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
5428         we always define the padding space.
5429         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
5430         stopped supporting its own extensions fully.
5431         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
5432         struct also called `header', so `header.multiple_threads' is the field
5433         name to use on all machines.
5434         * allocatestack.c (allocate_stack): Use `header.' prefix.
5435         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5436         * pthread_create.c (__pthread_create_2_1): Likewise.
5437         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
5438         (THREAD_SELF): Likewise.
5439         * sysdeps/x86_64/tls.h: Likewise.
5440         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5441         (SINGLE_THREAD_P): Likewise.
5442         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5443         (SINGLE_THREAD_P): Likewise.
5444         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
5445         (SINGLE_THREAD_P): Likewise.
5447         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
5448         value directly.
5450 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5452         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
5453         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
5455         * pthread_create.c (start_thread): setjmp is expected to return 0.
5457         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
5458         (THREAD_GETMEM_NC): Likewise.
5460 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
5462         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
5463         and the size of the stack which must be allocated is a multiple,
5464         allocate one more page.
5465         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
5466         MULTI_PAGE_ALIASING.
5468 2003-03-13  Roland McGrath  <roland@redhat.com>
5470         * pthread_create.c (start_thread): Set EXITING_BIT after the
5471         event-reporting (and destructors), not before.
5473 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
5475         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
5476         lll_futex_wake): Declare register variables as long int instead of
5477         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
5478         Make syscall arguments clobbered by the syscall.
5479         (lll_futex_wait): Define using lll_futex_timed_wait.
5481         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
5482         to void *.
5484         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
5485         PPID if [! NDEBUG].
5487         * allocatestack.c (nptl_ncreated): Only declare if
5488         COLORING_INCREMENT != 0.
5490         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
5491         (__libc_enable_asynccancel_2): Remove prototype.
5493         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
5494         ctid to match kernel.
5496 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5498         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
5499         libc_multiple_threads.
5500         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
5501         __libc_multiple_threads to...
5502         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
5504         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
5505         versioning.
5506         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5507         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5509         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
5510         (__pthread_once_internal): Define.
5512         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
5513         macros instead of .symver directly.
5514         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5515         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
5517         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
5518         * sysdeps/x86_64/tcb-offsets.sym: New file.
5519         * sysdeps/x86_64/Makefile: New file.
5521         * sysdeps/i386/tcb-offsets.sym: Add SELF.
5522         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
5523         to access own pthread_t in TCB.
5524         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5525         Likewise.
5526         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5527         Likewise.
5528         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5530 2003-03-12  Roland McGrath  <roland@redhat.com>
5532         * pthread-errnos.sym: New file.
5533         * Makefile (gen-as-const-headers): New variable, list that file.
5534         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
5535         header <pthread-errnos.h> instead of defining errno values here.
5536         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5537         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5538         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5539         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5540         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5541         Likewise.
5542         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5543         Likewise.
5544         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5545         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5546         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5547         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5548         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5549         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5550         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5551         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5552         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5553         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5554         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5555         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
5556         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
5557         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
5558         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
5559         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5560         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5561         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5562         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5563         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5564         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5565         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5566         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
5567         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
5568         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
5569         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5570         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5572         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
5573         CLONE_CHILD_SETTID worked.
5575 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5577         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
5578         file.
5579         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
5580         file.
5582         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5583         (pthread_cond_t): Add padding.
5585         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
5586         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
5587         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
5589         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
5590         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
5591         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
5592         (__pthread_rwlock_timedrdlock): Likewise.
5593         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
5594         (__pthread_rwlock_wrlock): Likewise.
5595         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
5596         (__pthread_rwlock_rdlock): Likewise.
5598         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
5600         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
5601         result of lock re-get if it fails.
5603 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5605         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
5606         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5607         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5608         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5609         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5610         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5611         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5612         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5613         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5614         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5616         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
5617         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
5619         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
5620         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
5621         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
5622         (create_thread): Likewise.
5623         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
5624         * init.c (__pthread_initialize_minimal_internal): Initialize
5625         __libc_multiple_threads_ptr if necessary.
5626         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
5627         __pthread_multiple_threads and __libc_multiple_threads_ptr.
5628         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
5629         __libc_multiple_threads.
5630         (__libc_pthread_init): Return pointer to __libc_pthread_init if
5631         necessary.
5633         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
5634         (THREAD_SETMEM_NC): Likewise.
5636         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
5637         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
5638         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
5639         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
5641         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
5642         Eliminate one entire instruction.
5644         * cancellation.c (__pthread_enable_asynccancel_2): New function.
5645         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
5646         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5647         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
5648         instead of __pthread_enable_asynccancel.
5649         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5650         (__pthread_cond_wait): Likewise.
5651         * sysdeps/pthread/pthread_cond_timedwait.c
5652         (__pthread_cond_timedwait): Likewise.
5653         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5655         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5656         (__condvar_cleanup): Wake up all waiters in case we got signaled
5657         after being woken up but before disabling asynchronous
5658         cancellation.
5659         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5660         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5661         (__condvar_cleanup): Likewise.
5663         * init.c (__NR_set_tid_address): If already defined, don't redefine.
5664         Make it an error if architecture has no #if case.  Add x86-64.
5666         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
5667         pt-initfini.s generation.
5669         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
5670         (TLS_INIT_TP): Fix typo.
5672 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5674         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
5675         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
5677         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
5678         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
5679         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
5680         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
5681         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
5682         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5683         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5684         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5686 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5688         * sysdeps/pthread/pthread_cond_timedwait.c
5689         (__pthread_cond_timedwait): Return the result of the final
5690         locking.  If it succeeds, the regular function return value.
5692         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
5693         Return result of the final locking.
5694         * version.c (__nptl_main): Work around problems with the strange
5695         INTERNAL_SYSCALL macro on ppc32.
5696         * init.c (__pthread_initialize_minimal_internal): Unblock
5697         SIGCANCEL in case the parent blocked it.
5698         Reported by Paul Mackerras <paulus@samba.org>.
5700         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
5701         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
5702         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
5704 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5706         * sysdeps/pthread/pthread_cond_timedwait.c
5707         (__pthread_cond_timedwait): Unlock and fail if
5708         __pthread_mutex_unlock_internal failed.
5710         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
5711         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
5712         Use ARCH_CLONE.
5713         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
5714         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
5715         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
5716         ALLOCATE_STACK): New macros.
5717         (TLS_TPADJ): New macro.
5718         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
5719         (allocate_stack): Handle TLS_DTV_AT_TP and
5720         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
5721         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
5722         Don't set PD->self.
5723         * init.c [__ia64__] (__NR_set_tid_address): Define.
5725         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
5726         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
5727         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
5728         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
5729         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
5730         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
5731         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
5732         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
5733         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
5734         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
5735         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
5736         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
5737         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
5738         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
5739         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
5740         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
5741         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
5742         * sysdeps/ia64/bits/atomic.h: New file.
5743         * sysdeps/ia64/Makefile: New file.
5744         * sysdeps/ia64/pthread_spin_init.c: New file.
5745         * sysdeps/ia64/pthread_spin_lock.c: New file.
5746         * sysdeps/ia64/pthread_spin_trylock.c: New file.
5747         * sysdeps/ia64/pthread_spin_unlock.c: New file.
5748         * sysdeps/ia64/pthreaddef.h: New file.
5749         * sysdeps/ia64/tcb-offsets.sym: New file.
5750         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
5751         * sysdeps/ia64/tls.h: New file.
5753         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
5754         to syscall instead of no arguments.
5756 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
5758         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
5759         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
5760         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
5761         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
5763         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
5764         unused code.
5766         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
5768         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5769         lowlevelbarrier.sym.
5770         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
5771         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
5772         Include lowlevelbarrier.h and don't define offsets locally.
5773         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
5775         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
5776         (__lll_mutex_lock_wait): Reverse order of first two parameters.
5777         (__lll_mutex_timedlock_wait): Likewise.
5778         (lll_mutex_lock): Adjust asm for that.
5779         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
5780         (lll_lock): Adjust asm for operand order change.
5781         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
5782         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
5784         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
5785         Reverse order of parameters.
5786         (__lll_timedwait_tid): Remove regparms attribute.
5787         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
5788         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
5790         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5791         (__lll_timedwait_tid): Remove one unnecessary instruction.
5793         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
5794         __lll_mutex_timedlock_wait only for NOT_IN_libc.
5795         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
5796         lowlevelmutex.S.
5798         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
5799         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
5800         for NOT_IN_libc.
5801         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
5802         lowlevellock.S.
5804         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
5805         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
5806         for libc.so.
5807         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
5808         define LOCK here (if UP is not defined).  The actual code is in
5809         lowlevelmutex.S.
5811         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
5812         LOCK is already defined.  Don't define lll_unlock_wake_cb and
5813         __lll_timedwait_tid for libc.so.
5814         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
5815         define LOCK here (if UP is not defined).  The actual code is in
5816         lowlevellock.S.
5818         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
5819         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
5820         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
5821         instead of lowlevelsem.h.
5822         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5823         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5824         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5826         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5827         lowlevelrwlock.sym.
5828         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
5829         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
5830         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
5832         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
5833         register loading.
5834         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
5835         last changed.  D'oh.
5837         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
5839         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
5840         of __libc_locking_needed.
5841         (lll_trylock): Initialize %eax to zero.
5843         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
5844         pthread_cond_t definition.
5846 2003-03-10  Roland McGrath  <roland@redhat.com>
5848         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
5849         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
5850         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
5851         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
5852         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
5854         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
5855         Instead of setting PD->multiple_threads, set globals
5856         __pthread_multiple_threads and __libc_multiple_threads.
5857         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5858         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
5859         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
5861         * descr.h (struct pthread): Conditionalize first member on
5862         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
5863         containing an anonymous tcbhead_t.  Move `list' member out.
5864         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
5865         * allocatestack.c: Remove use of `header.data.' prefix.
5866         * pthread_create.c: Likewise.
5867         * init.c (__pthread_initialize_minimal_internal): Likewise.
5868         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5869         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
5870         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
5871         * sysdeps/x86_64/tls.h: Likewise.
5872         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5873         (SINGLE_THREAD_P): Likewise.
5874         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5875         (SINGLE_THREAD_P): Likewise.
5876         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
5877         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
5879 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
5881         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
5883         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
5884         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5886         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
5887         leftovers from the ia32 code.
5889         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
5890         memory load.
5891         (clear_once_control): Don't load %esi.
5893         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
5894         handling.
5896         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5898         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
5899         * sysdeps/unix/sysv/linux/createthread.c: ...here.
5901         * Makefile (tests): Add tst-cond10.
5902         * tst-cond10.c: New file.
5904 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
5906         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
5907         * tst-signal3.c (do_test): Likewise.
5908         * tst-sem5.c (do_test): Likewise.
5909         * tst-kill6.c (do_test): Likewise.
5910         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
5912         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
5913         of inc/dec.
5914         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
5915         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
5916         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5917         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5918         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5919         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5920         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5921         Likewise.
5922         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5923         Likewise.
5924         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5925         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5926         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5927         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5928         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5929         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
5930         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5931         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5933         * allocatestack.c (allocate_stack): If mprotect() fails free the
5934         TLS memory.
5936 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
5938         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
5940         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
5941         lll_wake_tid.  This was used only to work around kernel limits in
5942         the early days.
5943         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
5944         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
5945         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5946         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
5948         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
5949         (__pthread_initialize_minimal_internal): Change initialization of
5950         __static_tls_align_m1 appropriately.
5951         * pthreadP.h (__static_tls_align_m1): Renamed from
5952         __static_tls_align.
5953         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
5954         instead of __static_tls_align-1.
5956 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
5958         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
5960         * pthread_create.c: Define __pthread_keys using nocommon
5961         attribute, not by placing it explicitly in bss.
5962         Remove DEFINE_DEALLOC definition.  Not needed anymore.
5964         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
5965         Use it in mmap call to allocate stacks.
5967         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
5969         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
5970         result of the thread function.
5972 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
5974         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
5975         version is just fine.
5977         * sysdeps/unix/sysv/linux/libc_pthread_init.c
5978         (__pthread_child_handler): Renamed from pthread_child_handler,
5979         exported, and marked hidden.  Change all users.
5980         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
5981         free __pthread_child_handler from child list.
5983 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5985         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
5987         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5988         Fix handling of cancellation and failing pthread_mutex_unlock call.
5989         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5990         (__pthread_cond_wait): Likewise.
5992         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
5993         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
5994         lll_futex_timed_wait call.
5995         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
5996         (pthread_rwlock_timedwrlock): Likewise.
5998         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
5999         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
6000         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
6002         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
6003         check of lll_futex_wake return value.
6005 2003-03-03  Roland McGrath  <roland@redhat.com>
6007         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
6009         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6010         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
6011         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
6013 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
6015         * sysdeps/pthread/timer_create.c (timer_create): Return correct
6016         error for CPU clocks.
6018         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6019         _POSIX_MONOTONIC_CLOCK.
6020         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6022         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
6023         recent kernels.
6025 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
6027         * descr.h (struct pthread): Move cleanup field to the front.
6029 2003-03-01  Roland McGrath  <roland@redhat.com>
6031         * sem_open.c (sem_open): Braino fix.
6033 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
6035         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
6036         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
6037         __pthread_cleanup_pop functionality.
6038         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6040         * descr.h (struct pthread): Move tid field to the front now that
6041         it is often used.
6043         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
6044         (__lll_mutex_timedlock_wait): Remove.
6045         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
6046         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6047         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
6048         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6049         (lll_unlock_wake_cb): Don't save and restore %esi.
6050         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
6051         %esi.
6052         (__lll_timedwait_tid): Add alignment.
6053         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
6054         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
6055         %esi.
6056         (__lll_timedwait_tid): Removed.
6057         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6058         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
6059         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
6060         (pthread_barrier_wait): Don't save, load, and restore %esi for
6061         last thread.
6062         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6063         (__pthread_cond_signal): Don't save, load, and restore %esi.
6064         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
6065         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
6066         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
6067         Don't save, load, and restore %esi.
6069 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
6071         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
6072         Release lock before waking up the waiters.
6074         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
6076         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
6077         (reader_thread): Likewise.
6079         * sysdeps/pthread/pthread_rwlock_unlock.c
6080         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
6081         to wake up readers if there are none.
6083         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
6084         Release internal lock before wake threads.
6086 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
6088         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
6089         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
6090         predefined.
6091         * tst-rwlock9.c: Likewise.
6092         * tst-rwlock10.c: New file.
6093         * tst-rwlock11.c: New file.
6095         * Makefile (tests): Add tst-dlsym1.
6096         * tst-dlsym1.c: New file.
6098         * init.c (__pthread_initialize_minimal_internal): Set
6099         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
6100         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
6102 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
6104         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
6106         * tst-cond2.c: Fix sychronization with child.
6108         * tst-rwlock8.c (reader_thread): Remove unused variable.
6110         * Makefile: Add rules to build and run tst-tls3.
6111         * tst-tls3.c: New file.
6112         * tst-tls3mod.c: New file.
6114         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
6115         * tst-rwlock8.c: New file.
6116         * tst-rwlock9.c: New file.
6117         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
6118         complete broken rwlock implementation.
6119         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6120         Likewise.
6121         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6122         Likewise.
6123         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6124         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6125         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6126         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6127         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6128         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
6129         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6131 2003-02-23  Roland McGrath  <roland@redhat.com>
6133         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
6135 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
6137         * Makefile (tests): Add tst-context1.
6138         * tst-context1.c: New file.
6140         * Makefile (tests): Add tst-tls1 and tst-tls2.
6141         * tst-tls1.c: New file.
6142         * tst-tls2.c: New file.
6144         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
6145         for failed cmpxchg.
6147         * pthread_create.c (start_thread): Set EXITING_BIT early.
6149         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
6150         (THREAD_GETMEM_NC): Likewise.
6152 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
6154         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
6155         off 3 more bytes by using offset-less instructions when possible.
6157         * Makefile: Add dependency for $(objpfx)version.d.
6159         * eintr.c (eintr_source): Add unnecessary return but the compiler
6160         insists.
6162         * tst-kill3.c: Include <unistd.h>.
6164 2003-02-21  Roland McGrath  <roland@redhat.com>
6166         * pthread_create.c (start_thread): Call __libc_thread_freeres.
6168 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
6170         * Makefile (tests): Add tst-eintr1.
6171         (distribute): Add eintr.c.
6172         * tst-eintr1.c: New file.
6173         * eintr.c: New file.
6175         * pthread_cancel.c (pthread_cancel): Use tkill directly.
6177         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
6178         Disallow sending SIGCANCEL.
6180         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
6181         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
6182         * tst-kill1.c: New file.
6183         * tst-kill2.c: New file.
6184         * tst-kill3.c: New file.
6185         * tst-kill5.c: New file.
6186         * tst-kill6.c: New file.
6187         * tst-basic7.c: Renamed to...
6188         * tst-kill4.c: ...this.
6190 2003-02-21  Roland McGrath  <roland@redhat.com>
6192         * Makefile (install-lib-ldscripts): New variable.
6194 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
6196         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
6197         * pthread_cancel.c: Use INVALID_TD_P.
6198         * pthread_detach.c: Likewise.
6199         * pthread_getschedparam.c: Likewise.
6200         * pthread_setschedparam.c: Likewise.
6201         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6202         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6203         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
6204         * pthread_timedjoin.c: Likewise.
6206         * tst-basic7.c: Include <signal.h>.
6208         * pthread_join.c (pthread_join): Limited checking for invalid
6209         descriptors.
6210         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
6212 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
6214         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
6215         beginning of the loop.  Clear the entire first block of TSD.
6216         * Makefile (tests): Add tst-key4.
6217         * tst-key4.c: New file.
6219 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
6221         * Makefile (tests): Add tst-basic7.
6222         * tst-basic7.c: New file.
6224         * pthread_create.c (deallocate_tsd): Mark as internal_function.
6225         Add some more __builtin_expect.
6227         * pthreadP.h: Define dummy version of DEBUGGING_P.
6229 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
6231         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
6232         _POSIX_THREAD_PRIORITY_SCHEDULING.
6233         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
6234         _XOPEN_REALTIME_THREADS.
6235         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
6237         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
6238         kernel returns EINVAL for PID <= 0, work around it.
6240         * Makefile (tests): Add tst-signal5.
6241         * tst-signal5.c: New file.
6243         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
6244         and LOGIN_NAME_MAX.
6246         * tst-cancel1.c (tf): Block all signals.
6248         * Makefile (tests): Add tst-basic6.
6249         * tst-basic6.c: New file.
6251         * tst-basic1.c: Add test for process ID.
6253         * Makefile (tests): Add tst-cancel10.
6254         * tst-cancel10.c: New file.
6256         * Makefile (tests): Add tst-signal4.
6257         * tst-signal4.c: New file.
6259         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
6260         __sigismember instead of sigismember.  Add __builtin_expect.
6262 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
6264         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
6265         pthread_setcancelstate, and pthread_rwlock_setpshared.
6267         * tst-cancel7.c (do_test): Make sure the pid file exists before
6268         canceling the thread.
6270         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
6271         pthread_rwlock_timedrdlock tests.
6272         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
6273         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6274         Check for invalid tv_nsec field.
6275         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6276         Likewise.
6278         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
6279         recursive mutex of overflow.
6281         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
6283         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
6284         going into an endless loop.
6285         * Makefile (tests): Add tst-cancel9.
6286         * tst-cancel9.c: New file.
6288         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
6290 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
6292         * tst-mutex5.c (do_test): Add more timedlock tests.
6294         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
6295         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
6297         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
6298         use INLINE_SYSCALL.  Error number is returned, not -1.
6300         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
6301         and __deallocate_stack with internal_function.
6302         * pthread_create.c: Adjust definitions appropriately.
6303         * allocatestack.c: Likewise.
6305         * pthread_join.c: Add one more __builtin_expect.
6306         * pthread_timedjoin.c: Likewise.
6308         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
6309         not data of sequence number does not match.
6310         Add one __builtin_expect.
6312         * Makefile (tests): Add tst-clock1.
6313         * tst-clock1.c: New file.
6315         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
6316         negative arguments.
6317         * Makefile (tests): Add tst-basic5.
6318         * tst-basic5.c: New file.
6320 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
6322         * Makefile (tests): Add tst-basic4.
6323         * tst-basic4.c: New file.
6325         * pthreadP.h: Add declaraction for __nptl_nthreads.
6326         * pthread_create.c: Define __nptl_nthreads
6327         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
6328         after thread is done.  If then zero, call exit(0).
6329         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6330         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
6331         * init.c (pthread_functions): Initialize ptr_nthreads.
6332         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
6333         (__reclaim_stacks): Decrement __nptl_nthreads.
6334         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
6335         Define.
6336         * Makefile (tests): Add tst-basic3.
6337         * tst-basic3.c: New file.
6339         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
6340         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
6341         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
6342         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
6343         if asynchronous canceling is enabled.
6344         * pthread_join.c (pthread_join): When recognizing circular joins,
6345         take into account the other thread might be already canceled.
6346         * Makefile (tests): Add tst-join5.
6347         * tst-join5.c: New file.
6349         * Makefile (tests): Add tst-join4.
6350         * tst-join4.c: New file.
6352 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
6354         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
6356 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6358         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
6359         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
6360         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
6361         warning.
6362         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
6363         to avoid warning.
6364         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
6365         error if lll_futex_wake failed.
6367 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
6369         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
6370         handling of cancellation and failung pthread_mutex_unlock call.
6371         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6372         * Makefile (tests): Add tst-cond8 and tst-cond9.
6373         * tst-cond8.c: New file.
6374         * tst-cond9.c: New file.
6376         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
6378         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
6379         non-standard initializers with __USE_GNU.
6381         * Makefile (tests): Add tst-cleanup3.
6382         * tst-cleanup3.c: New file.
6384 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
6386         * Makefile (tests): Add tst-attr1 and tst-attr2.
6387         * tst-attr1.c: New file.
6388         * tst-attr2.c: New file.
6390         * Makefile: Add rules to build and run tst-atfork2 test.
6391         * tst-atfork2.c: New file.
6392         * tst-atfork2mod.c: New file.
6394         * sysdeps/unix/sysv/linux/unregister-atfork.c
6395         (__unregister_atfork): Free the memory allocated for the handlers
6396         after removing them from the lists.
6398         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
6399         cleanup function.
6401         * tst-atfork1.c (do_test): Wait for the child we forked.
6402         Report error in child.
6404         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
6406         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
6408 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
6410         * Makefile (tests): Add tst-cancel8.
6411         * tst-cancel8.c: New file.
6413         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
6414         clearing of control variable.
6415         * Makefile (tests): Add tst-once3 and tst-once4.
6416         * tst-once3.c: New file.
6417         * tst-once4.c: New file.
6419 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
6421         * sysdeps/sh/Makefile: New file.
6422         * sysdeps/sh/bits/atomic.h: New file.
6423         * sysdeps/sh/pthread_spin_init.c: New file.
6424         * sysdeps/sh/pthread_spin_lock.c: New file.
6425         * sysdeps/sh/pthread_spin_trylock.S: New file.
6426         * sysdeps/sh/pthread_spin_unlock.S: New file.
6427         * sysdeps/sh/pthreaddef.h: New file.
6428         * sysdeps/sh/tcb-offsets.sym: New file.
6429         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
6430         * sysdeps/sh/tls.h: New file.
6431         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
6432         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
6433         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
6434         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
6435         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
6436         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
6437         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
6438         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
6439         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
6440         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
6441         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
6442         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
6443         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
6444         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
6445         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
6446         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
6447         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
6448         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
6449         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
6450         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
6451         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
6452         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
6453         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
6454         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
6455         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
6456         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
6457         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
6458         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
6459         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
6460         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
6462 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
6464         * tst-cond2.c: Rearrange code to not rely on behavior undefined
6465         according to POSIX.
6467         * tst-basic2.c (do_test): Lock mutex before creating the thread.
6469 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
6471         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
6472         (TLS_GET_FS): New #define.
6473         (TLS_SET_FS): New #define.
6474         Correct value of __NR_set_thread_area.
6476         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
6478 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
6480         * Makefile (tests): Add tst-popen1.
6481         * tst-popen1.c: New file.
6483         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
6484         but inactive generalization.
6485         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6486         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6487         Minor optimization, remove one instruction.
6488         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6490 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6492         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
6494 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6496         * init.c (__NR_set_tid_address): Add #ifdef for s390.
6497         * sysdeps/pthread/pthread_barrier_wait.c: New file.
6498         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
6499         * sysdeps/pthread/pthread_cond_signal.c: New file.
6500         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
6501         * sysdeps/pthread/pthread_cond_wait.c: New file.
6502         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
6503         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
6504         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
6505         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
6506         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
6507         * sysdeps/s390/Makefile: New file.
6508         * sysdeps/s390/bits/atomic.h: New file.
6509         * sysdeps/s390/pthread_spin_init.c: New file.
6510         * sysdeps/s390/pthread_spin_lock.c: New file.
6511         * sysdeps/s390/pthread_spin_trylock.c: New file.
6512         * sysdeps/s390/pthread_spin_unlock.c: New file.
6513         * sysdeps/s390/pthreaddef.h: New file.
6514         * sysdeps/s390/tcb-offsets.sym: New file.
6515         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
6516         * sysdeps/s390/tls.h: New file.
6517         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
6518         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
6519         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
6520         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
6521         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
6522         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
6523         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6524         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
6525         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
6526         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
6527         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
6528         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
6529         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
6530         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
6531         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
6532         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
6533         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
6534         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
6535         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
6536         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
6537         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
6538         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6539         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
6541 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
6543         * atomic.h: Add a couple more default implementations.
6544         (atomic_compare_and_exchange_acq): Use
6545         __arch_compare_and_exchange_32_acq in return value definition.  It
6546         always exists.
6547         (atomic_bit_set): Renamed from atomic_set_bit.
6548         Add missing atomic_ prefixes.
6550         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
6551         thread library is available, use correct value to mark initialized
6552         once variable.
6554 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
6556         * allocatestack.c (allocate_stack): Use __getpagesize instead of
6557         __sysconf to determine pagesize.
6559         * pthread_create.c: Include <atomic.h>.
6560         * allocatestack.c (allocate_stack): Implement coloring of the
6561         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
6562         size minus one.  Adjust users.
6563         * sysdeps/i386/i686/Makefile: New file.
6565 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
6567         * allocatestack.c: Improve comment throughout the file.
6569         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6570         (__lll_lock_wait): Add branch prediction.
6571         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
6572         (__lll_lock_wait): Likewise.
6573         (lll_unlock_wake_cb): Removed.
6575 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
6577         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
6578         _POSIX_THREAD_PRIORITY_SCHEDULING.
6580 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
6582         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6583         Fix return type of ptr___pthread_getspecific.
6585 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
6587         * Makefile (tests): Add tst-umask1.
6588         (tst-umask1-ARGS): Define.
6589         * tst-umask1.c: New file.
6591 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
6593         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
6594         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
6595         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
6596         pthread_rwlock_unlock.
6597         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
6598         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
6599         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
6600         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
6601         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6602         New file.
6603         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
6604         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6605         New file.
6606         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
6607         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
6608         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
6609         New file.
6610         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
6611         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
6612         New file.
6613         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
6614         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
6615         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
6616         New file.
6617         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
6618         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
6619         New file.
6620         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
6622         * Makefile (libpthread-routines): Remove lowlevelcond and
6623         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
6624         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
6625         and pthread_cond_broadcast.
6626         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
6627         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
6628         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
6629         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
6630         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
6631         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
6632         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
6633         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
6634         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
6635         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
6636         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
6637         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
6638         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
6639         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
6640         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
6641         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
6642         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
6643         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
6644         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
6645         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
6646         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
6647         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
6648         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
6649         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
6650         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
6651         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
6652         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
6653         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
6654         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
6655         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
6656         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
6658         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
6659         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
6660         of the code is moved to ...
6661         * sysdeps/pthread/createthread.c: ...here.  New file.
6663 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
6665         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
6666         (__new_sem_post): Clear %eax before returning.
6667         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
6669         * Makefile (tests): Add tst-cleanup2.
6670         * tst-cleanup2.c: New file.
6672         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6673         Interpret first parameter correctly.
6675 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
6677         * Makefile (headers): Add bits/semaphore.h.
6679 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
6681         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
6682         if not SHARED.
6684 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
6686         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
6687         must be used and mapping failed.
6688         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
6690         * Makefile (CFLAGS-pthread_self.os): Define this, not
6691         CFLAGS-pthread_self.c.
6693 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6695         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
6696         lll_unlock_wake_cb.
6698         * Makefile (libpthread-routines): Add version.  Add rules to build
6699         version.os and banner.h.
6700         * version.c: New file.
6702 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
6704         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
6705         the alias unconditional.
6706         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
6708 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6710         * Makefile (CFLAGS-pthread_self.c): New definition.
6712 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6714         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
6715         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
6716         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
6717         * init.c (__pthread_initialize_minimal_internal): Likewise.
6719 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
6721         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
6723         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6724         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6725         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6726         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6727         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6728         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6730 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6732         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
6733         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
6734         * tst-cancel-wrappers.sh: Remove all exceptions.
6736 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
6738         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
6739         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
6741         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
6742         Use __libc_pthread_functions array if SHARED.
6744         * pthreadP.h: Move pthread_cond_2_0_t definition to...
6745         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
6747         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
6748         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
6749         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
6750         __libc_ptf_call instead of __libc_maybe_call.
6751         (PTF): New #define.
6752         (__libc_cleanup_region_start): Wrap function name with PTF call.
6753         (__libc_cleanup_region_end): Likewise.
6754         (__libc_cleanup_end): Likewise.
6756         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
6757         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
6758         * pthread_key_create.c: Add __pthread_key_create_internal alias.
6759         * pthreadP.h: Add prototypes.
6761         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
6762         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
6763         __pthread_rwlock_unlock aliases.
6764         * pthreadP.h: Add prototypes for new aliases.
6766         * pthreadP.h (struct pthead_functions): Moved to...
6767         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
6768         * init.c (pthread_functions): Add initializers for new elements.
6770         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
6771         __pthread_cleanup_pop_restore aliases.
6772         * pthreadP.h: Add prototypes.
6774         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
6775         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
6776         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
6777         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
6778         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
6779         * pthreadP.h: Adjust prototypes and callers.
6781 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
6783         * Makefile (tests): Add tst-cancel7.
6784         (tst-cancel7-ARGS): New variable.
6785         * tst-cancel7.c: New file.
6787         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
6788         around gcc defficiencies.
6789         * old_pthread_cond_signal.c: Likewise.
6790         * old_pthread_cond_timedwait.c: Likewise.
6791         * old_pthread_cond_wait.c: Likewise.
6793         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
6795 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6797         * Makefile (tests): Add tst-cond7.
6798         * tst-cond7.c: New file.
6800         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6801         (condvar_cleanup): Get condvar address from the right place.
6803         * atomic.h: Correct definitions of atomic_full_barrier,
6804         atomic_read_barrier, atomic_write_barrier.
6806         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
6807         race-free.
6808         * old_pthread_cond_signal.c: Likewise.
6809         * old_pthread_cond_timedwait.c: Likewise.
6810         * old_pthread_cond_wait.c: Likewise.
6812 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
6814         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
6816 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6818         * pthreadP.h (pthread_cond_2_0_t): New type.
6819         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
6820         Use new type for the 2.0 condvar function prototypes.
6821         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
6822         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
6823         parameter.
6824         * old_pthread_cond_destroy.c: Likewise.
6825         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
6826         * old_pthread_cond_signal.c: Likewise.
6827         * old_pthread_cond_timedwait.c: Likewise.
6828         * old_pthread_cond_wait.c: Likewise.
6830         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6831         (__pthread_cond_wait): Don't save cancellation mode and seq value
6832         in same location.
6834         * herrno.c (__h_errno_location): Don't define as weak.
6836 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6838         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
6839         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
6840         and pthread_cond_wait.
6841         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
6842         Renamed to...
6843         (__pthread_cond_broadcast_2_0): ... this.
6844         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
6845         Renamed to...
6846         (__pthread_cond_destroy_2_0): ... this.
6847         * old_pthread_cond_init.c (__old_pthread_cond_init):
6848         Renamed to...
6849         (__pthread_cond_init_2_0): ... this.
6850         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
6851         Renamed to...
6852         (__pthread_cond_signal_2_0): ... this.
6853         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
6854         Renamed to...
6855         (__pthread_cond_wait_2_0): ... this.
6856         * pthread_cond_destroy.c: Include shlib-compat.h.
6857         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
6858         * pthread_cond_init.c: Include shlib-compat.h.
6859         (pthread_cond_init): Change strong_alias into versioned_symbol.
6860         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
6861         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
6862         fields.
6863         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
6864         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
6865         __pthread_cond_wait_2_0): New prototypes.
6866         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
6867         __old_pthread_cond_init, __old_pthread_cond_signal,
6868         __old_pthread_cond_wait): Removed.
6869         * init.c: Include shlib-compat.h.
6870         (pthread_functions): Guard ptr___pthread_attr_init_2_0
6871         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
6872         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
6873         ptr___pthread_cond_*_2_0 fields.
6874         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
6875         pthread_cond_*@GLIBC_2.0 compatibility symbols.
6877         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
6878         LIBC_SIGACTION was not yet defined.
6879         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
6880         [!defined LIBC_SIGACTION] (__sigaction): New function and
6881         libc_hidden_weak.
6882         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
6883         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
6885 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6887         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
6889 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
6891         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6892         New, larger type definition.
6893         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
6894         implementation.
6895         * Versions [libpthread]: Add definitions for new pthread_cond_*
6896         interfaces for version GLIBC_2.3.2.
6897         * pthread_cond_init.c: Update initialization for new type definition.
6898         * Makefile (libpthread-routines): Remove pthread_cond_wait,
6899         pthread_cond_timedwait, pthread_cond_signal, and
6900         pthread_cond_broadcast.  Add old_pthread_cond_init,
6901         old_pthread_cond_destroy, old_pthread_cond_wait,
6902         old_pthread_cond_timedwait, old_pthread_cond_signal, and
6903         old_pthread_cond_broadcast.
6904         * old_pthread_cond_broadcast.c: New file.
6905         * old_pthread_cond_destroy.c: New file.
6906         * old_pthread_cond_init.c: New file.
6907         * old_pthread_cond_signal.c: New file.
6908         * old_pthread_cond_timedwait.c: New file.
6909         * old_pthread_cond_wait.c: New file.
6910         * pthreadP.h: Add prototypes for the compatibility interfaces.
6912         * pthread_cond_destroy.c: Don't include <errno.h>.
6914 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
6916         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
6917         unnecessary zero offset when addressing MUTEX.
6919 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6921         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6922         __register_atfork.
6923         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
6924         for __register_atfork.
6926 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6928         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
6929         instead of ASSEMBLER test macro.
6931         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
6932         __libc_current_sigrtmax): Add libc_hidden_def.
6934         * sysdeps/pthread/list.h: Remove assert.h include.
6936 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6938         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
6939         __pthread_initialize_minimal_internal not
6940         __pthread_initialize_minimal.
6942 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
6944         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
6945         __pthread_initialize_minimal as hidden.
6947         * init.c (__pthread_initialize_minimal_internal): Don't mark as
6948         constructor.
6950 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6952         * Makefile ($(inst_libdir)/libpthread.so): Depend on
6953         $(common-objpfx)format.lds, include that into the output script.
6954         Fix comment.
6955         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
6957 2002-12-28  Andreas Jaeger  <aj@suse.de>
6959         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
6960         nsec resolution changes.
6961         (xstat64_conv): Likewise.
6962         (xstat32_conv): Likewise.
6963         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
6964         struct kernel_stat.
6965         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
6966         structs stat and stat64.
6967         * time/time.h (__timespec_defined): Define for __USE_MISC.
6968         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
6970 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
6972         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
6973         argument.
6974         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
6975         (pthread_exit): Use strong_alias to avoid warnings.
6976         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
6977         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
6978         ptr___pthread_attr_init_2_*.
6979         * init.c (pthread_functions): Adjust.
6981 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
6983         * forward.c: Make all functions available by default again.  It
6984         caused too much trouble.
6986         * pt-siglongjmp.c: Removed.
6988 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
6990         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
6991         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
6992         * sysdeps/i386/Makefile: New file.
6993         * sysdeps/i386/tcb-offsets.sym: New file.
6994         * sysdeps/pthread/tcb-offsets.h: New file.
6995         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6996         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
6998         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
6999         __register_atfork...
7000         (GLIBC_2.3.2): ...here.
7002 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
7004         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
7005         pthread_attr_setstackaddr with __attribute_deprecated__.
7007 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
7009         * pt-system.c (system): Remove cancellation handling.
7010         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
7011         cancellation routines.
7013 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
7015         * descr.h: Include <dl-sysdep.h>.
7016         (struct pthread): Move header.data.list to the back of the struct.
7017         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
7018         (MULTIPLE_THREADS_OFFSET): Adjust offset.
7019         (SYSINFO_OFFSEET): Likewise.
7021 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
7023         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
7024         Define.
7025         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
7026         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
7027         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
7028         (USE_DL_SYSINFO): Undef.
7030 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
7032         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
7033         $(common-objpfx)libc.so.
7034         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
7035         it is bigger than pipe buffer size even on arches with bigger
7036         page size.
7037         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
7039 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
7041         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
7042         correct errno access for case that USE___THREAD is not defined.
7044 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
7046         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
7047         Patch by Marijn Ros <marijn@mad.scientist.com>.
7049 2002-12-22  Roland McGrath  <roland@redhat.com>
7051         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
7053 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
7055         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
7057 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
7059         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
7060         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
7061         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
7063         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
7064         of int $0x80.
7065         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7066         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
7067         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
7068         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7069         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7070         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
7071         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
7072         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
7074         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
7075         sysenter.
7076         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
7078         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
7080         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
7081         in new TCB.
7082         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
7083         that sysinfo is properly initialized.
7084         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
7085         to 1 only for ld.so.
7087         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
7088         RTLD_CORRECT_DYNAMIC_WEAK.
7090 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
7092         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
7093         Use return 0 as 6th argument to FORWARD4.
7094         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
7096 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
7098         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
7099         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
7100         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
7101         (INIT_SYSINFO): New #define.
7102         (TLS_TP_INIT): Use INIT_SYSINFO.
7103         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7104         At test to make sure SYSINFO_OFFSET value is correct.
7105         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
7107 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
7109         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
7110         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
7111         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
7112         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
7113         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
7114         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
7115         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
7117 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
7119         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
7120         macro instead of using int $0x80 directly.
7122         * sysdeps/pthread/bits/stdio-lock.h: New file.
7123         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
7124         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
7125         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
7126         * Makefile (routines): Add libc-lowlevelmutex.
7128         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
7129         __i686.get_pc_thunk.dx.
7131 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
7133         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
7134         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
7135         ($(objpfx)tst-cancel-wrappers.out): New rule.
7136         * tst-cancel-wrappers.sh: New test.
7137         * tst-locale1.c: Include signal.h.
7138         (uselocale): Test static linking of __libc_current_sigrt*.
7140 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
7142         * Makefile (tests): Add tst-cancel6.
7143         * tst-cancel6.c: New file
7145 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
7147         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
7148         Define meaningfully for assembler as well.
7149         * pthreadP.h (struct pthread_functions): Remove
7150         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
7151         and ptr_pthread_attr_init_2_1 fields.
7152         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
7153         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
7154         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
7155         (FORWARD3): Define using FORWARD4.
7156         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
7157         versions.
7158         * pt-system.c: Remove duplicate stdlib.h include.
7160 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
7162         * sem_init.c: Define sem_init@GLIBC_2.0.
7163         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
7164         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
7166         * flockfile.c: Moved to...
7167         * sysdeps/pthread/flockfile.c: ...here.  New file.
7168         * funlockfile.c: Moved to...
7169         * sysdeps/pthread/funlockfile.c: ...here.  New file.
7170         * ftrylockfile.c: Moved to...
7171         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
7173 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
7175         * libc-cancellation.c: Guard both function with
7176         #if !defined NOT_IN_libc.
7177         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
7178         automatically provided pthread wrappers.
7179         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
7180         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
7181         nor in libpthread.
7182         * pt-open.c: Removed.
7183         * pt-fcntl.c: Removed.
7184         * pt-fsync.c: Removed.
7185         * pt-lseek.c: Removed.
7186         * pt-msgrcv.c: Removed.
7187         * pt-msgsnd.c: Removed.
7188         * pt-msync.c: Removed.
7189         * pt-nanosleep.c: Removed.
7190         * pt-open64.c: Removed.
7191         * pt-pause.c: Removed.
7192         * pt-pread.c: Removed.
7193         * pt-pread64.c: Removed.
7194         * pt-pwrite.c: Removed.
7195         * pt-pwrite64.c: Removed.
7196         * pt-read.c: Removed.
7197         * pt-recv.c: Removed.
7198         * pt-recvfrom.c: Removed.
7199         * pt-recvmsg.c: Removed.
7200         * pt-send.c: Removed.
7201         * pt-sendto.c: Removed.
7202         * pt-sigtimedwait.c: Removed.
7203         * pt-sigwait.c: Removed.
7204         * pt-wait.c: Removed.
7205         * pt-waitpid.c: Removed.
7206         * pt-write.c: Removed.
7207         * pt-accept.c: Removed.
7208         * pt-close.c: Removed.
7209         * pt-connect.c: Removed.
7210         * pt-lseek64.c: Removed.
7211         * pt-sendmsg.c: Removed.
7212         * pt-tcdrain.c: Removed.
7214 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
7216         * init.c (__pthread_initialize_minimal_internal): Renamed from
7217         __pthread_initialize_minimal.  Make old name an alias.  This
7218         converts a normal relocation into a relative relocation.
7220         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
7222         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
7223         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
7224         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
7225         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
7226         pt-sigwaitinfo, pt-waitid, and pt-writev.
7227         * pt-creat.c: Removed.
7228         * pt-poll.c: Removed.
7229         * pt-pselect.c: Removed.
7230         * pt-readv.c: Removed.
7231         * pt-select.c: Removed.
7232         * pt-sigpause.c: Removed.
7233         * pt-sigsuspend.c: Removed.
7234         * pt-sigwaitinfo.c: Removed.
7235         * pt-waitid.c: Removed.
7236         * pt-writev.c: Removed.
7238         * init.c (pthread_functions): New variable.
7239         (__pthread_initialize_minimal): Pass pointer to pthread_functions
7240         (or NULL) to __libc_pthread_init.
7241         * forward.c: Rewrite to use __libc:pthread_functions array to get
7242         function addresses.
7243         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
7244         prototype.
7245         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7246         Take new parameter.  Copy content of variable pointed to by it
7247         to __libc_pthread_init.
7249         * pthreadP.h (struct pthread_functions): New type.
7250         (__libc_pthread_init): Declare.
7252         * pthread_attr_destroy.c: Add namespace protected alias.
7253         * pthread_attr_getdetachstate.c: Likewise.
7254         * pthread_attr_getinheritsched.c: Likewise.
7255         * pthread_attr_getschedparam.c: Likewise.
7256         * pthread_attr_getschedpolicy.c: Likewise.
7257         * pthread_attr_getscope.c: Likewise.
7258         * pthread_attr_setdetachstate.c: Likewise.
7259         * pthread_attr_setinheritsched.c: Likewise.
7260         * pthread_attr_setschedparam.c: Likewise.
7261         * pthread_attr_setschedpolicy.c: Likewise.
7262         * pthread_attr_setscope.c: Likewise.
7263         * pthread_cond_broadcast.c: Likewise.
7264         * pthread_cond_destroy.c: Likewise.
7265         * pthread_cond_init.c: Likewise.
7266         * pthread_cond_signal.c: Likewise.
7267         * pthread_cond_wait.c: Likewise.
7268         * pthread_condattr_destroy.c: Likewise.
7269         * pthread_condattr_init.c: Likewise.
7270         * pthread_equal.c: Likewise.
7271         * pthread_exit.c: Likewise.
7272         * pthread_getschedparam.c: Likewise.
7273         * pthread_self.c: Likewise.
7274         * pthread_setcancelstate.c: Likewise.
7275         * pthread_setschedparam.c: Likewise.
7276         * pthread_mutex_destroy.c: Likewise.
7277         * pthread_mutex_init.c: Likewise.
7278         * pthreadP.h: Add prototypes for the aliases.
7280         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
7281         multiple_threads member in correct TCB to 1.
7283         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
7284         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
7285         member of thread decriptor, otherwise return unconditionally 1.
7287 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
7289         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
7290         regular Linux version.  Remove file.
7291         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
7292         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
7293         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
7294         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
7295         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
7296         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
7297         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
7298         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
7299         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
7300         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
7301         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
7302         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
7303         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
7304         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
7305         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
7306         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
7307         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
7308         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
7309         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
7310         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
7311         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
7312         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
7313         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
7314         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
7315         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
7316         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
7317         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
7318         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
7319         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
7320         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
7322 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
7324         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
7325         * sysdeps/unix/sysv/linux/open.c: Removed.
7326         * sysdeps/unix/sysv/linux/fsync.c: Removed.
7327         * sysdeps/unix/sysv/linux/lseek.c: Removed.
7328         * sysdeps/unix/sysv/linux/msync.c: Removed.
7329         * sysdeps/unix/sysv/linux/read.c: Removed.
7330         * sysdeps/unix/sysv/linux/close.c: Removed.
7331         * sysdeps/unix/sysv/linux/creat.c: Removed.
7332         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
7333         * sysdeps/unix/sysv/linux/pause.c: Removed.
7334         * sysdeps/unix/sysv/linux/select.c: Removed.
7335         * sysdeps/unix/sysv/linux/write.c: Removed.
7337 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
7339         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
7340         element in TCB to see whether locking is needed.
7342         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
7343         MULTIPLE_THREADS_OFFSET value is correct.
7345         * sysdeps/unix/sysv/linux/close.c: New file.
7346         * sysdeps/unix/sysv/linux/connect.S: New file.
7347         * sysdeps/unix/sysv/linux/creat.c: New file.
7348         * sysdeps/unix/sysv/linux/fsync.c: New file.
7349         * sysdeps/unix/sysv/linux/llseek.c: New file.
7350         * sysdeps/unix/sysv/linux/lseek.c: New file.
7351         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
7352         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
7353         * sysdeps/unix/sysv/linux/msync.c: New file.
7354         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
7355         * sysdeps/unix/sysv/linux/open.c: New file.
7356         * sysdeps/unix/sysv/linux/open64.c: New file.
7357         * sysdeps/unix/sysv/linux/pause.c: New file.
7358         * sysdeps/unix/sysv/linux/poll.c: New file.
7359         * sysdeps/unix/sysv/linux/pread.c: New file.
7360         * sysdeps/unix/sysv/linux/pread64.c: New file.
7361         * sysdeps/unix/sysv/linux/pselect.c: New file.
7362         * sysdeps/unix/sysv/linux/pwrite.c: New file.
7363         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
7364         * sysdeps/unix/sysv/linux/readv.c: New file.
7365         * sysdeps/unix/sysv/linux/recv.S: New file.
7366         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
7367         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
7368         * sysdeps/unix/sysv/linux/select.c: New file.
7369         * sysdeps/unix/sysv/linux/send.S: New file.
7370         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
7371         * sysdeps/unix/sysv/linux/sendto.S: New file.
7372         * sysdeps/unix/sysv/linux/sigpause.c: New file.
7373         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
7374         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7375         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7376         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7377         * sysdeps/unix/sysv/linux/system.c: New file.
7378         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
7379         * sysdeps/unix/sysv/linux/wait.c: New file.
7380         * sysdeps/unix/sysv/linux/waitid.c: New file.
7381         * sysdeps/unix/sysv/linux/waitpid.c: New file.
7382         * sysdeps/unix/sysv/linux/writev.c: New file.
7383         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
7385         * pt-readv.c: Fix comment.
7387 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
7389         * tst-cleanup1.c: Include stdlib.h.
7391         * tst-cancel5.c: New test.
7392         * Makefile (tests): Add tst-cancel5.
7393         (tst-cancel5): Link against libc.so libpthread.so in that order.
7395 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
7397         * forward.c (test_loaded): Prevent recursive calls.
7399         * Makefile (routines): Add libc-cancellation.
7400         * libc-cancellation.c: New file.
7401         * descr.h (struct pthread): Add multiple_threads field.
7402         * allocatestack.c (allocate_stack): Initialize multiple_header field of
7403         new thread descriptor to 1.
7404         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
7405         Initialize multiple_thread field after successful thread creation.
7406         * cancellation.c (__do_cancel): Move to pthreadP.h.
7407         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
7408         (__pthread_disable_asynccancel): Add internal_function attribute.
7409         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
7410         * pthread_setcancelstate.c: Likewise.
7411         * pthread_setcanceltype.c: Likewise.
7412         * pthread_exit.c: Likewise.
7413         * pthreadP.h (CANCELLATION_P): Likewise.
7414         (__do_cancel): Define as static inline.
7415         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
7416         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
7417         declarations.
7418         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
7419         fields.  Define MULTIPLE_THREADS_OFFSET.
7420         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
7421         declaration.
7422         * sysdeps/unix/sysv/linux/accept.S: New file.
7423         * sysdeps/unix/sysv/linux/read.c: New file.
7424         * sysdeps/unix/sysv/linux/write.c: New file.
7425         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
7426         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
7427         initialization of __libc_locking_needed.
7428         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
7429         __libc_locking_needed, use multiple_threads field in TCB.
7430         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7432 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7434         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
7435         version.
7436         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
7438         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
7439         access to __libc_locking_needed for PIC.
7441 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
7443         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
7444         declare for libc.so.
7445         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
7446         expression.
7447         (__libc_lock_lock): Put into statement expression.
7448         (__libc_lock_unlock): Remove trailing semicolon.
7449         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
7451 2002-12-12  Roland McGrath  <roland@redhat.com>
7453         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
7454         "m" constraint to refer to __libc_locking_needed.  Declare it here.
7456 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7458         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
7459         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
7460         Initialize __libc_locking_needed.
7461         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
7462         instead of __register_pthread_fork_handler.
7463         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
7464         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
7465         fork-gen with libc_pthread_init.
7466         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
7467         of __register_pthread_fork_handler.
7468         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
7469         of __register_pthread_fork_handler.
7470         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
7471         __libc_locking_needed to determine whether lock prefix can be avoided.
7472         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7474 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
7476         * Makefile (tests): Add tst-cleanup1.
7477         * tst-cleanup1.c: New file.
7478         * cancellation.c (__cleanup_thread): Removed.
7479         (__do_cancel): Remove call to __cleanup_thread.
7480         * pthreadP.h: Remove __cleanup_thread prorotype.
7482         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
7483         Remember function and argument even if cancellation handler
7484         function is not available.
7485         (__libc_cleanup_region_end): Execute registered function directly if
7486         pthread functions are not available.
7487         (__libc_cleanup_end): Likewise.
7489         * init.c (__pthread_initialize_minimal): Fix initialization in
7490         static lib by preventing gcc from being too clever.
7492 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
7494         * init.c (__pthread_initialize_minimal): Remove unneccesary
7495         sigaddset call.
7497         * Makefile (tests): We can run tst-locale2 now.
7499 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
7501         * Versions: Remove duplicated sigwait entry.
7503 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
7505         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
7506         inside libpthread.
7508         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
7510         * pthreadP.h: Declare __pthread_enable_asynccancel and
7511         __pthread_disable_asynccancel.
7512         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
7513         (CANCEL_RESET): Use __pthread_disable_asynccancel.
7514         * cancellation.c (__pthread_enable_asynccancel): New function.
7515         (__pthread_disable_asynccancel): New function.
7516         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
7517         * pt-close.c: Likewise.
7518         * pt-connect.c: Likewise.
7519         * pt-creat.c: Likewise.
7520         * pt-fcntl.c: Likewise.
7521         * pt-fsync.c: Likewise.
7522         * pt-lseek.c: Likewise.
7523         * pt-lseek64.c: Likewise.
7524         * pt-msgrcv.c: Likewise.
7525         * pt-msgsnd.c: Likewise.
7526         * pt-msync.c: Likewise.
7527         * pt-nanosleep.c: Likewise.
7528         * pt-open.c: Likewise.
7529         * pt-open64.c: Likewise.
7530         * pt-pause.c: Likewise.
7531         * pt-poll.c: Likewise.
7532         * pt-pread.c: Likewise.
7533         * pt-pread64.c: Likewise.
7534         * pt-pselect.c: Likewise.
7535         * pt-pwrite.c: Likewise.
7536         * pt-pwrite64.c: Likewise.
7537         * pt-read.c: Likewise.
7538         * pt-readv.c: Likewise.
7539         * pt-recv.c: Likewise.
7540         * pt-recvfrom.c: Likewise.
7541         * pt-recvmsg.c: Likewise.
7542         * pt-select.c: Likewise.
7543         * pt-send.c: Likewise.
7544         * pt-sendmsg.c: Likewise.
7545         * pt-sendto.c: Likewise.
7546         * pt-sigpause.c: Likewise.
7547         * pt-sigsuspend.c: Likewise.
7548         * pt-sigtimedwait.c: Likewise.
7549         * pt-sigwait.c: Likewise.
7550         * pt-sigwaitinfo.c: Likewise.
7551         * pt-system.c: Likewise.
7552         * pt-tcdrain.c: Likewise.
7553         * pt-wait.c: Likewise.
7554         * pt-waitid.c: Likewise.
7555         * pt-waitpid.c: Likewise.
7556         * pt-write.c: Likewise.
7557         * pt-writev.c: Likewise.
7558         * pthread_join.c: Likewise.
7559         * pthread_timedjoin.c: Likewise.
7561         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
7562         (__xpg_sigpause): New function.
7563         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
7565 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
7567         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
7569         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
7570         _GI_pthread_cleanup_pop to pthreadP.h.
7572         * ftrylockfile.c: Use _IO_lock_trylock instead of
7573         pthread_mutex_trylock.
7575         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
7576         (CANCEL_RESET): Likewise.
7577         (__pthread_setcanceltype_): Declare.
7578         (__pthread_mutex_lock_internal): Declare.
7579         (__pthread_mutex_unlock_internal): Declare.
7580         (__pthread_once_internal): Declare.
7581         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
7582         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
7584         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
7585         and pthread_mutex_unlock.
7586         * pthread_cond_wait.c: Likewise.
7587         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
7588         * pthread_mutex_unlock.c: Likewise.
7590         * pthread_setcanceltype.c: Add additional alias
7591         __pthread_setcanceltype.
7593         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
7594         * sem_open.c (sem_open): Likewise.
7595         Use __libc_open, __libc_write, and __libc_close instead of
7596         open, write, and close respectively.
7598         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
7599         Rewrite as statement expression since it must return a value.
7601         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
7602         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
7603         __pthread_kill.
7605         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
7606         alias __pthread_once_internal.
7608         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
7610 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
7612         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
7613         * tst-stdio1.c: New file.
7614         * tst-stdio2.c: New file.
7616         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
7618         * Makefile (tests): Comment out tst-locale2 for now.
7619         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
7621         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
7622         -D_IO_MTSAFE_IO.
7623         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
7624         Use _IO_lock_init instead of explicit assignment.
7626         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
7627         Define __libc_lock_* and __libc_lock_recursive macros with
7628         lowlevellock macros, not pthread mutexes.
7630         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
7631         of pthread_mutex_lock.
7632         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
7633         instead of pthread_mutex_unlock.
7635 2002-12-06  Roland McGrath  <roland@redhat.com>
7637         * allocatestack.c (__stack_user): Use uninitialized defn.
7638         * init.c (__pthread_initialize_minimal): Initialize it here.
7640 2002-12-05  Roland McGrath  <roland@redhat.com>
7642         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
7643         string.
7644         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
7646         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
7647         missing & here too.
7649 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
7651         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7652         lowlevellock.
7653         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
7654         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
7655         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
7656         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
7657         for __libc_lock_* macros.
7658         * Makefile (routines): Add libc-lowlevellock.
7660 2002-10-09  Roland McGrath  <roland@redhat.com>
7662         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
7663         Under [__PIC__], call the function via the pointer fetched for
7664         comparison rather than a call by name that uses the PLT.
7665         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
7666         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
7667         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
7668         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
7669         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
7671 2002-12-04  Roland McGrath  <roland@redhat.com>
7673         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
7675         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
7676         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
7678         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
7680 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7682         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
7683         a completely opaque, non-integer type.
7684         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7686 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
7688         * sysdeps/i386/tls.h: Include stdlib.h.
7689         * sysdeps/x86_64/tls.h: Likewise.
7691 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7693         * Makefile (tests): Add tst-locale2.
7694         (tests-static): Likewise.
7695         * tst-locale2.c: New file.
7697         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
7698         volatile and add memory clobbers to lock operations.
7700 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
7702         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
7703         * sysdeps/i386/i486/bits/atomic.h: New file.
7704         * sysdeps/i386/i586/bits/atomic.h: New file.
7705         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
7706         include i486 version.
7707         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
7708         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
7709         Patch by Marijn Ros <marijn@mad.scientist.com>.
7711         * allocatestack.c (get_cached_stack): Don't crash if we first
7712         found a stack with a larger size then needed.
7713         Reported by Hui Huang <hui.huang@sun.com>.
7715         * Makefile (tests): Add tst-sysconf.
7716         * tst-sysconf.c: New file.
7718         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
7719         PTHREAD_THREADS_MAX.
7721 2002-12-02  Roland McGrath  <roland@redhat.com>
7723         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
7724         Declare using hidden_proto instead of attribute_hidden, so there are
7725         non-.hidden static symbols for gdb to find.
7726         (__pthread_keys): Likewise.
7727         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
7728         * allocatestack.c (__stack_user): Likewise.
7729         * pthread_create.c (__pthread_keys): Likewise.
7730         (__nptl_threads_events, __nptl_last_event): Make these static instead
7731         of hidden.
7732         * pthread_key_create.c (__pthread_pthread_keys_max,
7733         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
7735 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
7737         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
7738         statically.
7739         * tst-locale1.c: New file.
7741         * pthread_cond_timedwait.c: Include <stdlib.h>.
7743         * Makefile (tests): Add tst-fork2 and tst-fork3.
7744         * tst-fork2.c: New file.
7745         * tst-fork3.c: New file.
7747 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
7749         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
7751         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
7752         require it to 200112L.
7754         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
7755         instruction only if HAVE_CMOV is defined.
7756         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
7758         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
7760         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
7762         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
7764         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
7766 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
7768         * sysdeps/x86_64/bits/atomic.h: New file.
7770         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
7771         16-bit operations.
7773         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
7774         possible since gettid cannot fail.
7776         * sysdeps/x86_64/pthreaddef.h: New file.
7778         * sysdeps/i386/pthreaddef.h (gettid): Removed.
7780         * sysdeps/x86_64/pthread_spin_init.c: New file.
7781         * sysdeps/x86_64/pthread_spin_lock.c: New file.
7782         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
7783         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
7785         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
7786         Add missing lock prefix.  Minute optimization.
7788         * tst-spin2.c (main): Also check successful trylock call.
7790         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
7791         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
7793         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
7794         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
7796         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
7797         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
7798         value in case of an error.  Add support for INTERNAL_SYSCALL.
7800         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
7801         value in case of an error.
7803         * sysdeps/x86_64/tls.h: New file.
7805 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7807         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
7808         takes the array member name and the index as parameters.
7809         (THREAD_SETMEM_NC): Likewise.
7810         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
7811         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
7812         interfaces.
7814         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
7815         to decide which code to use.
7816         (THREAD_SETMEM_NC): Likewise.
7818         * allocatestack.c (queue_stack): Don't remove stack from list here.
7819         Do it in the caller.  Correct condition to prematurely terminate
7820         loop to free stacks.
7821         (__deallocate_stack): Remove stack from list here.
7823 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7825         * Makefile (tests): Add tst-stack1.
7826         * tst-stack1.c: New file.
7828         * allocatestack.c (allocate_stack): Initialize the TCB on a user
7829         provided stack.
7831         * pthread_attr_getstack.c: Return bottom of the thread area.
7833 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
7835         * Makefile (libpthread-routines): Add pt-allocrtsig and
7836         pthread_kill_other_threads.
7837         * pt-allocrtsig.c: New file.
7838         * pthread_kill_other_threads.c: New file.
7839         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
7840         all three functions.
7841         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7842         allocrtsig.
7843         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
7844         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
7845         and __libc_allocate_rtsig_private.
7846         * Versions (libpthread): Export pthread_kill_other_threads_np,
7847         __libc_current_sigrtmin, and __libc_current_sigrtmax.
7849 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
7851         * allocatestack.c (allocate_stack): stackaddr in attribute points to
7852         the end of the stack.  Adjust computations.
7853         When mprotect call fails dequeue stack and free it.
7854         * pthread_attr_setstack.c: Store top of the stack in stackaddr
7855         attribute.
7856         * pthread_getattr_np.c: Likewise.
7858         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
7859         surprises.
7861 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
7863         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
7864         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7866 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
7868         * pthread_getspecific.c: Optimize access to first 2nd-level array.
7869         * pthread_setspecific.c: Likewise.
7871 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
7873         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
7874         definitions.  Get them from the official place.
7875         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
7877         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
7878         Use new CLONE_ flags in clone() calls.
7880         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
7881         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
7883         * Versions: Add pthread_* functions for libc.
7884         * forward.c: New file.
7886         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
7887         errno-loc.
7888         * herrno.c: New file.
7889         * res.c: New file.
7891         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
7892         sem_trywait, and sem_timedwait.  Add herrno and res.
7893         * sem_init.c: Don't initialize lock and waiters members.
7894         * sem_open.c: Likewise.
7895         * sem_post.c: Removed.
7896         * sem_wait.c: Removed.
7897         * sem_trywait.c: Removed.
7898         * sem_timedwait.c: Removed.
7899         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
7900         Includes full implementations of sem_post, sem_wait, sem_trywait,
7901         and sem_timedwait.
7902         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
7903         for new implementation.
7904         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
7905         and waiters fields.
7907         * tst-sem3.c: Improve error message.
7908         * tst-signal3.c: Likewise.
7910         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
7911         to tell the kernel about the termination futex and to initialize tid
7912         member.  Don't initialize main_thread.
7913         * descr.h (struct pthread): Remove main_thread member.
7914         * cancelllation.c (__do_cancel): Remove code handling main thread.
7915         The main thread is not special anymore.
7917         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
7918         size of the stacks to stack_cache_actsize.
7920         * pt-readv.c: Add missing "defined".
7921         * pt-sigwait.c: Likewise.
7922         * pt-writev.c: Likewise.
7924 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
7926         * Versions: Export __connect from libpthread.
7927         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7929         * Makefile (libpthread-routines): Add pt-raise.
7930         * sysdeps/unix/sysv/linux/raise.c: New file.
7931         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
7932         * sysdeps/generic/pt-raise.c: New file.
7934         * pthread_cond_init.c: Initialize all data elements of the condvar
7935         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7937         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
7938         * pthread_create.c: Likewise.
7940         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
7941         * tst-key1.c: New file.
7942         * tst-key2.c: New file.
7943         * tst-key3.c: New file.
7945         * Versions: Export pthread_detach for version GLIBC_2.0.
7946         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
7948 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
7950         * pthread_key_create.c: Terminate search after an unused key was found.
7951         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7953         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
7954         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7956 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
7958         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
7959         dynamic lookup for errno in PIC.
7961         * allocatestack.c (get_cached_stack): Rearrange code slightly to
7962         release the stack lock as soon as possible.
7963         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
7964         the static TLS block.
7965         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
7967         * cancellation.c: Renamed from cancelation.c.
7968         * Makefile: Adjust accordingly.
7969         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
7970         * cleanup_defer.c: Use CANCELLATION_P.
7971         * pthread_testcancel.c: Likewise.
7972         * descr.h: Fix spelling in comments.
7973         * init.c: Likewise.
7974         * pthread_getattr_np.c: Likewise.
7975         * pthread_getschedparam.c: Likewise.
7976         * pthread_setschedparam.c: Likewise.
7977         * Versions: Likewise.
7979         * pt-pselect.c: New file.
7980         * Makefile (libpthread-routines): Add pt-pselect.
7981         * Versions: Add pselect.
7983         * tst-cancel4.c: New file.
7984         * Makefile (tests): Add tst-cancel4.
7986 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
7988         * pthread_mutex_lock.c: Always record lock ownership.
7989         * pthread_mutex_timedlock.c: Likewise.
7990         * pthread_mutex_trylock.c: Likewise.
7992         * pt-readv.c: New file.
7993         * pt-writev.c: New file.
7994         * pt-creat.c: New file.
7995         * pt-msgrcv.c: New file.
7996         * pt-msgsnd.c: New file.
7997         * pt-poll.c: New file.
7998         * pt-select.c: New file.
7999         * pt-sigpause.c: New file.
8000         * pt-sigsuspend.c: New file.
8001         * pt-sigwait.c: New file.
8002         * pt-sigwaitinfo.c: New file.
8003         * pt-waitid.c: New file.
8004         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
8005         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
8006         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
8007         * Versions: Add all the new functions.
8009         * tst-exit1.c: New file.
8010         * Makefile (tests): Add tst-exit1.
8012         * sem_timedwait.c: Minor optimization for more optimal fastpath.
8014 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
8016         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
8018         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
8019         call.  pthread_join is an official cancellation point.
8020         * pthread_timedjoin.c: Likewise.
8022         * pthread_cond_wait.c: Revert order in which internal lock are dropped
8023         and the condvar's mutex are retrieved.
8024         * pthread_cond_timedwait.c: Likewise.
8025         Reported by dice@saros.East.Sun.COM.
8027 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
8029         * pthreadP.h: Cut out all type definitions and move them...
8030         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
8031         * pthreadP.h: Include <internaltypes.h>.
8033         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
8034         performance tweaks.
8036         * sem_trywait.c: Shuffle #includes around to get right order.
8037         * sem_timedwait.c: Likewise.
8038         * sem_post.c: Likewise.
8039         * sem_wait.c: Likewise.
8041         * nptl 0.3 released.
8043         * Makefile (tests): Add tst-signal3.
8044         * tst-signal3.c: New file.
8046 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
8048         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
8049         the asms modify the sem object.
8050         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
8052         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
8053         the actual members.
8054         * pthreadP.h (struct sem): New type.  Actual semaphore type.
8055         * semaphoreP.h: Include pthreadP.h.
8056         * sem_getvalue.c: Adjust to sem_t change.
8057         * sem_init.c: Likewise.
8058         * sem_open.c: Likewise.
8059         * sem_post.c: Likewise.
8060         * sem_timedwait.c: Likewise.
8061         * sem_trywait.c: Likewise.
8062         * sem_wait.c: Likewise.
8064 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
8066         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
8067         * tst-basic2.c: New file.
8068         * tst-exec1.c: New file.
8069         * tst-exec2.c: New file.
8070         * tst-exec3.c: New file.
8072         * tst-fork1.c: Remove extra */.
8074         * nptl 0.2 released.  The API for IA-32 is complete.