[BZ #2644]
[glibc.git] / nptl / ChangeLog
blob66e17e4b854b90df8cbfb8af2fc8f19aac0d677c
1 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
3         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure
4         functions pointer is reloaded after pthread_cancel_init calls.
6         [BZ #2644]
7         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
8         pointers are reloaded after pthread_cancel_init calls.
10 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
12         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
13         __always_inline.
15 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
17         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
18         Allocate new object which is passed to timer_sigev_thread so that
19         the timer can be deleted before the new thread is scheduled.
21 2006-04-26  Roland McGrath  <roland@redhat.com>
23         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
25 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
27         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
28         suffix for conditional jumps.
29         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
30         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
31         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
32         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
33         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
34         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
36         * init.c (sigcancel_handler): Compare with correct PID even if the
37         thread is in the middle of a fork call.
38         (sighandler_setxid): Likewise.
39         Reported by Suzuki K P <suzuki@in.ibm.com> .
41 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
43         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
45 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
47         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
48         fails [Coverity CID 105].
50 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
52         * sysdeps/pthread/pthread.h: Add nonnull attributes.
54 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
56         [BZ #2505]
57         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
58         Define __lll_rel_instr using lwsync.
60 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
62         * allocatestack.c (allocate_stack): Always initialize robust_head.
63         * descr.h: Define struct robust_list_head.
64         (struct pthread): Use robust_list_head in robust mutex list definition.
65         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
66         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
67         (__pthread_initialize_minimal_internal): Register robust_list with
68         the kernel.
69         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
70         Declare __set_robust_list_avail.
71         * pthread_create.c (start_thread): Register robust_list of new thread.
72         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
73         waiters.
74         * pthread_mutex_destroy.c: For robust mutexes don't look at the
75         number of users, it's unreliable.
76         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
77         set_robust_list syscall is available.
78         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
79         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
80         Set robust_head.list_op_pending before trying to lock a robust mutex.
81         * pthread_mutex_timedlock.c: Likewise.
82         * pthread_mutex_trylock.c: Likewise.
83         * pthread_mutex_unlock.c: Likewise for unlocking.
84         * Makefile (tests): Add tst-robust8.
85         * tst-robust8.c: New file.
87 2006-03-08  Andreas Schwab  <schwab@suse.de>
89         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
90         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
92 2006-03-05  Roland McGrath  <roland@redhat.com>
94         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
95         and $config_os doesn't match *linux*.
97 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
99         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
100         Use __syscall_error.
101         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
102         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
103         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
104         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
105         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
106         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
108 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
110         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
112 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
114         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
115         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
116         mutex.
117         (__lll_robust_timedlock_wait): Likewise.
118         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
119         (__lll_robust_lock_wait): Likewise.
120         (__lll_robust_timedlock_wait): Likewise.
121         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
122         (__lll_robust_lock_wait): Likewise.
123         (__lll_robust_timedlock_wait): Likewise.
125 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
127         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
128         lll_robust_mutex_trylock, lll_robust_mutex_lock,
129         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
130         lll_robust_mutex_unlock): Define.
131         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
133 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
135         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
136         instead of <clone.S>.
138 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
140         * Makefile (libpthread-routines): Add
141         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
142         and pthread_mutex_[sg]etprioceiling.
143         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
144         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
145         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
146         pthread_mutex_setprioceiling.
147         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
148         PTHREAD_PRIO_PROTECT): New enum values.
149         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
150         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
151         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
152         prototypes.
153         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
154         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
155         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
156         Define.
157         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
158         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
159         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
160         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
161         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
162         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
163         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
164         protocol mutexes.
165         * pthread_mutex_getprioceiling.c: New file.
166         * pthread_mutex_setprioceiling.c: New file.
167         * pthread_mutexattr_getprioceiling.c: New file.
168         * pthread_mutexattr_setprioceiling.c: New file.
169         * pthread_mutexattr_getprotocol.c: New file.
170         * pthread_mutexattr_setprotocol.c: New file.
172 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
174         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
176 2006-02-27  Roland McGrath  <roland@redhat.com>
178         * sysdeps/pthread/Subdirs: List nptl here too.
179         * configure (libc_add_on_canonical): New variable.
181         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
183         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
184         self to get main source tree's file.
185         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
186         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
187         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
188         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
189         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
190         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
191         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
192         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
193         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
194         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
195         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
196         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
197         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
199         * Makefile: Use $(sysdirs) in vpath directive.
201         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
202         (CPPFLAGS-timer_routines.c): Likewise.
204         * Makeconfig (includes): Variable removed.
206 2006-02-26  Roland McGrath  <roland@redhat.com>
208         * sysdeps/generic/pt-raise.c: Moved to ...
209         * pt-raise.c: ... here.
210         * sysdeps/generic/lowlevellock.h: Moved to ...
211         * lowlevellock.h: ... here.
213 2006-02-23  Roland McGrath  <roland@redhat.com>
215         * descr.h (struct pthread): Add final member `end_padding'.
216         (PTHREAD_STRUCT_END_PADDING): Use it.
218 2006-02-20  Roland McGrath  <roland@redhat.com>
220         * sysdeps/mips: Directory removed, saved in ports repository.
221         * sysdeps/unix/sysv/linux/mips: Likewise.
223 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
225         * tst-robust1.c: Add second mutex to check that the mutex list is
226         handled correctly.
228 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
230         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
231         lll_robust_mutex_trylock, lll_robust_mutex_lock,
232         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
233         lll_robust_mutex_unlock): New macros.
234         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
235         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
236         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
237         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
238         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
240 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
242         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
243         definitions.
244         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
246 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
248         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
249         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
250         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
251         (lll_robust_mutex_unlock): Likewise.
253 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
255         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
256         Set robust_list.__next rather than robust_list.
257         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
258         (__pthread_list_t): New typedef.
259         (pthread_mutex_t): Replace __next and __prev fields with __list.
260         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
261         (__pthread_list_t): New typedef.
262         (pthread_mutex_t): Replace __next and __prev fields with __list.
263         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
264         (__pthread_list_t, __pthread_slist_t): New typedefs.
265         (pthread_mutex_t): Replace __next and __prev fields with __list.
266         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
267         (__pthread_list_t, __pthread_slist_t): New typedefs.
268         (pthread_mutex_t): Replace __next and __prev fields with __list.
269         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
270         (__pthread_list_t, __pthread_slist_t): New typedefs.
271         (pthread_mutex_t): Replace __next and __prev fields with __list.
272         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
273         (__pthread_slist_t): New typedef.
274         (pthread_mutex_t): Replace __next field with __list.
276 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
278         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
279         PTHREAD_MUTEX_OWNERDEAD.
280         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
281         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
282         * Makefile (libpthread-routines): Add lowlevelrobustlock.
283         * pthread_create.c (start_thread): Very much simplify robust_list loop.
284         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
285         to PTHREAD_MUTEX_INCONSISTENT.
286         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
287         * pthread_mutex_lock.c: Reimplement robust mutex handling.
288         * pthread_mutex_trylock.c: Likewise.
289         * pthread_mutex_timedlock.c: Likewise.
290         * pthread_mutex_unlock.c: Likewise.
291         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
292         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
293         lowlevelrobustlock.sym.
294         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
295         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
296         definitions.
297         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
298         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
299         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
300         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
301         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
303 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
305         * allocatestack.c (allocate_stack): Initialize robust_list.
306         * init.c (__pthread_initialize_minimal_internal): Likewise.
307         * descr.h (struct xid_command): Pretty printing.
308         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
309         robust_list.  Adjust macros.
310         * pthread_create.c (start_thread): Adjust robust_list handling.
311         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
312         but the owner for all robust mutex types.
313         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
314         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
315         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
316         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
318         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
319         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
321 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
323         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
324         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
326 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
328         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
329         Return status.
330         (lll_futex_timed_wait): Define.
332 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
334         * tst-cancel4.c: Test ppoll.
336 2006-01-18  Andreas Jaeger  <aj@suse.de>
338         [BZ #2167]
339         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
340         (pthread_mutex_t): Follow changes for other archs.  Based on patch
341         by Jim Gifford <patches@jg555.com>.
343 2006-01-13  Richard Henderson  <rth@redhat.com>
345         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
347 2006-01-10  Roland McGrath  <roland@redhat.com>
349         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
350         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
351         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
352         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
353         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
354         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
355         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
356         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
357         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
358         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
360 2006-01-09  Roland McGrath  <roland@redhat.com>
362         * tst-initializers1-c89.c: New file.
363         * tst-initializers1-c99.c: New file.
364         * tst-initializers1-gnu89.c: New file.
365         * tst-initializers1-gnu99.c: New file.
366         * Makefile (tests): Add them.
367         (CFLAGS-tst-initializers1-c89.c): New variable.
368         (CFLAGS-tst-initializers1-c99.c): New variable.
369         (CFLAGS-tst-initializers1-gnu89.c): New variable.
370         (CFLAGS-tst-initializers1-gnu99.c): New variable.
372         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
373         Use __extension__ on anonymous union definition.
374         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
375         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
376         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
377         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
378         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
380 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
382         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
383         Don't give the union a name because it changes the mangled name.
384         Instead name the struct for __data.
385         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
386         Likewise.
387         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
388         Likewise.
390 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
392         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
393         stack bias to mc_ftp field.
395 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
397         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
398         being too clever and reloading the futex value where it shouldn't.
400 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
402         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
403         correct type.
405 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
407         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
408         Add cfi directives.
410 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
412         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
413         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
414         rename in tcbhead_t.
416         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
417         Don't give the union a name because it changes the mangled name.
418         Instead name the struct for __data.
419         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
420         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
421         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
422         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
423         * pthread_create.c (start_thread): Adjust robust mutex free loop.
424         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
426 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
428         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
429         Return status.
430         (lll_futex_timed_wait): Define.
431         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
432         * sysdeps/pthread/aio_misc.h: New file.
434 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
436         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
438 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
440         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
441         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
442         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
444 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
446         * tst-cancel24.cc: Use C headers instead of C++ headers.
448 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
450         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
451         sparc-linux configured glibc.
452         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
453         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
454         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
455         atomic_compare_and_exchange_val_24_acq instead of
456         atomic_compare_and_exchange_val_acq.
457         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
458         instead of atomic_exchange_rel.
459         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
460         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
461         file.
462         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
463         file.
464         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
465         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
466         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
467         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
468         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
469         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
470         New file.
471         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
472         New file.
473         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
474         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
475         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
476         file.
477         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
478         file.
479         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
481 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
483         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
484         mutex initializers.
486 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
488         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
489         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
490         THREAD_COPY_POINTER_GUARD): Define.
491         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
492         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
494 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
496         * version.c: Update copyright year.
498 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
500         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
501         .eh_frame section, use cfi_* directives.
502         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
504 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
506         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
507         now.
509 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
511         * sysdeps/pthread/sigaction.c: Removed.
512         * sigaction.c: New file.
513         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
515 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
517         * Makefile (tests): Add tst-signal7.
518         * tst-signal7.c: New file.
520 2005-12-27  Roland McGrath  <roland@redhat.com>
522         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
523         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
524         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
525         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
526         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
527         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
528         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
529         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
530         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
531         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
532         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
534 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
536         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
537         and __prev field to pthread_mutex_t.
538         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
539         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
540         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
541         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
542         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
543         to pthread_mutex_t.
545 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
547         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
548         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
549         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
550         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
551         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
552         and PTHREAD_MUTEXATTR_FLAG_BITS.
553         * descr.h (struct pthread): Add robust_list field and define
554         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
555         * pthread_mutexattr_getrobust.c: New file.
556         * pthread_mutexattr_setrobust.c: New file.
557         * pthread_mutex_consistent.c: New file.
558         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
559         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
560         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
561         Adjust pthread_mutex_t initializers.
562         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
563         field to pthread_mutex_t.
564         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
565         and __prev field to pthread_mutex_t.
566         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
567         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
568         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
569         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
570         * pthread_mutexattr_gettype.c: Likewise.
571         * pthread_mutexattr_setpshared.c: Likewise.
572         * pthread_mutexattr_settype.c: Likewise.
573         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
574         Initialize mutex kind according to robust flag.
575         * pthread_mutex_lock.c: Implement local robust mutex.
576         * pthread_mutex_timedlock.c: Likewise.
577         * pthread_mutex_trylock.c: Likewise.
578         * pthread_mutex_unlock.c: Likewise.
579         * pthread_create.c (start_thread): Mark robust mutexes which remained
580         locked as dead.
581         * tst-robust1.c: New file.
582         * tst-robust2.c: New file.
583         * tst-robust3.c: New file.
584         * tst-robust4.c: New file.
585         * tst-robust5.c: New file.
586         * tst-robust6.c: New file.
587         * tst-robust7.c: New file.
588         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
589         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
590         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
591         tst-robust5, tst-robust6, and tst-robust7.
593         * tst-typesizes.c: New file.
594         * Makefile (tests): Add tst-typesizes.
596         * tst-once3.c: More debug output.
598 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
600         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
601         missing after last change.
603         * version.c: Update copyright year.
605 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
607         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
608         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
609         * pthread_mutex_trylock.c: Likewise.
610         * pthread_mutex_timedlock.c: Likewise.
611         * pthread_mutex_unlock.c: Likewise.
613 2005-12-22  Roland McGrath  <roland@redhat.com>
615         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
616         so that #include_next's search location is not reset to the -I..
617         directory where <nptl/...> can be found.
619 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
621         [BZ #1913]
622         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
623         Fix unwind info.  Remove useless branch prediction prefix.
624         * tst-cancel24.cc: New file.
625         * Makefile: Add rules to build and run tst-cancel24.
627 2005-12-21  Roland McGrath  <roland@redhat.com>
629         * libc-cancellation.c: Use <> rather than "" #includes.
630         * pt-cleanup.c: Likewise.
631         * pthread_create.c: Likewise.
632         * pthread_join.c: Likewise.
633         * pthread_timedjoin.c: Likewise.
634         * pthread_tryjoin.c: Likewise.
635         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
636         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
637         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
638         * unwind.c: Likewise.
640 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
642         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
643         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
644         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
645         THREAD_COPY_POINTER_GUARD): Define.
647 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
649         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
650         rather than one.
651         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
652         THREAD_COPY_POINTER_GUARD): Define.
653         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
654         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
655         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
656         THREAD_COPY_POINTER_GUARD): Define.
657         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
658         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
659         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
660         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
661         Use PTR_DEMANGLE for B0 if defined.
663 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
665         * pthread_create.c (__pthread_create_2_1): Use
666         THREAD_COPY_POINTER_GUARD if available.
667         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
668         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
669         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
670         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
671         * sysdeps/x86_64/tls.h: Likewise.
673 2005-12-15  Roland McGrath  <roland@redhat.com>
675         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
677 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
679         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
680         sysdeps/generic.
681         * errno-loc.c: New file.
683 2005-12-12  Roland McGrath  <roland@redhat.com>
685         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
686         adjustments before choosing stack size.  Update minimum stack size
687         calculation to match allocate_stack change.
689 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
691         * allocatestack.c (allocate_stack): Don't demand that there is an
692         additional full page available on the stack beside guard, TLS, the
693         minimum stack.
695 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
697         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
698         (__cleanup_fct_attribute): Use __regparm__ not regparm.
700         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
701         compiling 32-bit code we must define __cleanup_fct_attribute.
703 005-11-24  Jakub Jelinek  <jakub@redhat.com>
705         [BZ #1920]
706         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
707         __attribute__ instead of __attribute.
708         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
709         (__cleanup_fct_attribute): Likewise.
711 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
713         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
714         a write barrier before writing libgcc_s_getcfa.
716 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
718         * sysdeps/unix/sysv/linux/configure: Removed.
720 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
722         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
723         optional init_array/fini_array support.
725 2005-10-24  Roland McGrath  <roland@redhat.com>
727         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
728         versioned_symbol use.
730 2005-10-16  Roland McGrath  <roland@redhat.com>
732         * init.c (__pthread_initialize_minimal_internal): Even when using a
733         compile-time default stack size, apply the minimum that allocate_stack
734         will require, and round up to page size.
736 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
738         * Makefile ($(test-modules)): Remove static pattern rule.
740 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
741             Ulrich Drepper  <drepper@redhat.com>
743         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
744         alignment in callback function.
745         * Makefile: Add rules to build and run tst-align3.
746         * tst-align3.c: New file.
748 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
750         * allocatestack.c (setxid_signal_thread): Add
751         INTERNAL_SYSCALL_DECL (err).
753 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
755         * allocatestack.c (setxid_signal_thread): Need to use
756         atomic_compare_and_exchange_bool_acq.
758 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
759             Jakub Jelinek  <jakub@redhat.com>
761         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
762         CANCEL_RESTMASK.
763         (struct pthread): Move specific_used field to avoid padding.
764         Add setxid_futex field.
765         * init.c (sighandler_setxid): Reset setxid flag and release the
766         setxid futex.
767         * allocatestack.c (setxid_signal_thread): New function.  Broken
768         out of the bodies of the two loops in __nptl_setxid.  For undetached
769         threads check whether they are exiting and if yes, don't send a signal.
770         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
771         * pthread_create.c (start_thread): For undetached threads, check
772         whether setxid bit is set.  If yes, wait until signal has been
773         processed.
775         * allocatestack.c (STACK_VARIABLES): Initialize them.
776         * pthread_create.c (__pthread_create_2_1): Initialize pd.
778 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
780         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
781         waiters, awake all waiters on the associated mutex.
783 2005-09-22  Roland McGrath  <roland@redhat.com>
785         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
786         ../sysdeps/x86_64/hp-timing.h).
788 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
790         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
791         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
792         (lll_futex_wake_unlock): Define.
793         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
794         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
795         (lll_futex_wake_unlock): Define.
796         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
797         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
798         (lll_futex_wake_unlock): Define.
799         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
800         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
801         (lll_futex_wake_unlock): Define.
802         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
803         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
804         (lll_futex_wake_unlock): Define.
805         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
806         lll_futex_wake_unlock.
807         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
808         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
809         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
810         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
811         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
812         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
814 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
816         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
817         Fix typo in register name.
819 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
821         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
822         Use __sigfillset.  Document that sigfillset does the right thing wrt
823         to SIGSETXID.
825 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
827         [BZ #1102]
828         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
829         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
830         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
831         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
832         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
833         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
834         in the structure.
835         * Makefile (tests): Add tst-initializers1.
836         (CFLAGS-tst-initializers1.c): Set.
837         * tst-initializers1.c: New test.
839 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
841         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
842         Make sure __flags are located at offset 48 from the start of the
843         structure.
845 2005-07-02  Roland McGrath  <roland@redhat.com>
847         * Makeconfig: Comment fix.
849 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
851         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
852         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
853         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
854         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
855         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
856         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
857         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
858         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
859         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
860         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
862 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
864         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
865         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
866         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
867         fields.
868         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
869         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
870         field.  Put in sysinfo field unconditionally.
871         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
872         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
873         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
874         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
875         fields.
876         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
877         * pthread_create.c (__pthread_create_2_1): Use
878         THREAD_COPY_STACK_GUARD macro.
879         * Makefile: Add rules to build and run tst-stackguard1{,-static}
880         tests.
881         * tst-stackguard1.c: New file.
882         * tst-stackguard1-static.c: New file.
884 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
886         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
887         Invoke CGOTSETUP and CGOTRESTORE.
888         (CGOTSETUP, CGOTRESTORE): Define.
890 2005-05-29  Richard Henderson  <rth@redhat.com>
892         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
893         (tf_write, tf_writev): Use it.
894         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
895         the system minimum.
897 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
899         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
900         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
901         __librt_*_asynccancel@local.
903 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
905         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
906         all occurrences of JUMPTARGET.  Instead append @local to labels.
908 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
910         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
911         size/alignment of struct pthread rather than tcbhead_t.
912         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
913         Likewise.
914         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
915         Likewise.
916         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
917         Likewise.
919 2005-05-19  Richard Henderson  <rth@redhat.com>
921         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
922         __sync_val_compare_and_swap, not explicit _si variant.
923         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
925 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
927         [BZ #915]
928         * sysdeps/pthread/pthread.h: Avoid empty initializers.
930 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
932         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
933         .eh_frame section, use cfi_* directives.
935 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
937         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
938         of "" includes.
940 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
942         [BZ #1075]
943         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
944         aio_write blocks.
946 2005-04-27  Roland McGrath  <roland@redhat.com>
948         * Makefile (tests): Remove tst-clock2.
950         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
951         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
952         translating to the kernel clockid_t for our own process/thread clock.
954         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
956 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
958         * old_pthread_cond_init.c: Include <errno.h>.
959         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
960         process shared or uses clock other than CLOCK_REALTIME.
961         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
963 2005-04-13  David S. Miller  <davem@davemloft.net>
965         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
966         * sysdeps/sparc/sparc64/clone.S: New file.
968 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
970         [BZ #1102]
971         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
972         __inline instead of inline.
973         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
975 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
977         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
978         functionally equivalent, but shorter instructions.
979         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
980         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
981         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
982         Likewise.
983         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
984         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
985         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
986         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
987         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
988         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
989         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
990         Likewise.
991         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
992         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
993         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
994         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
995         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
997 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
999         * sysdeps/mips/Makefile: New file.
1000         * sysdeps/mips/nptl-sysdep.S: New file.
1001         * sysdeps/mips/tcb-offsets.sym: New file.
1002         * sysdeps/mips/pthread_spin_lock.S: New file.
1003         * sysdeps/mips/pthread_spin_trylock.S: New file.
1004         * sysdeps/mips/pthreaddef.h: New file.
1005         * sysdeps/mips/tls.h: New file.
1006         * sysdeps/mips/jmpbuf-unwind.h: New file.
1007         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
1008         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
1009         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
1010         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
1011         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
1012         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
1013         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
1014         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
1015         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
1016         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
1018 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
1020         [BZ #1112]
1021         * pthread_create.c (__pthread_create_2_1): Rename syscall error
1022         variable to scerr.
1024 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
1026         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
1028 2005-02-25  Roland McGrath  <roland@redhat.com>
1030         * alloca_cutoff.c: Correct license text.
1031         * tst-unload.c: Likewise.
1032         * sysdeps/pthread/allocalim.h: Likewise.
1033         * sysdeps/pthread/pt-initfini.c: Likewise.
1034         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1035         * sysdeps/pthread/bits/sigthread.h: Likewise.
1036         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
1037         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
1039 2005-02-16  Roland McGrath  <roland@redhat.com>
1041         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1042         Use unsigned int * for ptr_nthreads.
1044 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
1046         [BZ #721]
1047         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
1048         gcc4.
1050 2005-02-07  Richard Henderson  <rth@redhat.com>
1052         [BZ #787]
1053         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
1054         argument.
1056 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
1058         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
1059         order of arguments in invocation of atomic_add_zero.
1061 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
1063         [BZ #737]
1064         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
1065         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
1066         at least gotntpoff relocation and addition.
1067         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1068         Likewise.
1069         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
1070         Likewise.
1071         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
1072         Likewise.
1074 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
1076         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
1077         entry for static tls deallocation fix.
1078         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
1079         also contains information whether the memory pointed to is static
1080         TLS or not.
1081         * sysdeps/i386/tls.h: Likewise.
1082         * sysdeps/ia64/tls.h: Likewise.
1083         * sysdeps/powerpc/tls.h: Likewise.
1084         * sysdeps/s390/tls.h: Likewise.
1085         * sysdeps/sh/tls.h: Likewise.
1086         * sysdeps/sparc/tls.h: Likewise.
1087         * sysdeps/x86_64/tls.h: Likewise.
1089 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
1091         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
1093 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
1095         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
1096         %esp.
1097         * Makefile (tests): Add tst-align2.
1098         * tst-align2.c: New test.
1099         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
1100         -mpreferred-stack-boundary=4.
1102 2004-12-18  Roland McGrath  <roland@redhat.com>
1104         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
1105         New file removed withdrawn for the moment.
1107 2004-12-17  Richard Henderson  <rth@redhat.com>
1109         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
1110         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
1112 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
1114         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
1115         Increased PTHREAD_STACK_MIN.
1117         * tst-context1.c (stacks): Use bigger stack size.
1119 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
1121         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
1122         * sysdeps/sparc/tcb-offsets.sym: Add TID.
1124 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
1126         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
1127         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
1128         * sysdeps/s390/tcb-offsets.sym (TID): Add.
1130 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
1132         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
1134 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
1136         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
1137         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
1139         * tst-getpid1.c: If child crashes, report this first.  Print which
1140         signal.
1142 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
1144         * init.c (__pthread_initialize_minimal_internal): Also unblock
1145         SIGSETXID.
1147 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
1149         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
1150         _POSIX_THREAD_CPUTIME): Define to 0.
1151         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
1152         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
1153         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
1154         __timer_signal_thread_tclk): Remove.
1155         (init_module): Remove their initialization.
1156         (thread_cleanup): Remove their cleanup assertions.
1157         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
1158         __timer_signal_thread_tclk): Remove.
1159         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
1160         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
1161         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
1163 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
1165         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
1166         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
1168         * Makefile (tests): Add tst-getpid2.
1169         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
1170         (do_test): Use it.  Use __clone2 instead of clone on ia64.
1171         * tst-getpid2.c: New test.
1173 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1175         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
1177 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
1179         * Makefile (tests): Add tst-getpid1.
1180         * tst-getpid1.c: New file.
1181         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
1182         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
1184 2004-12-02  Roland McGrath  <roland@redhat.com>
1186         * Makefile (libpthread-nonshared): Variable removed.
1187         ($(objpfx)libpthread_nonshared.a): Target removed.
1188         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
1189         These are now handled by generic magic from
1190         libpthread-static-only-routines being set.
1192 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
1194         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
1195         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
1196         _POSIX_THREAD_PRIO_PROTECT): Define.
1197         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1198         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1199         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1201 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
1203         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
1204         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
1205         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
1206         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
1207         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1208         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1209         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1211 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
1213         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
1215         * Makefile (libpthread-routines): Add pthread_setschedprio.
1216         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
1217         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
1218         * pthread_setschedprio.c: New file.
1220 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
1222         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
1223         * pthread_cancel.c (pthread_create): Likewise.
1225         * Makefile (libpthread-routines): Add vars.
1226         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
1227         * init.c (__default_stacksize, __is_smp): Remove.
1228         * vars.c: New file.
1229         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
1230         and define a wrapper macro.
1231         (PTHREAD_STATIC_FN_REQUIRE): Define.
1232         * allocatestack.c (__find_thread_by_id): Undefine.
1233         * pthread_create (__pthread_keys): Remove.
1234         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
1235         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
1236         PTHREAD_STATIC_FN_REQUIRE.
1238 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1240         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
1241         parameter to REGISTER macro.
1243 2004-11-17  Roland McGrath  <roland@redhat.com>
1245         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
1246         Make sure SIGCANCEL is blocked as well.
1248 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
1250         * sysdeps/pthread/setxid.h: New file.
1251         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
1252         (struct xid_command): Add forward decl.
1253         (struct pthread_functions): Change return type of __nptl_setxid hook
1254         to int.
1255         * pthreadP.h (__nptl_setxid): Change return type to int.
1256         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
1257         calling thread, return its return value and set errno on failure.
1258         * descr.h (struct xid_command): Change id type to long array.
1260         * Makefile: Add rules to build and test tst-setuid1 and
1261         tst-setuid1-static.
1262         * tst-setuid1.c: New test.
1263         * tst-setuid1-static.c: New test.
1265 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
1267         * Makefile (tests): Add tst-exit3.
1268         * tst-exit3.c: New test.
1270 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
1272         * Makefile (tests): Add tst-exit2.
1273         * tst-exit2.c: New file.
1275 2004-11-09  Roland McGrath  <roland@redhat.com>
1277         [BZ #530]
1278         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
1279         here, before calling clone.
1280         * pthread_create.c (start_thread): Don't do it here.
1282 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
1284         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
1286 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
1288         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1289         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
1290         assembler warning.
1292 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
1294         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
1295         if sched_priority is not between minprio and maxprio.
1297 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1299         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1300         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
1302         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1303         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
1305 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
1307         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
1308         not-cancelable I/O functions.
1310 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1312         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1313         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
1314         make sure 2 is stored in the futex and we looked at the old value.
1315         Fix a few other problems to return the correct value.
1317 2004-10-14  Richard Henderson  <rth@redhat.com>
1319         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
1320         make gcc4 happy.
1322 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
1324         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
1325         of pthread-functions.h and pthreaddef.h.
1326         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
1328         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1329         Change __data.__nwaiters from int to unsigned int.
1331         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
1332         sysconf (_SC_THREAD_CPUTIME) returns negative value.
1334         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
1335         before return type.
1337         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
1338         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
1340 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
1342         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
1343         test fails, remove message queue.
1344         (tf_msgsnd): Likewise.
1346 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
1348         * tst-clock1.c: Change #ifdef to #if defined.
1349         * tst-clock2.c: Likewise.
1350         * tst-cond11.c: Likewise.
1352         * sysdeps/pthread/timer_create.c (timer_create): Use
1353         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
1354         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
1355         THREAD_CPUTIME.
1357 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
1359         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
1360         _POSIX_THREAD_CPUTIME): Define to 0.
1362 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
1364         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
1365         and _POSIX_THREAD_CPUTIME to zero.
1366         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1367         * tst-barrier2.c: Fix testing for POSIX feature.
1368         * tst-clock1.c: Likewise.
1369         * tst-clock2.c: Likewise.
1370         * tst-cond11.c: Likewise.
1371         * tst-cond4.c: Likewise.
1372         * tst-cond6.c: Likewise.
1373         * tst-flock2.c: Likewise.
1374         * tst-mutex4.c: Likewise.
1375         * tst-mutex9.c: Likewise.
1376         * tst-rwlock12.c: Likewise.
1377         * tst-rwlock4.c: Likewise.
1378         * tst-signal1.c: Likewise.
1379         * tst-spin2.c: Likewise.
1380         * sysdeps/pthread/posix-timer.h: Likewise.
1381         * sysdeps/pthread/timer_create.c: Likewise.
1382         * sysdeps/pthread/timer_routines.c: Likewise.
1384 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
1386         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1387         (__lll_mutex_timedlock_wait): Address futex correctly.
1389         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1390         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
1391         make sure 2 is stored in the futex and we looked at the old value.
1392         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1393         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
1394         which might very well made the code not working at all before.
1395         [BZ #417]
1397 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
1399         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
1400         allow SIGSETXID to be sent.
1401         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
1402         for SIGSETXID to be defined.
1403         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
1404         SIGSETXID cannot be blocked.
1406         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1407         Add __extension__ to long long types.
1408         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1409         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1410         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1411         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1412         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1413         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1414         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1416 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
1418         * descr.h (struct pthread): Add stopped_start field.
1419         * sysdeps/pthread/createthread.c (create_thread): Set
1420         start_stopped flag in descriptor for new thread appropriately.
1421         * pthread_create.c (start_thread): Only take lock to be stopped on
1422         startup if stopped_start flag says so.
1424 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
1426         * pthread_create.c (__pthread_create_2_1): Remember whether thread
1427         is created detached and if yes, do not try to free the stack in case
1428         the thread creation failed.
1429         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
1430         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
1431         case there has been no error.  [BZ #405]
1433         * pthread_create.c (start_thread): Don't wait for scheduler data
1434         etc to be set at the beginning of the function.  The cancellation
1435         infrastructure must have been set up.  And enable async
1436         cancellation before potentially going to sleep.  [BZ #401]
1438 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
1440         * Versions: Remove exports for pthread_set*id_np functions.
1441         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
1442         for now.
1443         * Makefile: Don't build pthread_set*id code for now.
1445 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
1447         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
1448         internal use.
1449         * allocatestack.c (__nptl_setxid): New function.
1450         * descr.h (struct xid_command): Define type.
1451         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
1452         (sighandler_setxid): New function.
1453         (__pthread_initialize_minimal): Register sighandler_setxid for
1454         SIGCANCEL.
1455         * pt-allocrtsig.c: Update comment.
1456         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
1457         Declare __nptl_setxid.
1458         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
1459         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
1460         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1461         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1462         and pthread_setresuid_np.
1463         * pthread_setgid_np.c: New file.
1464         * pthread_setuid_np.c: New file.
1465         * pthread_setegid_np.c: New file.
1466         * pthread_seteuid_np.c: New file.
1467         * pthread_setregid_np.c: New file.
1468         * pthread_setreuid_np.c: New file.
1469         * pthread_setresgid_np.c: New file.
1470         * pthread_setresuid_np.c: New file.
1471         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
1472         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1473         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1474         and pthread_setresuid_np.
1475         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
1476         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
1477         pthread_setregid, and pthread_setresgid.
1479 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
1481         * allocatestack.c (allocate_stack): Return EAGAIN instead of
1482         ENOMEM when out of memory.
1484 2004-09-10  Roland McGrath  <roland@redhat.com>
1486         [BZ #379]
1487         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
1488         code, since we don't try to use the broken CLONE_STOPPED any more.
1489         * pthread_create.c (start_thread): Likewise.
1491 2004-09-15  Richard Henderson  <rth@redhat.com>
1493         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
1495 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
1497         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
1498         (__libc_unwind_longjmp): Delete macro and declare as function.
1499         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
1500         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
1501         nptl directory.
1502         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
1503         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
1504         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
1506 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
1508         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
1509         for __USE_XOPEN2K.
1510         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
1511         types also for __USE_XOPEN2K.
1512         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1513         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1514         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1515         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1516         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1517         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1518         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1519         [BZ #320]
1521 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
1523         * sysdeps/pthread/pthread.h
1524         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
1525         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
1526         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
1527         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
1528         [BZ #375]
1530 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
1532         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
1533         PSEUDO to be used with . prefix.
1535         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
1536         Use atomic_increment instead of atomic_exchange_and_add.
1537         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
1538         Likewise.
1539         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
1540         Likewise.
1541         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1542         Likewise.
1544         * allocatestack.c (allocate_stack): Use atomic_increment_val
1545         instead of atomic_exchange_and_add.
1546         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
1547         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1548         Likewise.
1549         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1550         Likewise.
1552         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
1553         the initialization function might throw.
1555 2005-09-05  Richard Henderson  <rth@redhat.com>
1557         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1558         Move definition inside libpthread, libc, librt check.  Provide
1559         definition for rtld.
1561 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
1563         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
1564         * sysdeps/i386/jmpbuf-unwind.h: Likewise
1565         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
1566         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
1567         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
1568         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
1569         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
1570         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
1571         * unwind.c: Use it.
1573         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1574         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
1575         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1576         Likewise.
1577         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1578         Decrement __nwaiters.  If pthread_cond_destroy has been called and
1579         this is the last waiter, signal pthread_cond_destroy caller and
1580         avoid using the pthread_cond_t structure after unlock.
1581         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1582         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1583         Read clock type from the least significant bits of __nwaiters instead
1584         of __clock.
1585         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1586         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
1588 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
1590         [BZ #342]
1591         * Makefile (tests): Add tst-cond20 and tst-cond21.
1592         * tst-cond20.c: New test.
1593         * tst-cond21.c: New test.
1594         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1595         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
1596         it unsigned int.
1597         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1598         Likewise.
1599         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1600         (pthread_cond_t): Likewise.
1601         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1602         Likewise.
1603         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1604         Likewise.
1605         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1606         Likewise.
1607         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
1608         (cond_nwaiters): New.
1609         (clock_bits): New.
1610         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
1611         if there are waiters not signalled yet.
1612         Wait until all already signalled waiters wake up.
1613         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
1614         __nwaiters.  If pthread_cond_destroy has been called and this is the
1615         last waiter, signal pthread_cond_destroy caller and avoid using
1616         the pthread_cond_t structure after unlock.
1617         (__pthread_cond_wait): Increment __nwaiters in the beginning,
1618         decrement it when leaving.  If pthread_cond_destroy has been called
1619         and this is the last waiter, signal pthread_cond_destroy caller.
1620         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1621         Likewise.  Read clock type from the least significant bits of
1622         __nwaiters instead of __clock.
1623         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
1624         whether clock ID can be encoded in COND_CLOCK_BITS bits.
1625         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
1626         clock type just from the last COND_CLOCK_BITS bits of value.
1627         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
1628         instead of __clock, just from second bit of condattr's value.
1630 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
1632         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
1633         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
1634         != 64.
1635         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1637 2004-08-15  Roland McGrath  <roland@frob.com>
1639         * pthread_atfork.c: Update copyright terms including special exception
1640         for these trivial files, which are statically linked into executables
1641         that use dynamic linking for the significant library code.
1643 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
1645         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
1646         pthread_rwlock_rdlock.
1647         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
1648         Decrease __nr_readers_queued after reacquiring lock.
1649         * sysdeps/pthread/pthread_rwlock_timedrdlock
1650         (pthread_rwlock_timedrdlock): Likewise.
1651         Reported by Bob Cook <bobcook47@hotmail.com>.
1653 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
1655         * tst-rwlock14.c (tf): Read main thread handle from *ARG
1656         before pthread_barrier_wait.
1658 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
1660         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1661         Remove unnecessary exception handling data.
1663 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
1665         [BZ #284]
1666         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
1667         instead of clockid_t.
1669 2004-07-21  Roland McGrath  <roland@redhat.com>
1671         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
1673 2004-07-19  Roland McGrath  <roland@redhat.com>
1675         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
1677 2004-07-02  Roland McGrath  <roland@redhat.com>
1679         * configure: Don't exit.
1681 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1683         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1684         (__pthread_cond_timedwait): Check for invalid nanosecond in
1685         timeout value.
1687 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
1689         * Makefile: Add rules to build and run tst-fini1.
1690         * tst-fini1.c: New file.
1691         * tst-fini1mod.c: New file.
1693 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
1695         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
1696         if no cancellation support is needed.
1697         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1698         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1699         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1700         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1701         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1702         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1703         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1704         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1705         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1707         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
1708         only if not already defined.
1710 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
1712         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
1713         constraint "m" instead of "0" for futex.
1715         * shlib-versions: Add powerpc64-.*-linux.*.
1717 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
1719         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
1720         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
1721         for valid tv_nsec.
1722         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
1723         1 billion and 64-bit tv_nsec which is valid when truncated to 32
1724         bits.
1726 2004-06-29  Roland McGrath  <roland@redhat.com>
1728         * Banner: NPTL no longer has its own version number.
1729         * Makefile (nptl-version): Variable removed.
1730         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
1731         using $(version), the glibc version number.
1733 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1735         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
1736         Fix branch offset for a PLT entry.
1737         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
1738         Likewise.
1739         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1740         Likewise.
1741         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
1742         Likewise.
1743         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
1744         Likewise.
1746 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1748         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
1749         unconditionally.
1751 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1753         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1754         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
1755         instead of tv_sec.
1756         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
1757         (pthread_rwlock_timedrdlock): Likewise.
1759 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
1761         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1762         Set __r7 to val, not mutex.
1764 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
1766         * Makefile: Add rules to build tst-rwlock14.
1767         * tst-rwlock14.c: New file.
1769 2004-06-24  Boris Hu  <boris.hu@intel.com>
1771         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
1772         check.
1773         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1775 2004-06-19  Andreas Jaeger  <aj@suse.de>
1777         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
1778         assembler in last patch.
1780 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
1782         * sysdeps/pthread/pthread_cond_timedwait.c
1783         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
1784         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1785         (__pthread_cond_timedwait): Check for invalid nanosecond in
1786         timeout value.
1787         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1788         * tst-cond19.c: New file.
1789         * Makefile: Add rules to build and run tst-cond19.
1791 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
1793         * tst-context1.c (GUARD_PATTERN): Defined.
1794         (tst_context_t): Define struct containing ucontext_t & guard words.
1795         (ctx): Declare as an array of tst_context_t.
1796         (fct): Verify uc_link & guard words are still valid.
1797         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
1799 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1801         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1802         Add __data.__futex field, reshuffle __data.__clock.
1803         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
1804         (__pthread_cond_signal): Increment __futex at the same time as
1805         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1806         address of low 32-bits of __wakeup_seq to futex syscall.
1807         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
1808         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1809         releasing internal lock to FUTEX_WAIT.
1810         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1811         (__pthread_cond_timedwait): Likewise.
1812         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1813         (FUTEX_CMP_REQUEUE): Define.
1814         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1815         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1816         Pass __futex value from before the unlock and __futex address instead
1817         of address of low 32-bits of __wakeup_seq to futex syscall.
1818         Fallback to FUTEX_WAKE all on any errors.
1820 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
1822         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
1823         comment typo.
1824         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
1825         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
1826         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
1827         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
1828         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
1830 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1832         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
1833         Add memory clobber to inline assembly.
1834         (__lll_mutex_trylock): Likewise.
1835         (__lll_mutex_cond_trylock): Likewise.
1837 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1839         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1840         Pass val argument as 6th system call argument in %r7.
1842 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1844         * Makefile (tests): Add tst-cond16.
1845         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
1846         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
1847         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1848         Add __data.__futex field, reshuffle __data.__clock.
1849         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
1850         (__pthread_cond_signal): Increment __futex at the same time as
1851         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1852         address of low 32-bits of __wakeup_seq to futex syscall.
1853         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
1854         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1855         releasing internal lock to FUTEX_WAIT.
1856         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
1857         (__pthread_cond_timedwait): Likewise.
1858         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
1859         (FUTEX_CMP_REQUEUE): Define.
1860         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1861         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1862         Pass __futex value from before the unlock and __futex address instead
1863         of address of low 32-bits of __wakeup_seq to futex syscall.
1864         Fallback to FUTEX_WAKE all on any errors.
1865         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
1866         Define.
1867         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1868         internally.  Return non-zero if error, zero if success.
1869         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1870         Add __data.__futex field, reshuffle __data.__clock.
1871         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
1872         Define.
1873         (lll_futex_requeue): Add val argument, return 1 unconditionally
1874         for the time being.
1875         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1876         Add __data.__futex field, reshuffle __data.__clock.
1877         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1878         Define.
1879         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1880         internally.  Return non-zero if error, zero if success.
1881         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1882         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
1883         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1884         Define.
1885         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1886         internally.  Return non-zero if error, zero if success.
1887         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1888         Add __data.__futex field, reshuffle __data.__clock.
1889         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
1890         Define.
1891         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1892         internally.  Return non-zero if error, zero if success.
1893         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1894         Add __data.__futex field, reshuffle __data.__clock.
1895         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1896         Add __data.__futex field, reshuffle __data.__clock.
1897         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
1898         Increment __futex at the same time as __wakeup_seq or __total_seq.
1899         Pass address of __futex instead of address of low 32-bits of
1900         __wakeup_seq to futex syscall.
1901         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1902         Pass __futex value from before releasing internal lock
1903         to FUTEX_WAIT.
1904         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1905         Likewise.  Avoid unnecessary shadowing of variables.
1906         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
1907         Set __futex to 2 * __total_seq.  Pass __futex value from before the
1908         unlock and __futex address instead of address of low 32-bits of
1909         __wakeup_seq to futex_requeue macro, adjust for new return value
1910         meaning.
1911         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1912         (__pthread_cond_signal): Increment __futex at the same time as
1913         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1914         address of low 32-bits of __wakeup_seq to futex syscall.
1915         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1916         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1917         releasing internal lock to FUTEX_WAIT.
1918         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1919         (__pthread_cond_timedwait): Likewise.
1920         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1921         (FUTEX_CMP_REQUEUE): Define.
1922         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1923         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1924         Pass __futex value from before the unlock and __futex address instead
1925         of address of low 32-bits of __wakeup_seq to futex syscall.
1926         Fallback to FUTEX_WAKE all on any errors.
1928 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1930         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
1931         Add nop to align the end of critical section.
1932         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
1934 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1936         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1937         Add __broadcast_seq field.
1938         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
1939         all waiters as woken with woken_seq and bump broadcast counter.
1940         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
1941         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
1942         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1943         Comment typo fixes.  Avoid returning -ETIMEDOUT.
1945 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
1947         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1948         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
1949         Reported by Kaz Kojima.
1951 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
1953         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
1955 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1957         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
1958         __broadcast_seq with bc_seq after acquiring internal lock instead of
1959         before it.
1961 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
1963         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
1964         compilation.
1965         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1966         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
1967         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1968         (pthread_cond_t): Add __data.__broadcast_seq field.
1969         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1970         (FRAME_SIZE): Define.
1971         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
1972         Comment typo fixes.
1973         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
1974         Define.
1975         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
1976         typo fixes.
1977         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1978         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
1979         fixes.
1981 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
1983         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
1984         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1985         Add __broadcast_seq field.
1986         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1987         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1988         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1989         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1990         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1991         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
1992         all waiters as woken with woken_seq and bump broadcast counter.
1993         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
1994         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
1995         __broadcast_seq field.
1996         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1997         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1998         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1999         * pthread_cond_init.c: Initialize __broadcast_seq field.
2000         * Makefile (tests): Add tst-cond17 and tst-cond18.
2001         Add .NOTPARALLEL goal.
2002         * tst-cond16.c: New file.  From Jakub.
2003         * tst-cond17.c: New file.  From Jakub.
2004         * tst-cond18.c: New file.  From Jakub.
2006 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
2008         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
2009         unwind info.
2011         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
2012         Parametrize frame size.  Correct some unwind info.
2013         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2015 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
2017         * tst-stack3.c: Note testing functionality beyond POSIX.
2019 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
2021         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
2022         Change conditional from ifdef to if.
2024 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
2026         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
2027         SYSDEP_CANCEL_ERROR): Define.
2028         (PSEUDO): Use it.
2030 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
2032         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
2034 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
2036         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
2038 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2040         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
2041         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2042         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
2043         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2045 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
2047         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
2048         thread has all signals blocked.
2050 2004-04-18  Andreas Jaeger  <aj@suse.de>
2052         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
2053         (SEM_VALUE_MAX): Add missing brace.
2055 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
2057         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
2058         in rt subdir.
2059         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
2060         * sysdeps/pthread/tst-mqueue8x.c: New test.
2061         * tst-cancel4.c: Update comment about message queues.
2063         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
2064         return it_value { 0, 0 }.
2065         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
2066         like SIGEV_SIGNAL.
2067         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
2068         assertion for SIGEV_NONE.
2069         (thread_attr_compare): Compare all attributes, not just a partial
2070         subset.
2072 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
2074         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
2076 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
2078         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
2079         Just use a plain number.
2080         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
2081         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2082         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2083         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2084         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2085         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2086         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2088 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2090         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
2091         frame info.
2092         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2094 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
2096         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
2097         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
2098         of calling sigwaitinfo.
2100 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
2102         * allocatestack.c (allocate_stack): Set reported_guardsize
2103         unconditionally.
2104         * pthread_getattr_np.c (pthread_getattr_np): Use
2105         reported_guardsize instead of guardsize.
2106         * descr.h (struct pthread): Add reported_guardsize field.
2108 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
2110         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
2112 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
2114         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
2116 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
2118         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
2119         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
2120         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
2121         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
2122         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
2123         Define.
2124         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
2125         (_POSIX_MESSAGE_PASSING): Define.
2126         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
2127         (_POSIX_MESSAGE_PASSING): Define.
2128         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
2129         (_POSIX_MESSAGE_PASSING): Define.
2131 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
2133         * tst-context1.c (fct): Check whether correct stack is used.
2135 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
2137         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
2138         matching constraints for asm mem parameters.
2140         * tst-clock2.c (tf): Don't define unless needed.
2142 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
2144         * Makefile (link-libc-static): Use $(static-gnulib) instead of
2145         $(gnulib).
2147 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
2149         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
2150         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
2151         * pthreadP.h: Declare __nptl_deallocate_tsd.
2152         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
2153         Adjust caller.
2155         * Makefile (tests): Add tst-tsd5.
2156         * tst-tsd5.c: New file.
2158 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
2160         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2161         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
2162         is SHLIB_COMPAT check.
2163         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
2164         (__pthread_attr_getaffinity_old): Likewise.
2165         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2166         (__pthread_getaffinity_old): Likewise.
2167         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2168         (__pthread_setaffinity_old): Likewise.
2170 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
2172         * allocatestack.c (_make_stacks_executable): Call
2173         _dl_make_stack_executable first.
2175 2004-03-24  Roland McGrath  <roland@redhat.com>
2177         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
2178         constraint instead of "0".
2180 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
2182         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2183         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
2185         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
2186         code to avoid warning.
2188 2004-03-24  Andreas Jaeger  <aj@suse.de>
2190         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2191         (__pthread_attr_setaffinity_old): Remove const.
2193 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
2195         * sysdeps/unix/sysv/linux/smp.h: New file.
2196         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
2197         * init.c: Define __is_smp.
2198         (__pthread_initialize_minimal_internal): Call is_smp_system to
2199         initialize __is_smp.
2200         * pthreadP.h: Declare __is_smp.
2201         Define MAX_ADAPTIVE_COUNT is necessary.
2202         * pthread_mutex_init.c: Add comment regarding __spins field.
2203         * pthread_mutex_lock.c: Implement adaptive mutex type.
2204         * pthread_mutex_timedlock.c: Likewise.
2205         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2206         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2207         Add __spins field.
2208         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2209         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2210         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2211         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2212         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2213         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2214         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2215         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
2216         lll_mutex_cond_trylock.
2217         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2218         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2219         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2220         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2221         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2222         Define BUSY_WAIT_NOP.
2223         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2224         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2226         * tst-mutex5.c: Add support for testing adaptive mutexes.
2227         * tst-mutex7.c: Likewise.
2228         * tst-mutex5a.c: New file.
2229         * tst-mutex7a.c: New file.
2230         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
2232         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2233         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
2234         vgettimeofday call might destroy the content.
2236         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
2237         @pause in the loop.
2239         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
2240         No need to restrict type of ret.  Make it int.  Add comment.
2242         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
2243         Remove unnecessary setne instruction.
2245 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
2247         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2248         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
2249         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
2250         If realloc fails, break out of the loop.
2252 2004-03-20  Andreas Jaeger  <aj@suse.de>
2254         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2255         (__pthread_setaffinity_old): Fix interface.
2256         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2257         (__pthread_getaffinity_old): Likewise.
2259         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2260         (__pthread_setaffinity_new): Remove duplicate declaration.
2262 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2264         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
2265         the return value to a safe register.
2266         (CDISABLE): Set the function argument correctly.
2268 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2270         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
2271         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
2272         Rewrite so that only one locked memory operation per round is needed.
2273         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
2274         (pthread_barrier_wait): After wakeup, release lock only when the
2275         last thread stopped using the barrier object.
2276         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
2277         (__pthread_cond_wait): Don't store mutex address if the current
2278         value is ~0l.  Add correct cleanup support and unwind info.
2279         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2280         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
2281         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
2282         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
2283         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
2284         Add correct cleanup support and unwind info.
2285         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
2286         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
2287         information for syscall wrappers.
2289 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
2291         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2292         cpusetsize field, remove next.
2293         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
2294         parameter for size of the CPU set.
2295         (pthread_setaffinity_np): Likewise.
2296         (pthread_attr_getaffinity_np): Likewise.
2297         (pthread_attr_setaffinity_np): Likewise.
2298         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
2299         interface change, keep compatibility code.
2300         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2301         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
2302         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
2303         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
2304         __pthread_getaffinity_np.
2305         * Versions: Add version for changed interfaces.
2306         * tst-attr3.c: Adjust test for interface change.
2307         * pthread_getattr_np.c: Query the kernel about the affinity mask with
2308         increasing buffer sizes.
2309         * pthread_attr_destroy.c: Remove unused list handling.
2310         * pthread_attr_init.c: Likewise.
2312 2004-03-17  Roland McGrath  <roland@redhat.com>
2314         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
2315         first argument to clock_getres so we ever enable kernel timers.
2317 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
2319         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
2321 2004-03-12  Richard Henderson  <rth@redhat.com>
2323         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
2324         oldvalue from CENABLE to CDISABLE.
2326 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
2328         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
2329         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2330         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2331         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2333 2004-03-11  Richard Henderson  <rth@redhat.com>
2335         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
2336         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
2337         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
2339 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
2341         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
2342         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
2343         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
2345 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
2347         * forward.c (__pthread_cond_broadcast_2_0,
2348         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
2349         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
2350         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
2352 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2354         * sysdeps/sh/tcb-offsets.sym: Add PID.
2355         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
2356         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
2358 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
2360         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
2361         include <sysdep-cancel.h>, vfork is no cancellation point.
2362         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
2363         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
2364         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
2366 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
2368         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
2369         libc_hidden_def.
2370         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
2371         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
2372         Likewise.
2373         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
2374         Likewise.
2375         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
2376         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
2377         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
2378         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
2379         of DO_CALL_VIA_BREAK.  Work around a gas problem.
2381         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
2382         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
2383         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
2384         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
2385         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
2386         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
2388         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
2389         a local register for saving old PID.  Negate PID in parent upon exit.
2391         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
2392         tcb-offsets.h.
2393         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2394         before syscall, set to the old value in the parent afterwards.
2395         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
2396         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
2397         tcb-offsets.h.
2398         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2399         before syscall, set to the old value in the parent afterwards.
2400         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
2401         * sysdeps/s390/tcb-offsets.sym: Add PID.
2403         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
2404         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
2405         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
2406         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
2407         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
2408         * sysdeps/sparc/tcb-offsets.sym: Add PID.
2410 2004-03-10  Andreas Schwab  <schwab@suse.de>
2412         * sysdeps/ia64/tcb-offsets.sym: Add PID.
2413         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
2414         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
2416 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
2418         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
2419         * tst-cancel21.c (do_one_test): Likewise.
2420         Reported by Gordon Jin <gordon.jin@intel.com>.
2422 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
2424         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
2425         if non-zero and set to INT_MIN if zero.
2426         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
2427         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
2428         (SAVE_PID, RESTORE_PID): Define.
2429         (__vfork): Use it.
2430         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
2431         Use relative path to avoid including NPTL i386/vfork.S.
2432         (SAVE_PID, RESTORE_PID): Define.
2433         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
2434         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
2435         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
2436         tst-vfork2x.
2437         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
2438         * tst-vfork1.c: New test.
2439         * tst-vfork2.c: New test.
2440         * tst-vfork1x.c: New test.
2441         * tst-vfork2x.c: New test.
2443 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
2445         * sysdeps/i386/tcb-offsets.sym: Add PID.
2446         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2447         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
2448         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
2450 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
2452         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
2454 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2456         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2457         _rtld_global_ro.
2459 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
2461         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2462         _rtld_global_ro.
2464         * tst-once4.c: Remove unnecessary macro definition.
2466         * tst-mutex7.c (do_test): Limit thread stack size.
2467         * tst-once2.c (do_test): Likewise.
2468         * tst-tls3.c (do_test): Likewise.
2469         * tst-tls1.c (do_test): Likewise.
2470         * tst-signal3.c (do_test): Likewise.
2471         * tst-kill6.c (do_test): Likewise.
2472         * tst-key4.c (do_test): Likewise.
2473         * tst-join4.c (do_test): Likewise.
2474         * tst-fork1.c (do_test): Likewise.
2475         * tst-context1.c (do_test): Likewise.
2476         * tst-cond2.c (do_test): Likewise.
2477         * tst-cond10.c (do_test): Likewise.
2478         * tst-clock2.c (do_test): Likewise.
2479         * tst-cancel10.c (do_test): Likewise.
2480         * tst-basic2.c (do_test): Likewise.
2481         * tst-barrier4.c (do_test): Likewise.
2483 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
2485         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
2487 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
2489         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2490         (__pthread_cond_timedwait): Optimize wakeup test.
2491         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2492         (__pthread_cond_wait): Likewise.
2493         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2494         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2495         Likewise.
2497 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
2499         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2500         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
2501         the atomic instruction needed.
2502         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2503         (__lll_mutex_lock_wait): Likewise.
2505 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
2507         * Makefile (tests): Add tst-cond14 and tst-cond15.
2508         * tst-cond14.c: New file.
2509         * tst-cond15.c: New file.
2511 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
2513         * sysdeps/pthread/createthread.c (create_thread): Remove use of
2514         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
2515         needs to be implemented differently to be useful.
2517 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
2519         * pthread_attr_setschedparam.c: Don't test priority against limits
2520         here.  Set ATTR_FLAG_SCHED_SET flag.
2521         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
2522         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
2523         from parent thread to child.  If attribute is used and scheduling
2524         parameters are not inherited, copy parameters from attribute or
2525         compute them.  Check priority value.
2526         * pthread_getschedparam.c: If the parameters aren't known yet get
2527         them from the kernel.
2528         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
2529         ATTR_FLAG_POLICY_SET flag for thread.
2530         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
2531         and ATTR_FLAG_POLICY_SET.
2533         * sysdeps/pthread/createthread.c: Use tgkill if possible.
2535         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
2536         fail if stack address hasn't been set.  Just return 0.
2538 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
2540         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
2541         libpthread for the files in this list.
2542         (CFLAGS-tst-unload): Removed.
2543         * tst-unload.c (do_test): Don't use complete path for
2544         LIBPHREAD_SO.
2546         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
2547         tst-_res1mod2.
2549 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
2551         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2552         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
2553         operation per round is needed.
2554         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2555         (__lll_mutex_lock_wait): Likewise.
2557 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
2559         * tst-cancel9.c (cleanup): Don't print to stderr.
2561 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2563         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
2565 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
2567         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2568         (__syscall_error_handler2): Call CDISABLE.
2569         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2570         (__syscall_error_handler2): Call CDISABLE.
2572         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2573         Release lock before the loop, don't reacquire it.
2575         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
2577 2004-02-19  Andreas Schwab  <schwab@suse.de>
2579         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2580         Fix last change.
2582 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
2584         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
2585         (pthread_barrier_wait): After wakeup, release lock only when the
2586         last thread stopped using the barrier object.
2587         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
2588         (pthread_barrier_wait): Likewise.
2589         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2590         Likewise.
2591         * Makefile (tests): Add tst-barrier4.
2592         * tst-barrier4.c: New file.
2594         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2595         (__pthread_cond_timedwait): Perform timeout test while holding
2596         internal lock to prevent wakeup race.
2597         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2598         * sysdeps/pthread/pthread_cond_timedwait.c
2599         (__pthread_cond_timedwait): Likewise.
2600         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2601         (__pthread_cond_timedwait): Likewise.
2603 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
2605         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
2606         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
2607         * Makefile (tests): Add tst-rwlock13.
2608         * tst-rwlock13.c: New test.
2610 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
2612         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2613         (__condvar_tw_cleanup): Little optimization.
2614         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2616 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
2618         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
2619         libpthread as "lib" parameter to SHLIB_COMPAT.
2620         (__novmx_siglongjmp): Fix typo in function name.
2621         (__novmx_longjmp): Fix typo in function name.
2623 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2625         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
2626         __builtin_expect.
2628         * sysdeps/generic/pt-longjmp.c: Moved to...
2629         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
2631 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
2633         * Makefile (libpthread-routines): Add pt-cleanup.
2634         * pt-longjmp.c: Removed.
2635         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
2636         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
2637         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
2638         Version longjmp, siglongjmp for GLIBC_2.3.4.
2639         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
2641 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2643         * sysdeps/pthread/pthread_cond_timedwait.c
2644         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
2645         Reuse code.  Add __builtin_expects.
2647         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2648         (__pthread_cond_timedwait): Get internal lock in case timeout has
2649         passed before the futex syscall.
2650         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2652 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
2654         * allocatestack.c: Pretty printing.
2656         * sysdeps/pthread/createthread.c (create_thread): Don't add
2657         CLONE_DETACHED bit if it is not necessary.
2659 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
2661         * pthread_getattr_np.c: Include ldsodefs.h.
2663 2004-01-16  Richard Henderson  <rth@redhat.com>
2665         * allocatestack.c: Don't declare __libc_stack_end.
2666         * init.c (__pthread_initialize_minimal_internal): Likewise.
2667         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
2669 2004-01-15  Richard Henderson  <rth@redhat.com>
2671         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
2672         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
2673         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
2674         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
2675         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
2676         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
2677         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
2678         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
2680 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
2682         * init.c (pthread_functions): Make array const.
2684 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
2686         * allocatestack.c (__make_stacks_executable): Change interface.
2687         Check parameters.  Pass parameter on to libc counterpart.
2688         * pthreadP.h: Change declaration.
2690 2004-01-13  Richard Henderson  <rth@redhat.com>
2692         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
2693         prototype form.
2694         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
2695         Likewise.
2697         * sysdeps/alpha/Makefile: New file.
2698         * sysdeps/alpha/tcb-offsets.sym: New file.
2699         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2700         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
2702         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
2703         on powerpc version.
2705 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
2707         * Makefile (tests): Add tst-backtrace1.
2708         * tst-backtrace1.c: New test.
2710 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
2712         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
2713         register as second parameter to the REGISTER macro.
2714         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
2715         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
2716         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
2717         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
2718         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
2719         of thread register as second parameter to REGISTER macro in 64 case.
2721 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
2723         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
2724         (CFLAGS-getpid.o): Defined.
2725         (CFLAGS-getpid.os): Defined.
2727 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
2729         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
2730         returned for main thread does not overlap with any other VMA.
2731         Patch by Jakub Jelinek.
2733 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
2735         * tst-raise1.c: Include stdio.h.
2737 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
2739         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
2740         setting with __ASSUME_TGKILL || defined __NR_tgkill.
2741         If pid is 0, set it to selftid.
2742         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
2743         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
2744         != 0, return self->tid without doing a syscall.
2745         * descr.h (struct pthread): Move pid field after tid.
2747         * Makefile (tests): Add tst-raise1.
2748         * tst-raise1.c: New file.
2750 2003-12-23  Roland McGrath  <roland@redhat.com>
2752         * tst-oddstacklimit.c: New file.
2753         * Makefile (tests): Add it.
2754         (tst-oddstacklimit-ENV): New variable.
2756         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
2757         value up to page size for __default_stacksize.
2759 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
2761         * Makefile (tests): Add tst-eintr5.
2762         * tst-eintr5.c: New file.
2764         * eintr.c (eintr_source): Prevent sending signal to self.
2766         * tst-eintr2.c (tf1): Improve error message.
2768 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
2770         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
2771         * sysdeps/unix/sysv/linux/getpid.c: New file.
2772         * pthread_cancel.c: Add comment explaining use of PID field.
2773         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2774         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
2775         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
2776         temporarily to signal the field must not be relied on and updated
2777         by getpid().
2778         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
2779         temporarily negative.
2780         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2782 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
2784         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
2785         (eintr_source): If ARG != NULL, use pthread_kill.
2786         * tst-eintr1.c: Adjust for this change.
2787         * tst-eintr2.c: Likewise.
2788         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
2789         * tst-eintr3.c: New file.
2790         * tst-eintr4.c: New file.
2792 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
2794         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
2795         if CANCELSTATE_BITMASK is set.
2796         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
2797         Likewise.
2799         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
2800         (tests-reverse): Add tst-cancel23.
2801         * tst-cancel22.c: New test.
2802         * tst-cancel23.c: New test.
2804 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
2806         * tst-eintr1.c: Better error messages.
2808         * Makefile (tests): Add tst-eintr2.
2809         * tst-eintr2.c: New file.
2811 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
2813         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
2814         (CFLAGS-tst-cancelx21.c): Set.
2815         * tst-cancel21.c: New test.
2816         * tst-cancelx21.c: New test.
2818         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
2819         comparison operand.
2820         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
2821         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
2822         * pt-longjmp.c: Include jmpbuf-unwind.h.
2823         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
2824         _JMPBUF_UNWINDS.  Adjust compared pointers.
2825         * init.c (__pthread_initialize_minimal_internal): Initialize
2826         pd->stackblock_size.
2827         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
2828         * sysdeps/alpha/jmpbuf-unwind.h: New file.
2829         * sysdeps/i386/jmpbuf-unwind.h: New file.
2830         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
2831         * sysdeps/s390/jmpbuf-unwind.h: New file.
2832         * sysdeps/sh/jmpbuf-unwind.h: New file.
2833         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
2834         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
2835         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
2836         (_JMPBUF_CFA_UNWINDS): Remove.
2837         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
2839 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
2841         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
2842         (CFLAGS-tst-cancelx20.c): Set.
2843         * tst-cancel20.c: New test.
2844         * tst-cancelx20.c: New test.
2846 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
2848         * init.c (__pthread_initialize_minimal_internal): Don't treat
2849         architectures with separate register stack special here when
2850         computing default stack size.
2852 2003-12-17  Roland McGrath  <roland@redhat.com>
2854         * Makefile (tst-cancelx7-ARGS): New variable.
2855         Reportd by Greg Schafer <gschafer@zip.com.au>.
2857 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
2859         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
2860         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
2861         (tst-stack3-ENV): Set.
2862         ($(objpfx)tst-stack3-mem): New.
2863         * tst-stack3.c: New test.
2865 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
2867         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
2868         Add unwind directives.  Drop unused .regstk directive.
2869         (_fini_EPILOG_BEGINS): Add unwind directives.
2871 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
2873         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2874         Assume parameter is a pointer.
2875         (lll_futex_wake): Likewise.
2876         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
2877         Likewise.
2878         (lll_futex_wake): Likewise.
2879         Reported by Boris Hu.
2880         * sysdeps/unix/sysv/linux/unregister-atfork.c
2881         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
2883         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
2885 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
2887         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
2888         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
2889         __rtld_lock_initialize for ld.so lock.
2890         Patch in part by Adam Li <adam.li@intel.com>.
2892 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
2894         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
2895         in $(gnulib).  Also, remove stale comment.
2897 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
2899         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
2900         advantage of new syscall stub and optimize accordingly.
2902         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
2903         from SYS_futex, to match expectations of
2904         sysdep.h:DO_INLINE_SYSCALL.
2905         (lll_futex_clobbers): Remove.
2906         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
2907         (lll_futex_wake): Likewise.
2908         (lll_futex_requeue): Likewise.
2909         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
2910         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
2911         Jelinek).
2912         (__lll_mutex_lock): Likewise.
2913         (__lll_mutex_cond_lock): Likewise.
2914         (__lll_mutex_timed_lock): Likewise.
2915         (__lll_mutex_unlock): Likewise.
2916         (__lll_mutex_unlock_force): Likewise.
2918         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
2919         comes before the include of <sysdep.h>.
2920         (THREAD_SELF_SYSINFO): New macro.
2921         (THREAD_SYSINFO): Likewise.
2922         (INIT_SYSINFO): New macro.
2923         (TLS_INIT_TP): Call INIT_SYSINFO.
2925         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
2927         * sysdeps/pthread/createthread.c (create_thread): Use
2928         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
2929         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
2930         THREAD_SELF_SYSINFO instead of open code.
2931         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
2932         (THREAD_SYSINFO): Likewise.
2934         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
2936         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
2938 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
2940         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
2941         instead of .init.  Patch by David Mosberger.
2943 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
2945         * sysdeps/pthread/configure.in: Remove broken declaration in C
2946         cleanup handling check.
2948 2003-11-30  Andreas Jaeger  <aj@suse.de>
2950         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
2951         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
2952         Likewise.
2954 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
2956         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
2957         * pthread_attr_destroy.c: Include shlib-compat.h.
2958         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
2959         is set in iattr->flags.
2960         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
2962 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
2964         * Makefile (distribute): Add tst-cleanup4aux.c.
2966         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
2967         include.
2969 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
2971         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
2972         pthread_cond_signal.
2974         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
2975         store mutex address if the current value is ~0l.
2976         * sysdeps/pthread/pthread_cond_timedwait.c
2977         (__pthread_cond_timedwait): Likewise.
2978         * sysdeps/pthread/pthread_cond_broadcast.c
2979         (__pthread_cond_broadcast): Don't use requeue for pshared
2980         condvars.
2982         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2983         (__pthread_cond_wait): Don't store mutex address if the current
2984         value is ~0l.
2985         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2986         (__pthread_cond_timedwait): Likewise.
2987         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2988         (__pthread_cond_broadcast): Don't use requeue for pshared
2989         condvars.
2991         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
2992         element with ~0l for pshared condvars, with NULL otherwise.
2994         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2995         (__pthread_cond_wait): Don't store mutex address if the current
2996         value is ~0l.
2997         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2998         (__pthread_cond_timedwait): Likewise.
2999         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
3000         (__pthread_cond_broadcast): Don't use requeue for pshared
3001         condvars.
3003         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
3004         * tst-cond12.c: New file.
3005         * tst-cond13.c: New file.
3007 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
3009         * sysdeps/pthread/configure.in: Make missing forced unwind support
3010         fatal.
3012 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
3014         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
3016 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
3018         * Makefile: Add magic to clean up correctly.
3020 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
3022         * unwind.c (FRAME_LEFT): Define.
3023         (unwind_stop): Handle old style cleanups here.
3024         (__pthread_unwind): Handle old style cleanups only if
3025         !HAVE_FORCED_UNWIND.
3026         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
3027         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
3028         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
3029         ($(objpfx)tst-cleanupx4): Likewise.
3030         * tst-cleanup4.c: New test.
3031         * tst-cleanup4aux.c: New.
3032         * tst-cleanupx4.c: New test.
3034 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
3036         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
3037         lll_mutex_*lock macros to skip atomic operations on some archs.
3039 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
3041         * sysdeps/pthread/tst-timer.c (main): Initialize
3042         sigev2.sigev_value as well.
3044 2003-10-15  Roland McGrath  <roland@redhat.com>
3046         * sysdeps/pthread/configure.in: Barf if visibility attribute support
3047         is missing.
3048         * sysdeps/pthread/configure: Regenerated.
3050 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3052         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
3053         locking macros.  No distinction between normal and mutex locking
3054         anymore.
3055         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
3056         Merge bits from lowlevelmutex.S we still need.
3057         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
3058         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
3059         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
3060         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
3061         new mutex implementation.
3062         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
3063         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
3064         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3065         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3066         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
3067         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3068         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3069         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3070         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3071         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
3072         symbol for entry point to avoid cancellation.
3074 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
3076         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
3077         changes.
3078         (SAVE_OLDTYPE_0): Fix a typo.
3080 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
3082         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3083         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
3085 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
3087         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
3088         correct offset.
3090 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
3092         * Makefile (tests): Add tst-cancel19.
3093         * tst-cancel19.c: New test.
3095 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
3097         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
3098         restoring of the old cancellation type.
3100 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
3102         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
3104 2003-09-27  Wolfram Gloger  <wg@malloc.de>
3106         * sysdeps/pthread/malloc-machine.h: New file
3108 2003-09-24  Roland McGrath  <roland@redhat.com>
3110         * allocatestack.c (__make_stacks_executable): Don't ignore return
3111         value from _dl_make_stack_executable.
3113 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
3115         * allocatestack.c (__make_stacks_executable): Also change
3116         permission of the currently unused stacks.
3118         * allocatestack.c (change_stack_perm): Split out from
3119         __make_stacks_executable.
3120         (allocate_stack): If the required permission changed between the time
3121         we started preparing the stack and queueing it, change the permission.
3122         (__make_stacks_executable): Call change_stack_perm.
3124         * Makefile: Build tst-execstack-mod locally.
3125         * tst-execstack-mod.c: New file.
3127 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
3129         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
3131 2003-09-23  Roland McGrath  <roland@redhat.com>
3133         * tst-execstack.c: New file.
3134         * Makefile (tests): Add it.
3135         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
3136         (LDFLAGS-tst-execstack): New variable.
3138         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
3139         whether to use PROT_EXEC for stack mmap.
3140         (__make_stacks_executable): New function.
3141         * pthreadP.h: Declare it.
3142         * init.c (__pthread_initialize_minimal_internal): Set
3143         GL(dl_make_stack_executable_hook) to that.
3145 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
3147         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
3148         recommendation from AMD re avoidance of lock prefix.
3150 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
3152         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
3153         lll_futex_timed_wait instead of lll_futex_wait.
3154         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
3155         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
3156         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
3157         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
3158         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
3159         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
3160         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
3161         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
3162         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
3163         Completely revamp the locking macros.  No distinction between
3164         normal and mutex locking anymore.
3165         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3166         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
3167         __lll_lock_timedwait): Fix prototypes.
3168         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
3169         __lll_lock_timedwait): Likewise.
3170         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
3171         macros, add __builtin_expect.
3172         (lll_mutex_timedlock): Likewise.  Fix return value.
3173         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
3174         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
3175         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
3176         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
3177         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
3178         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
3179         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
3180         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
3182 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
3184         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3185         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
3186         operation if possible.
3188         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
3189         like jumping over the lock prefix.
3191 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
3193         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
3194         locking macros.  No distinction between normal and mutex locking
3195         anymore.
3196         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3197         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3198         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3199         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
3200         locking.  Merge bits from lowlevelmutex.S we still need.
3201         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3202         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
3203         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
3204         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
3205         * Makefile (routines): Remove libc-lowlevelmutex.
3206         (libpthread-rountines): Remove lowlevelmutex.
3207         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
3208         for new mutex implementation.
3209         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3210         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3211         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3212         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3213         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3214         Likewise.
3215         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3216         Likewise.
3217         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
3218         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3219         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
3220         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3221         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3222         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3223         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3224         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3225         Likewise.
3226         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3227         Likewise.
3228         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
3229         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3230         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3231         Don't use requeue.
3232         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3233         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
3235 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
3237         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
3238         in parameters of asm with output parameters.
3240         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
3241         type of DECR parameter to int.
3242         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
3244 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
3246         * tst-attr3.c (tf, do_test): Print stack start/end/size and
3247         guardsize for each thread.
3249 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
3251         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
3252         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
3253         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
3255         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
3256         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
3257         NULL.
3258         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
3259         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
3260         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
3261         (pthread_getaffinity_np): Add hidden_def.
3263         * Makefile (tests): Add tst-attr3.
3264         * tst-attr3.c: New test.
3266         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
3268 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
3270         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
3271         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
3273 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
3275         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
3276         * tst-align.c: Include tst-stack-align.h.
3277         (tf, do_test): Use TEST_STACK_ALIGN macro.
3279 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
3281         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
3282         variable.
3284 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
3286         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
3287         stack-related values for the initial thread.
3289 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
3291         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
3293 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
3295         * pthread_mutex_lock.c: Minor code rearrangements.
3297 2003-09-05  Roland McGrath  <roland@redhat.com>
3299         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
3300         Instead, include ../nptl_db/db_info.c to do its magic.
3301         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
3302         (__pthread_pthread_key_2ndlevel_size): Likewise.
3303         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
3304         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
3305         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
3306         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
3307         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
3308         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
3309         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
3310         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
3311         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
3312         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
3313         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
3314         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
3315         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
3316         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
3317         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
3318         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
3319         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
3321 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
3323         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
3324         of pthread_t to be compatible with LT.
3325         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3326         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3327         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3328         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3329         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3330         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3331         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3333 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
3335         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
3337 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
3339         * unwind-forcedunwind.c: Move to...
3340         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
3341         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
3342         * sysdeps/pthread/jmpbuf-unwind.h: New file.
3343         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
3344         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
3345         * unwind.c: Include jmpbuf-unwind.h.
3346         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
3348 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
3350         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
3351         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
3352         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
3353         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
3354         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
3355         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
3356         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
3357         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
3358         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
3359         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
3360         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
3361         function.
3362         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
3363         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
3364         * Makefile (tests): Add tst-stack2.
3365         * tst-stack2.c: New test.
3366         * tst-stack1.c: Include limits.h and sys/param.h.
3367         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
3369         * pthread_condattr_setpshared.c: Include errno.h.
3370         (pthread_condattr_setpshared): Return EINVAL if pshared
3371         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
3373         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
3374         defined symbol for entry point to avoid cancellation.
3375         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3376         Likewise.
3377         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3378         Likewise.
3379         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3380         Likewise.
3381         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
3382         Likewise.
3383         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3384         Likewise.
3385         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
3386         __close_nocancel, __read_nocancel, __write_nocancel,
3387         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
3388         libpthread.so or librt.so, define to corresponding function
3389         without _nocancel suffix.
3390         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
3391         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
3392         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
3394         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
3396 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
3398         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
3399         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
3401         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
3402         in subsections has a symbol associated with it.
3404         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
3405         defined symbol for entry point to avoid cancellation.
3406         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
3408 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3410         * Makefile (tests): Add tst-tls5.
3411         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
3412         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
3413         ($(objpfx)tst-tls5): New.
3414         ($(objpfx)tst-tls6.out): Likewise.
3415         (tests): Depend on $(objpfx)tst-tls6.out.
3416         * tst-tls3.c: Include stdint.h and pthreaddef.h.
3417         (do_test): Check pthread_self () return value alignment.
3418         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
3419         (tf): Check pthread_self () return value alignment.
3420         * tst-tls5.c: New test.
3421         * tst-tls5.h: New.
3422         * tst-tls5mod.c: New.
3423         * tst-tls5moda.c: New.
3424         * tst-tls5modb.c: New.
3425         * tst-tls5modc.c: New.
3426         * tst-tls5modd.c: New.
3427         * tst-tls5mode.c: New.
3428         * tst-tls5modf.c: New.
3429         * tst-tls6.sh: New test.
3431         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
3432         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
3433         * init.c (pthread_functions): Initialize them.
3434         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
3435         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
3436         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
3437         pthread_cond_timedwait@@GLIBC_2.3.2.
3439 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3441         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
3442         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
3443         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
3444         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
3445         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
3446         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
3448         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
3450         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
3451         _POSIX_THREAD_PRIORITY_SCHEDULING.
3452         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3454 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
3456         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
3457         nested function, use static inline function from libio.h.
3458         Code by Richard Henderson.
3460         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
3461         weak.
3463 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
3465         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
3466         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
3467         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
3468         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
3469         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
3470         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
3471         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
3472         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
3473         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
3474         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
3475         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
3476         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
3477         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
3478         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
3479         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
3480         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
3481         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
3482         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
3483         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
3484         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
3485         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
3486         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
3487         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
3488         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
3489         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
3490         * sysdeps/sparc/tls.h: New file.
3491         * sysdeps/sparc/tcb-offsets.sym: New file.
3492         * sysdeps/sparc/Makefile: New file.
3493         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
3494         * init.c [__sparc__] (__NR_set_tid_address): Define.
3496 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
3498         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
3499         _IO_release_lock): Define.
3501 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
3503         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
3504         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
3506 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
3508         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
3509         (__pthread_cleanup_class): Add missing return types of member
3510         functions.
3512 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
3514         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3515         (lll_mutex_unlock_force): Add memory barrier between store and futex
3516         syscall.
3518 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
3520         * tst-cancel4.c (do_test): Also unlink tempfname and remove
3521         tempmsg in first loop.
3523 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
3525         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3526         _POSIX_THREAD_PRIORITY_SCHEDULING.
3527         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3529 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3531         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
3532         (__rtld_lock_default_lock_recursive,
3533         __rtld_lock_default_unlock_recursive): Define.
3534         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
3535         __rtld_lock_unlock_recursive): Define using
3536         GL(_dl_rtld_*lock_recursive).
3537         * init.c (__pthread_initialize_minimal_internal): Initialize
3538         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
3539         Lock GL(_dl_load_lock) the same number of times as
3540         GL(_dl_load_lock) using non-mt implementation was nested.
3542         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
3543         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
3545 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
3547         * tst-cancel17.c (do_test): Make len2 maximum of page size and
3548         PIPE_BUF.
3550 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3552         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
3554 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
3556         * sysdeps/pthread/createthread.c (do_clone): Move error handling
3557         to first syscall error check.  Move syscall error check for tkill
3558         into __ASSUME_CLONE_STOPPED #ifdef.
3560 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
3562         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
3563         is not defined, do explicit synchronization.
3564         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
3565         is not defined also unlock pd->lock for non-debugging case in case
3566         it is necessary.
3567         * pthread_create.c (start_thread): Always get and release pd->lock
3568         if __ASSUME_CLONE_STOPPED is not defined.
3569         (start_thread_debug): Removed.  Adjust users.
3570         * allocatestack.c (allocate_stack): Always initialize lock if
3571         __ASSUME_CLONE_STOPPED is not defined.
3572         * Makefile (tests): Add tst-sched1.
3573         * tst-sched1.c: New file.
3575         * sysdeps/pthread/createthread.c (do_clone): Only use
3576         sched_setschduler and pass correct parameters.
3578 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3580         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
3581         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
3582         PTHREAD_STACK_MIN in comments.
3584 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3586         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3587         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
3588         argument.
3589         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
3590         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
3591         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
3592         (__pthread_cleanup_upto): Fix prototype.
3593         (_longjmp_unwind): Adjust caller.
3594         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
3595         Change second argument to const struct pointer.
3596         * tst-sem8.c (main): Remove unused s2 and s3 variables.
3597         * tst-sem9.c (main): Likewise.
3598         * unwind.c: Include string.h for strlen prototype.
3600 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
3602         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3603         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
3604         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
3605         Define HAVE_CMOV.
3606         Patch by Nicholas Miell <nmiell@attbi.com>.
3608 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
3610         * init.c (__pthread_initialize_minimal_internal): Initialize
3611         GL(dl_init_static_tls).
3612         * pthreadP.h (__pthread_init_static_tls): New prototype.
3613         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
3614         New functions.
3615         * Makefile (tests): Add tst-tls4.
3616         (modules-names): Add tst-tls4moda and tst-tls4modb.
3617         ($(objpfx)tst-tls4): Link against libdl and libpthread.
3618         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
3619         tst-tls4modb.so.
3620         * tst-tls4.c: New file.
3621         * tst-tls4moda.c: New file.
3622         * tst-tls4modb.c: New file.
3624 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
3626         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
3627         before __timer_dealloc.
3628         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
3629         Don't call list_unlink.
3631 2003-07-29  Roland McGrath  <roland@redhat.com>
3633         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
3635 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
3637         * tst-cancel17.c (do_test): Check if aio_cancel failed.
3638         Don't reuse struct aiocb A if it failed.
3639         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
3640         not just one byte, as that does not block.
3642 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
3644         * sysdeps/pthread/unwind-resume.c: New file.
3645         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
3646         unwind-resume in csu subdir.
3647         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
3648         exceptions.
3649         (librt-sysdep_routines, librt-shared-only-routines): Add
3650         rt-unwind-resume.
3651         * sysdeps/pthread/rt-unwind-resume.c: New file.
3652         * unwind-forcedunwind.c: New file.
3653         * Makefile (libpthread-routines): Add unwind-forcedunwind.
3654         (libpthread-shared-only-routines): Likewise.
3655         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
3656         * pthreadP.h (pthread_cancel_init): New prototype.
3657         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
3659         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
3660         attr argument const struct pthread_attr *.
3662         * res.c (__res_state): Return __resp.
3663         * descr.h: Include resolv.h.
3664         (struct pthread): Add res field.
3665         * pthread_create.c: Include resolv.h.
3666         (start_thread): Initialize __resp.
3667         * Makefile (tests): Add tst-_res1.
3668         (module-names): Add tst-_res1mod1, tst-_res1mod2.
3669         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
3670         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
3671         libpthread.
3672         * tst-_res1.c: New file.
3673         * tst-_res1mod1.c: New file.
3674         * tst-_res1mod2.c: New file.
3676 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
3678         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
3680         * Makefile: Define various *-no-z-defs variables for test DSOs
3681         which has undefined symbols.
3683 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
3685         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3686         Retry if the stwcx fails to store once_control.
3688 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
3690         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
3691         pthread_attr_setaffinity.
3692         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
3693         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
3694         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
3695         * pthread_attr_destroy.c: Free cpuset element if allocated.
3696         * pthread_create.c: Pass iattr as additional parameter to
3697         create_thread.
3698         * sysdeps/pthread/createthread.c: If attribute is provided and
3699         a new thread is created with affinity set or scheduling parameters,
3700         start thread with CLONE_STOPPED.
3701         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
3702         pthread_attr_setaffinity.
3703         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
3704         cpuset element.
3706 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
3708         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
3710 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
3712         * sysdeps/pthread/configure.in: Require CFI directives also for
3713         ppc and s390.
3715 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
3717         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3718         Add cfi directives.
3720 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3722         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
3723         CLEANUP_JMP_BUF.
3724         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
3725         registers as variables.  Call __pthread_mutex_unlock_usercnt.
3726         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3727         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
3728         not self pointer in __writer.  Compare with TID to determine
3729         deadlocks.
3730         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3731         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
3732         Likewise.
3733         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
3734         Likewise.
3735         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
3736         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
3737         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
3738         macros also when compiling librt.
3740 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
3742         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
3743         -fasynchronous-unwind-tables.
3744         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3745         (PSEUDO): Add cfi directives.
3746         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
3747         Likewise.
3748         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3749         Likewise.
3751 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
3753         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
3754         __pthread_unregister_cancel): Add prototypes and hidden_proto.
3755         * unwind.c (__pthread_unwind_next): Add hidden_def.
3756         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
3757         Likewise.
3758         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3759         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
3760         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3761         Likewise.
3762         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
3763         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
3764         Likewise.
3765         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
3766         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
3767         __pthread_unregister_cancel and __pthread_unwind_next.
3769 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
3771         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
3772         different symbol for the cancellation syscall wrapper and
3773         non-cancellation syscall wrapper.
3774         (PSEUDO_END): Define.
3776 2003-07-05  Richard Henderson  <rth@redhat.com>
3778         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
3779         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
3780         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3781         return actual return value from the syscall, not 0.
3783 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
3785         * descr.h (struct pthread): Add pid field.
3786         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
3787         (__reclaim_stacks): Likewise.
3788         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
3789         also check for PID of the signal source.
3790         (__pthread_initialize_minimal_internal): Also initialize pid field
3791         of initial thread's descriptor.
3792         * pthread_cancel.c: Use tgkill instead of tkill if possible.
3793         * sysdeps/unix/sysv/linux/fork.c: Likewise.
3794         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
3795         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
3796         * sysdeps/unix/sysv/linux/raise.c: Likewise.
3798 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
3800         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
3801         Fix use of parameter.
3802         (__libc_cleanup_pop): Likewise.
3804 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
3806         * init.c (sigcancel_handler): Change parameters to match handler
3807         for SA_SIGACTION.  Check signal number and code to recognize
3808         invalid invocations.
3810 2003-07-03  Roland McGrath  <roland@redhat.com>
3812         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
3813         Apply sizeof (struct pthread) bias to r13 value.
3815 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
3817         * sysdeps/pthread/configure.in: Require CFI directives.
3819         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
3820         definition.
3821         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
3822         libpthread compilation.
3823         * unwind.c (__pthread_unwind): Add hidden_def.
3824         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
3826 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3828         * libc-cancellation.c (__libc_cleanup_routine): Define.
3829         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
3830         (__pthread_cleanup_pop): Define.
3832 2003-07-01  Richard Henderson  <rth@redhat.com>
3834         * sysdeps/alpha/elf/pt-initfini.c: New file.
3835         * sysdeps/alpha/pthread_spin_lock.S: New file.
3836         * sysdeps/alpha/pthread_spin_trylock.S: New file.
3837         * sysdeps/alpha/pthreaddef.h: New file.
3838         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
3839         * sysdeps/alpha/tls.h: New file.
3840         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
3841         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
3842         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
3843         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
3844         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
3845         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
3846         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
3847         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
3848         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
3849         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
3851 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3853         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
3854         cleanup support and unwind info.
3856 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
3858         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3859         Use correct cleanup handler registration.  Add unwind info.
3860         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
3861         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
3862         * tst-once3.c: Add cleanup handler and check it is called.
3863         * tst-once4.c: Likewise.
3864         * tst-oncex3.c: New file.
3865         * tst-oncex4.c: New file.
3866         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
3868 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
3870         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
3872 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
3874         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
3875         (tf_msgsnd): Likewise.
3877         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
3878         premature returns a bit more.
3880 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
3882         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
3883         definition to the front.
3885         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
3886         the cleanup functions to make the names unique.  Fix dwarf opcode
3887         un unwind table.
3888         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
3889         functions to make the names unique.  Fix CFA offset for two blocks.
3891 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
3893         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
3894         missing closing braces.
3895         Patch by Christophe Saout <christophe@saout.de>.
3897 2003-06-24  Roland McGrath  <roland@redhat.com>
3899         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
3901 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
3903         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
3904         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
3906         * pthreadP.h: Declare __find_thread_by_id.
3907         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
3908         * pthread_clock_gettime.c: Allow using other thread's clock.
3909         * pthread_clock_settime.c: Likewise.
3910         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
3911         * Makefile: Add rules to build and run tst-clock2.
3912         * tst-clock2.c: New file.
3914 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
3916         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
3917         to use exception-based cleanup handler.
3918         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3920         * tst-cond8.c (ch): Announce that we are done.
3922         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
3924         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
3925         Also test aio_suspend with timeout value.
3927 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
3929         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
3930         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
3931         attribute_hidden.
3933         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
3934         (__pthread_mutex_lock_internal): Likewise.
3935         (__pthread_mutex_unlock_internal): Likewise.
3936         (__pthread_mutex_unlock_usercnt): Declare.
3937         * pthread_mutex_destroy.c: Always fail if used in any way.
3938         * pthread_mutex_init.c: Update comment.
3939         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
3940         * pthread_mutex_timedlock.c: Adjust __nusers.
3941         * pthread_mutex_trylock.c: Adjust __nusers.
3942         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
3943         and public interfaces are wrapper with pass additional parameter.
3944         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
3945         parameter zero.
3946         * tst-mutex8.c: New file.
3947         * Makefile (tests): Add tst-mutex8.
3948         * sysdeps/pthread/pthread_cond_timedwait.c: Call
3949         __pthread_mutex_unlock_usercnt.
3950         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3951         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3952         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3953         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3954         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3955         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
3956         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3957         Add __nusers.
3958         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3959         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3960         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3961         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3962         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3964         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
3965         * pthread_mutex_timedlock.c: Likewise.
3966         * pthread_mutex_trylock.c: Adjust __nusers.
3967         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
3968         * tst-mutex9.c: New file.
3969         * Makefile (tests): Add tst-mutex9.
3970         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
3971         * sysdeps/ia64/tls.h: Likewise.
3972         * sysdeps/powerpc/tls.h: Likewise.
3973         * sysdeps/s390/tls.h: Likewise.
3974         * sysdeps/sh/tls.h: Likewise.
3975         * sysdeps/x86_64/tls.h: Likewise.
3976         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3977         Change type of __owner.
3978         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3979         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3980         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3981         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3982         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3984 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
3986         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
3987         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
3989         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
3990         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
3991         instead of nr to lll_futex_wake.  Only set errno and return -1
3992         if err < 0.
3994         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
3995         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3996         return actual return value from the syscall, not 0.
3998 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
4000         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
4001         find a random value.
4002         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
4003         errno==EIDRM.
4005         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
4006         compat_timer_settime.
4007         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
4008         compat_timer_gettime.
4009         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
4010         compat_timer_getoverrun.
4011         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
4012         compat_timer_delete.
4014         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
4015         error-checking mutex detect busy mutexes.
4017 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
4019         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
4020         Add ax to clobber list.
4021         (lll_mutex_cond_lock): Likewise.
4022         (lll_mutex_unlock): Likewise.
4023         (lll_lock): Likewise.
4024         (lll_unlock): Likewise.
4026         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
4027         * tst-cancel18.c: New file.
4028         * tst-cancelx18.c: New file.
4030         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
4031         and tcdrain.
4033         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
4034         * tst-cancel17.c: New file.
4035         * tst-cancelx17.c: New file.
4037         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
4038         * sysdeps/unix/sysv/linux/sigwait.c: New file.
4039         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
4041         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
4043 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
4045         * sysdeps/pthread/createthread.c (create_thread): Set
4046         header.multiple_threads unconditionally.
4047         * allocatestack.c (allocate_stack): Likewise.
4048         * descr.h (struct pthread): Add header.multiple_threads
4049         unconditionally.
4050         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
4051         Define for librt.  #error if neither libpthread, libc nor librt.
4052         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
4053         Likewise.
4054         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
4055         CDISABLE): Likewise.
4056         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
4057         CDISABLE): Likewise.
4058         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
4059         CDISABLE): Likewise.
4060         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
4061         CDISABLE): Likewise.  Access header.multiple_threads outside of
4062         libc and libpthread.
4063         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
4064         Likewise.
4065         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
4066         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
4068 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
4070         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
4071         Also test early cancellation before the thread reaches the cancellation
4072         point.
4074         * Makefile: Compile forward.c with exceptions.
4076         * sysdeps/unix/sysv/linux/sleep.c: New file.
4078 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
4080         * Makefile: Add CFLAGS definition to compile function wrappers
4081         duplicated from libc with exceptions.
4082         * tst-cancel4.c: Also check cancellation handlers.
4084         * Makefile: Add rules to build and run tst-cancel16 and
4085         tst-cancelx16.  Add missing CFLAGS definitions.
4086         * tst-cancel16.c: New file.
4087         * tst-cancelx16.c: New file.
4089 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
4091         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4092         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
4093         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
4094         (DL_SYSINFO_IMPLEMENTATION): Likewise.
4096         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
4097         (LIBC_CANCEL_RESET): Likewise.
4098         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
4099         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
4100         librt-cancellation.
4101         (CFLAGS-libcrt-cancellation.c): Define.
4102         * sysdeps/pthread/librt-cancellation.c: New file.
4103         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
4104         macros also when compiling librt.
4105         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4106         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4107         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4108         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4109         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4110         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4111         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4113         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
4114         compat_timer_create.
4116 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
4118         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
4120         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
4121         __register_atfork.
4122         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
4123         Add libc_hidden_def.
4125 2003-06-13  Roland McGrath  <roland@redhat.com>
4127         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
4128         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
4130 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
4132         * allocatestack.c (queue_stack): Always inline.
4133         * ptreadhP.h (__do_cancel): Likewise.
4135 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
4137         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
4138         a typo.
4140 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
4142         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4143         (__pthread_cond_signal): Remove incorrect second addition for
4144         cond_lock!=0.
4146 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
4148         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4149         (__pthread_cond_signal): Use correct futex pointer in
4150         __lll_mutex_lock_wait call.
4152         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4153         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
4155 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
4157         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
4158         cancelable.
4159         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
4160         Likewise.
4162         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
4163         hand-written CFI generation code.  Since ENTRY/END also initiated
4164         CFI frames this caused two CFI sets to be generated.
4166 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
4168         * cleanup_routine.c: New file.
4169         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
4170         * sysdeps/pthread/pthread.h: Add support for fully exception-based
4171         cleanup handling.
4172         * Makefile (libpthread-routines): Add cleanup_routine.
4173         Add more CFLAGS variables to compile with exceptions.  Add comments
4174         why which file needs unwind tables.
4175         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
4176         tests.
4177         * tst-cancelx1.c: New file.
4178         * tst-cancelx2.c: New file.
4179         * tst-cancelx3.c: New file.
4180         * tst-cancelx4.c: New file.
4181         * tst-cancelx5.c: New file.
4182         * tst-cancelx6.c: New file.
4183         * tst-cancelx7.c: New file.
4184         * tst-cancelx8.c: New file.
4185         * tst-cancelx9.c: New file.
4186         * tst-cancelx10.c: New file.
4187         * tst-cancelx11.c: New file.
4188         * tst-cancelx12.c: New file.
4189         * tst-cancelx13.c: New file.
4190         * tst-cancelx14.c: New file.
4191         * tst-cancelx15.c: New file.
4192         * tst-cleanupx0.c: New file.
4193         * tst-cleanupx0.expect: New file.
4194         * tst-cleanupx1.c: New file.
4195         * tst-cleanupx2.c: New file.
4196         * tst-cleanupx3.c: New file.
4198         * tst-cleanup0.c: Make standard compliant.
4199         * tst-cleanup1.c: Likewise.
4201         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
4202         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
4203         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4204         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
4205         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4206         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4207         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
4208         CLEANUP_JMP_BUF.
4209         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4210         * tst-cancel12.c: New file.
4211         * tst-cancel13.c: New file.
4212         * tst-cancel14.c: New file.
4213         * tst-cancel15.c: New file.
4214         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
4215         and tst-cancel15.
4217         * tst-cancel1.c: Add some comments.
4219         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
4220         timeout correctly.
4222 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
4224         * Makefile (CFLAGS-pthread_cancel.c): Define.
4226 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
4228         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
4229         Change type of __writer element to int.
4230         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4231         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4232         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4233         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4234         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4235         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
4236         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4237         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
4238         Compare with TID to determine deadlocks.
4239         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
4240         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4241         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
4242         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4243         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4244         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4245         Likewise.
4246         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4247         Likewise.
4248         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4249         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4250         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4251         Likewise.
4252         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4253         Likewise.
4254         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4255         * Makefile (tests): Add tst-rwlock12.
4256         * tst-rwlock12.c: New file.
4258 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
4260         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
4261         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
4262         Remove bogus hidden_proto.
4263         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
4264         Likewise.
4265         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
4266         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
4267         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
4268         ___lll_mutex_timedlock): Likewise.
4270 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
4272         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4273         (__pthread_cond_signal): Add some code to eventually handle
4274         cond_lock!=0.
4276 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
4278         * Makefile (tests): Add tst-exec4.
4279         (tst-exec4-ARGS): Define.
4280         * tst-exec4.c: New file.
4282 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
4284         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
4285         Also fail if tv_nsec < 0.
4286         (__lll_timedwait_tid): Likewise.
4287         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
4288         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
4289         Likewise.
4290         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
4291         Likewise.
4292         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
4293         Likewise.
4294         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
4295         Likewise.
4296         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
4297         Likewise.
4298         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
4299         Likewise.
4301         * Makefile (tests): Add tst-sem8 and tst-sem9.
4302         * tst-sem8.c: New file.
4303         * tst-sem9.c: New file.
4304         * sem_open.c: Fix creation of in_use record if the file exists but
4305         no internal record.
4307         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
4308         definitions.
4310         * sysdeps/pthread/timer_create.c (timer_create): In case
4311         evp==NULL, assign timer ID to sival_ptr.
4313         * descr.h (struct pthread_unwind_buf): Change type of prev element to
4314         struct pthread_unwind_buf *.
4315         (struct pthread): Likewise for cleanup_jmp_buf element.
4317         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
4318         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
4319         * unwind.c (__pthread_unwind_next): Likewise.
4321 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
4323         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4324         (lll_futex_timed_wait): Use int for futex value parameter.
4325         (lll_futex_wake): Likewise.
4326         (lll_futex_requeue): Likewise.
4328         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
4329         Replace one memory operation with one register operation.
4331         * tst-join4.c (do_test): Fix error message.
4333         * tst-rwlock6.c (do_test): Use correct format specifier.
4335         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4336         (__lll_mutex_lock_wait): Replace one memory operation with one
4337         register operation.
4338         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
4339         (__lll_mutex_lock_wait): Likewise.
4341         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4342         (__lll_mutex_cond_lock): Add one to value parameter of
4343         __lll_lock_wait to reflect reality in the futex syscall.
4344         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4345         (lll_mutex_cond_lock): Likewise.
4347 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
4349         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
4350         New function.
4351         (lll_mutex_cond_lock): Define.
4353 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
4355         * Makefile (tests): Add tst-signal6.
4356         * tst-signal6.c: New file.
4358         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
4359         (__lll_mutex_unlock_force): New function
4360         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
4362         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4363         (__lll_mutex_unlock_force): New function.
4364         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
4366         * tst-rwlock7.c (do_test): Use correct format specifier.
4368         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
4369         Find break parameter in correct asm argument.
4371 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
4373         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
4374         Remove out4.
4375         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
4376         error occured.
4377         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4378         Add __mutex.
4379         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
4380         lll_futex_requeue, lll_mutex_unlock_force): Define.
4382 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
4384         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4385         (pthread_cond_t): Add __mutex.
4386         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
4387         lll_futex_requeue, lll_mutex_unlock_force): Define.
4389 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4391         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
4392         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4393         Add __mutex field.
4394         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
4395         Define.
4396         (lll_futex_wait, lll_futex_wake): Define.
4397         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
4398         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
4399         FUTEX_REQUEUE instead of FUTEX_WAIT.
4400         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
4401         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
4402         mutex which was used in condvar structure.  Call
4403         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
4404         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
4406         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
4407         include tcb-offsets.h.  Read wakeup value in locked region.
4408         Use the value of gbr register as THREAD_ID.
4409         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4410         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4411         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4413         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
4414         macros.
4416 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
4418         * sysdeps/pthread/pthread_cond_broadcast.c
4419         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
4421 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
4423         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
4424         typo in register name.
4425         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
4426         correctly.  Actually use requeue.  Little optimization.
4427         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
4428         mutex address early.  Handle cancellation state as 32-bit value.
4429         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4430         Remove unnecessary label.
4432 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
4434         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
4435         instead of FUTEX_WAIT.
4436         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
4437         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4438         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4439         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4440         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4441         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
4442         used in condvar structure.  Call __pthread_mutex_cond_lock instead
4443         of __pthread_mutex_lock_internal.
4444         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4445         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4446         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4447         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
4448         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4449         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4450         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
4451         Add pthread_mutex_cond_lock.
4452         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
4453         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
4454         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
4455         lll_mutex_cond_lock.
4456         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
4457         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4458         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4459         Add __mutex field.
4460         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4461         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4463         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
4464         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4466         * pthreadP.h: Declare __pthread_mutex_cond_lock.
4467         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
4468         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
4469         macro don't define aliases.
4471         * cancellation.c: Remove __pthread_enable_asynccancel_2.
4472         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
4473         * sysdeps/pthread/pthread_cond_timedwait.c: Use
4474         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
4475         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4476         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4477         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4478         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4479         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4481 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
4483         * sem_open.c: Fix one endless loop.  Implement correct semantics
4484         wrt opening the same semaphore more then once.
4485         * sem_close.c: Adjust for sem_open change.
4486         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
4487         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
4488         * Makefile (tests): Add tst-sem7.
4489         * tst-sem7.c: New file.
4491 2003-05-16  Roland McGrath  <roland@redhat.com>
4493         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
4494         uninitialized variable braino.
4496 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
4498         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
4499         test for syscall availability.
4501         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
4502         __no_posix_timers to -1 if the syscalls don't exist.
4504         * pthread_join.c (pthread_join): Set tid field of the joined
4505         thread to -1.  This isn't necessary but helps to recognize some
4506         error conditions with almost no cost.
4508         * allocatestack.c (FREE_P): Also negative values indicate an
4509         unused stack.
4511         * unwind.c: Include <unistd.h>.
4513 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
4515         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
4517 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
4519         * Makefile (crti-objs, crtn-objs): New variables.
4520         (omit-deps, extra-objs): Add crtn.
4521         ($(objpfx)libpthread.so): Depend on both crti and crtn
4522         and links to them in multidir.
4523         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
4525 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
4527         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4528         (lll_mutex_unlock): Use atomic_exchange_rel.
4530 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
4532         * cond-perf.c (cons): Add missing locking around setting of alldone.
4534 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
4536         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
4537         related macros.
4538         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4540 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
4542         * tst-sem6.c: New file.
4543         * Makefile (tests): Add tst-sem6.
4545         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
4546         Use atomic_exchange_rel instead of atomic_exchange.
4547         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
4548         Likewise.
4550         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
4551         code for lll_futex_wait and lll_futex_wake in static apps.  Use
4552         vsyscall is possible.
4554         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
4555         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
4556         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
4557         pthread_setaffinity_np.
4558         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
4559         and pthread_setaffinity_np.
4560         * Makefile (libpthread-routines): Add pthread_getaffinity and
4561         pthread_setaffinity.
4563         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
4564         use it in case mmap to allocate the stack fails.
4565         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
4566         ARCH_MAP_FLAGS here.
4567         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
4568         ARCH_RETRY_MMAP.
4570 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
4572         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
4573         handler implementation.  It is now lockless in fork().
4574         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
4575         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
4576         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
4577         declare the __fork_*_lists.
4578         (struct fork_handler): Include pointers to all three functions.
4579         Add next, refcntr and need_signal elements.
4580         (__fork_handlers): New declaration.
4581         (__register_atfork_malloc): Remove declaration.
4582         (HAVE_register_atfork_malloc): Remove definition.
4583         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
4584         __pthread_child_handler variable.
4585         (__libc_pthread_init): Use __register_atfork instead of explicitly
4586         adding to the list.
4587         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
4588         and lll_futex_wake.
4589         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4591         * unwind.c (unwind_cleanup): Print error message and then abort.  This
4592         function must never be reached.
4594         * cond-perf.c: New file.
4596 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
4598         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
4600 2003-05-04  Roland McGrath  <roland@redhat.com>
4602         * Makefile ($(objpfx)../libc.so): New target.
4604 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
4606         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4607         (pthread_condattr_t): Size is only an int, don't use long for
4608         alignment.
4609         (pthread_mutexattr_t): Likewise.
4610         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4611         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4612         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4614 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
4616         * sysdeps/i386/tls.h: Define THREAD_ID.
4617         * sysdeps/ia64/tls.h: Likewise.
4618         * sysdeps/powerpc/tls.h: Likewise.
4619         * sysdeps/s390/tls.h: Likewise.
4620         * sysdeps/sh/tls.h: Likewise.
4621         * sysdeps/x86_64/tls.h: Likewise.
4622         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
4623         record ownership.
4624         * pthread_mutex_timedlock.c: Likewise.
4625         * pthread_mutex_trylock.c: Likewise.
4626         * pthread_mutex_unlock.c: Likewise.
4627         * pthread_rwlock_trywrlock.c: Likewise.
4628         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
4629         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4630         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4631         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4633         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
4634         flag.
4636 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
4638         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4639         (__SIZEOF_PTHREAD_COND_T): Define to 48.
4640         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
4641         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4642         Make __align long long instead of long.
4643         (pthread_rwlock_t): Formatting.
4644         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
4645         (pthread_rwlock_t): Formatting.
4646         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4647         (pthread_cond_t): Make __align long long instead of long.
4648         (pthread_rwlock_t): Move __flags field to the same position as in
4649         linuxthreads.
4651 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
4653         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
4654         * tst-rwlock7.c (do_test): Likewise.
4656 2003-04-26  Roland McGrath  <roland@redhat.com>
4658         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
4660 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
4662         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
4663         sizeof (struct pthread).
4664         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
4665         1 struct pthread.
4666         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
4667         to 0.
4668         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
4669         struct pthread.
4670         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
4671         to 32-bit bytes.
4672         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
4673         tcbp.
4674         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
4675         unneccessarily.
4676         (NO_TLS_OFFSET): Define.
4677         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
4678         add TLS_TCB_SIZE unnecessarily.
4680 2003-04-22  Roland McGrath  <roland@redhat.com>
4682         * Makeconfig (shared-thread-library): Reverse link order to work
4683         around linker bug.
4685 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
4687         * semaphore.h: Fix typo in comment.
4689 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
4691         * sysdeps/pthread/sigfillset.c: New file.
4693         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
4694         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
4695         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
4696         * sysdeps/pthread/sigaction.c: Likewise.
4697         * sysdeps/pthread/sigprocmask.c: New file.
4698         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
4699         __SIGRTMIN+1.
4700         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4701         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
4702         in this case.
4704 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
4706         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4707         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
4709         * sysdeps/unix/sysv/linux/unregister-atfork.c
4710         (__unregister_atfork): Don't free memory not allocated dynamically.
4712         * semaphore.h: Remove __THROW marker from cancellation points.
4713         * nptl/sysdeps/pthread/pthread.h: Likewise.
4715 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
4717         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
4718         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
4719         __THROW.
4721 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
4723         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
4725 2003-04-15  Roland McGrath  <roland@redhat.com>
4727         * forward.c (__pthread_unwind): Tweak to avoid warning.
4729 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
4731         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
4733 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
4735         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
4736         overflow CFA advance instructions.
4737         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4739 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
4741         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
4742         * sysdeps/i386/pthread_spin_lock.c: Likewise.
4743         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
4744         defined.
4746         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
4747         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
4748         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
4749         DW_CFA_advance_loc for .Laddl-.Lsubl.
4751 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
4753         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
4754         position-independent unwind data for static libraries.
4755         Add missing unwind info.  Add comments.
4757         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
4758         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4759         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4760         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4762 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
4764         * Makefile: Make sure all cancellation points are compiled with
4765         exception and asynchronous unwind tables.
4767         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
4768         which mishandles loading of global object addresses in PIC.
4769         (THREAD_SETMEM_NC): Likewise.
4771 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4773         * pthread.h: Define new data structure for cleanup buffer.  Declare
4774         new cleanup handler interfaces.
4775         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
4776         (struct pthread): Add cleanup_jmp_buf pointer.  Define
4777         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
4778         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
4779         it.  Declare old cleanup handler installation functions.
4780         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
4781         handling.
4782         * cleanup_defer.c: Likewise.
4783         * cleanup_compat.c: New file.  Old cleanup code.
4784         * cleanup_def_compat.c: New file.  Old cleanup code.
4785         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
4786         if own thread descriptor.
4787         * unwind.c: New file.
4788         * forward.c: Add __pthread_unwind.
4789         * init.c (pthread_functions): Add __pthread_unwind.
4790         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
4791         Add ptr___pthread_unwind.
4792         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
4793         and unwind function.
4794         * Makefile (libpthread-routines): Add cleanup_compat,
4795         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
4796         table generation if necessary.
4797         * version.c: Record whether unwind support is compiled in.
4798         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
4799         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
4800         handler interfaces.
4801         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
4802         complication to generate unwind information for syscall wrappers.
4803         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4804         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
4805         __cleanup_fct_attribute.
4807         * Makefile: Add rules to build and run tst-cleanup0.
4808         * tst-cleanup0.c: New file.
4809         * tst-cleanup0.expect: New file.
4811         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
4812         caller.  Optimize to avoid often unecessary local variable.
4814 2003-04-11  Roland McGrath  <roland@redhat.com>
4816         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
4817         sets variable `multidir'; include that.
4818         (generated): Add it.
4819         ($(objpfx)$(multidir)/crti.o): New target.
4820         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
4822 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4824         * tst-attr2.c (do_test): Add cast to avoid warning.
4825         * tst-mutex4.c (do_test): Likewise.
4827 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
4829         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
4830         in child.
4832 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
4834         * Makefile (tests): Add tst-detach1.
4835         * tst-detach1.c: New file.
4837 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
4839         * sysdeps/pthread/pthread.h: Remove duplicate
4840         pthread_cleanup_{push,pop} definitions.
4842         * tst-barrier2.c: Eliminate warnings.
4843         * tst-cancel4.c: Likewise.
4844         * tst-cond4.c: Likewise.
4845         * tst-cond6.c: Likewise.
4846         * tst-detach1.c: Likewise.
4847         * tst-rwlock4.c: Likewise.
4848         * tst-rwlock6.c: Likewise.
4849         * tst-rwlock7.c: Likewise.
4850         * tst-sem3.c: Likewise.
4851         * tst-spin2.c: Likewise.
4852         * tst-umask1.c: Likewise.
4854 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
4856         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
4858 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
4860         * descr.h (struct pthread): Move cancelhandling member to the front.
4862 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
4864         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
4865         malloc_parent, and malloc_child statically.
4866         (__register_atfork_malloc): New function.
4867         (free_mem): Don't free any of the malloc_* variables on the list.
4868         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
4869         Define HAVE_register_atfork_malloc.
4871 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
4873         * sysdeps/pthread/createthread.c (create_thread): Add some more
4874         comments explaining when to set multiple_threads and when not.
4876         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4877         THREAD_ATOMIC_BIT_SET if not already defined.
4878         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4879         THREAD_ATOMIC_BIT_SET:
4880         * sysdeps/x86_64/tls.h: Likewise.
4881         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
4882         THREAD_ATOMIC_CMPXCHG_VAL.
4883         (_pthread_cleanup_pop_restore): Likewise.
4884         * cancellation.c (__pthread_enable_asynccancel): Likewise.
4885         (__pthread_enable_asynccancel_2): Likewise.
4886         (__pthread_disable_asynccancel): Likewise.
4887         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4888         (__libc_disable_asynccancel): Likewise.
4889         * init.c (sigcancel_handler): Likewise.
4890         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
4891         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
4893 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
4895         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
4896         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4897         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
4898         * Makefile (tests): Add tst-cancel11.
4899         * tst-cancel11.c: New file.
4901 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
4903         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
4904         round, not the first.  Use specific_used flag instead of local
4905         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
4906         (__free_tcb): Don't call deallocate_tsd here.
4907         (start_thread): Call deallocate_tsd here.
4908         * pthread_setspecific.c: Set specific_used flag really only when
4909         needed.
4910         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
4911         * tst-tsd3.c: New file.
4912         * tst-tsd4.c: New file.
4914 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4916         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
4917         Use atomic_exchange_and_add instead of __lll_add.
4918         (__lll_mutex_timedlock): Likewise.
4919         Patch by Ian Wienand.
4921 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
4923         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4924         (SINGLE_THREAD_P): Fix typo.
4925         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
4927 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4929         * Makefile (tests): Add tst-align.
4930         * tst-align.c: New file.
4931         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
4933         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
4934         function correctly.
4936         * tst-tsd2.c: Add casts to avoid warnings.
4938 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
4940         * descr.h (struct pthread): Move most often used elements to the front.
4942 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
4944         * Makefile (libpthread-routines): Add pthread_atfork.
4945         (libpthread-static-only-routines): Add pthread_atfork.
4947 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4949         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
4950         of TLS_DTV_AT_TP.
4951         (INSTALL_DTV): Add parens.
4952         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
4953         Use passed descr instead of THREAD_SELF.
4954         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
4955         (__lll_mutex_timedlock_wait): Correct expected value after
4956         spurious wakeup.
4957         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
4958         Release lock before waking up the waiters.
4959         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
4960         criteria.  Reorderstruct passed to cleanup handler.  Fix
4961         handling of cancellation and failung pthread_mutex_unlock call.
4962         Use __pthread_enable_asynccancel_2 instead of
4963         __pthread_enable_asynccancel.
4964         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4965         Return result of lock re-get if it fails.
4966         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
4967         for __pthread_cleanup_push.
4968         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
4969         completely broken rwlock implementation.
4970         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4971         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4972         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4973         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
4974         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4975         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
4976         versioned_symbol macro.
4977         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
4978         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4980 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
4982         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
4983         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
4984         and __helper_tid.
4985         (struct timer): Remove th and bar field.
4986         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
4987         debugging code.  Create only one helper thread.
4988         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
4989         helper thread.
4990         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4991         Renamed.  Define statically.  Use thread info from siginfo.
4992         (__helper_once): New variable.
4993         (__helper_tid): New variable.
4994         (__reset_helper_control): New function.
4995         (__start_helper_thread): New function.
4997         * pthread_create.c (start_thread): Don't use setjmp inside
4998         __builtin_expect to work around gcc bug.
5000         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
5001         timer_delete syscall fails, but not with ENOSYS, set
5002         __no_posix_timers.
5004         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
5005         (timer_settime): Fix typo.
5006         * sysdeps/unix/sysv/linux/timer_getoverr.c
5007         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
5009 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
5011         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
5012         offset of cleanupbuf.__prev.
5014 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
5016         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
5017         of included file.
5019 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
5021         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
5022         NULL provide default definition to syscall.
5024 2003-03-25  Roland McGrath  <roland@redhat.com>
5026         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
5027         (timer_id2ptr): Fix typo.
5029 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
5031         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
5032         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
5033         * sysdeps/ia64/pthreaddef.h: Likewise.
5034         * sysdeps/powerpc/pthreaddef.h: Likewise.
5035         * sysdeps/s390/pthreaddef.h: Likewise.
5036         * sysdeps/sh/pthreaddef.h: Likewise.
5037         * sysdeps/x86_64/pthreaddef.h: Likewise.
5038         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
5039         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
5040         being changed.
5041         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
5042         SIGTIMER is not unblocked.
5043         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
5044         RT signal taken.
5045         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
5046         be send.
5047         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
5048         pass pointer through as ID.
5049         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
5050         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
5051         * sysdeps/unix/sysv/linux/timer_create.c: New file.
5052         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
5053         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
5054         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
5055         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
5056         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
5057         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
5058         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
5059         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
5060         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
5061         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
5062         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
5063         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
5064         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
5065         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
5066         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
5067         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
5068         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
5069         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
5070         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
5071         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
5072         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
5073         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
5074         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
5075         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
5076         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
5077         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
5078         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
5079         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
5080         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
5081         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
5083         * pthreadP.h: Remove FRAME_LEFT definition.
5084         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
5085         already left frame.  Programs which have this problem are not POSIX
5086         compliant.
5087         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
5089 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
5091         * sysdeps/pthread/tst-timer.c: Check return values of the
5092         functions we test.
5094 2003-03-23  Roland McGrath  <roland@redhat.com>
5096         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
5097         * tst-tls3mod.c: Likewise.
5098         * tst-tls1.c: Likewise.
5099         * tst-tls2.c: Likewise.
5101         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
5102         undefined behavior.
5104         * tst-join5.c (tf1, tf2): Add a cast.
5106         * Makeconfig (includes): Append -I$(..)nptl to this variable.
5108         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
5109         Don't test anything.
5110         * tst-cond4.c: Likewise.
5111         * tst-cond6.c: Likewise.
5112         * tst-flock2.c: Likewise.
5113         * tst-mutex4.c: Likewise.
5114         * tst-rwlock4.c: Likewise.
5115         * tst-signal1.c: Likewise.
5116         * tst-spin2.c: Likewise.
5117         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
5119         * tst-mutex4.c: Use test-skeleton.c.
5120         * tst-spin2.c: Likewise.
5121         * tst-sysconf.c: Likewise.
5122         * tst-barrier2.c: Likewise.
5123         * tst-cond4.c: Likewise.
5124         * tst-cond6.c: Likewise.
5125         * tst-rwlock4.c: Likewise.
5126         * tst-unload.c: Likewise.
5127         * tst-flock2.c (do_test): Use return instead of exit.
5129 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
5131         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
5133 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
5135         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
5136         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
5137         instead of __lll_compare_and_swap.
5138         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
5139         Likewise.
5140         Removed definition if __lll_compare_and_swap.
5142         * cancellation.c: Adjust for new form of compare&exchange macros.
5143         * cleanup_defer.c: Likewise.
5144         * init.c: Likewise.
5145         * libc-cancellation.c: Likewise.
5146         * old_pthread_cond_broadcast.c: Likewise.
5147         * old_pthread_cond_signal.c: Likewise.
5148         * old_pthread_cond_timedwait.c: Likewise.
5149         * old_pthread_cond_wait.c: Likewise.
5150         * pthread_cancel.c: Likewise.
5151         * pthread_create.c: Likewise.
5152         * pthread_detach.c: Likewise.
5153         * pthread_join.c: Likewise.
5154         * pthread_key_delete.c: Likewise.
5155         * pthread_setcancelstate.c: Likewise.
5156         * pthread_setcanceltype.c: Likewise.
5157         * pthread_timedjoin.c: Likewise.
5158         * pthread_tryjoin.c: Likewise.
5159         * sysdeps/pthread/createthread.c: Likewise.
5161 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
5163         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
5164         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
5165         definitions.  Replace uses with calls to atomic_* functions.
5166         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5167         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
5168         __lll_test_and_set calls with atomic_exchange_and_add and
5169         atomic_exchange calls respectively.
5170         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
5171         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
5172         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
5173         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
5174         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
5175         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
5176         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
5178         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
5179         returns the old value.
5181 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
5183         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
5184         int for variable OLDVAL and correct inline assembler contraint.
5185         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
5186         type int for variable OLD.
5188         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
5189         only for s390-32.
5190         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
5191         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
5192         instead of multiple_threads field in the TCB.
5194 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
5196         * sysdeps/i386/i686/bits/atomic.h: Removed.
5197         * sysdeps/i386/i586/bits/atomic.h: Removed.
5198         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
5199         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
5200         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
5201         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
5202         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
5203         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
5204         * atomic.h: Removed.  Moved to glibc.
5206         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
5207         support for clock selection.
5209         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
5210         signalling waiters.
5212 2003-03-18  Roland McGrath  <roland@redhat.com>
5214         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
5215         Add __lll_rel_instr first.  Add memory clobber.
5216         (lll_mutex_unlock): Use __lll_test_and_set.
5217         From Paul Mackerras <paulus@samba.org>.
5219         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
5220         unconditionally.
5221         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
5222         (SINGLE_THREAD_P):  Add `header.' prefix.
5223         From Paul Mackerras <paulus@samba.org>.
5225         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
5226         pthread_timedjoin_np to ...
5227         (libpthread: GLIBC_2.3.3): ... here.
5228         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
5230         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5231         Avoid shadowing VAL variable.
5233         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
5234         New macro.
5236 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
5238         * Makefile (tests): Add tst-cond11.
5239         * tst-cond11.c: New file.
5241         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
5242         struct passed to cleanup handler to eliminate one more
5243         instruction.
5244         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5246         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5247         (pthrad_cond_t): Replace __unused field with __clock.
5249         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
5250         waken all waiters in cleanup handler.
5251         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5252         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5254         * pthread_condattr_getclock.c: New file.
5255         * pthread_condattr_setclock.c: New file.
5256         * sysdeps/pthread/pthread.h: Declare these new functions.
5257         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
5258         * Makefile (libpthread-routines): Add the new functions.
5259         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
5260         Renamed field to value.  Document use of the bits.
5261         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
5262         change.
5263         * pthread_condattr_setpshared.c: Likewise.
5264         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
5265         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
5266         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5267         Add __clock field.
5268         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5269         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5270         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5271         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5272         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
5273         Implement clock selection.
5274         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5275         * pthread-errnos.sym: Add ENOSYS.
5276         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5277         _POSIX_CLOCK_SELECTION.
5278         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5280         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
5281         invalid .size directive.
5283 2003-03-17  Roland McGrath  <roland@redhat.com>
5285         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
5286         Formatting tweaks.
5288 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
5290         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
5291         Use __lll_add instead of spelling it out.  Use protected symbol names.
5292         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
5293         Use __lll_add.
5294         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
5295         Renamed from lll_compare_and_swap.  Use new name where necessary.
5296         (__lll_add): Defined.
5297         (__lll_dec_if_positive): Defined.
5298         (__lll_test_and_set): Defined.
5299         * sysdeps/ia64/pthread_spin_init.c: Removed.
5300         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
5301         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
5302         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
5303         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
5304         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
5305         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
5306         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
5307         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
5308         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
5309         __sync_lock_release_si.
5310         Patch by Jakub Jelinek.
5312         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
5313         Fix timeout handling.
5314         (__lll_timedwait_tid): Likewise.
5315         (lll_unlock_wake_cb): Wake up other waiters if necessary.
5316         Patch by Jakub Jelinek.
5318         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
5320 2003-03-17  Roland McGrath  <roland@redhat.com>
5322         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
5323         * sysdeps/pthread/pthread_spin_init.c: New file.
5324         * sysdeps/pthread/pthread_spin_unlock.c: New file.
5325         * sysdeps/powerpc/Makefile: New file.
5326         * sysdeps/powerpc/pthread_spin_lock.c: New file.
5327         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
5328         * sysdeps/powerpc/pthreaddef.h: New file.
5329         * sysdeps/powerpc/tcb-offsets.sym: New file.
5330         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
5331         * sysdeps/powerpc/tls.h: New file.
5332         * sysdeps/powerpc/bits/atomic.h: New file.
5333         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
5334         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
5335         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
5337         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
5338         * sysdeps/unix/sysv/linux/sem_post.c: New file.
5339         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
5340         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
5341         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
5342         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
5343         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
5344         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
5345         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
5346         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
5347         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
5348         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
5349         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
5350         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
5351         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
5353         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
5354         not gettimeofday.
5355         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
5356         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
5357         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
5358         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
5359         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5361 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
5363         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
5364         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5365         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5366         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5367         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
5369 2003-03-16  Roland McGrath  <roland@redhat.com>
5371         * tst-fork4.c: Include <string.h>.
5372         * tst-signal2.c: Likewise.
5373         * tst-mutex5.c (do_test): exit -> return.
5374         * tst-mutex2.c: Include <stdlib.h>.
5376 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
5378         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
5379         (__lll_mutex_timedlock_wait): Correct expected value after
5380         spurious wakeup.  Otherwise we would never wait again.
5382         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
5383         zone versus inline asm stupidity.  Use correct instructions.
5385         * tst-rwlock6.c: Add some more status output.
5387 2003-03-15  Roland McGrath  <roland@redhat.com>
5389         * sysdeps/pthread/configure.in: New file.
5390         * sysdeps/pthread/configure: New file (generated).
5392 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5394         * allocatestack.c (allocate_stack): Store the exact stack size of
5395         user allocated stacks.
5397 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
5399         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
5400         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
5401         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5402         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
5403         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
5404         Use `header.' prefix.
5405         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5407 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5409         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
5410         __builtin_frame_address, use stack pointer.
5412         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
5413         instead of __builtin_frame_pointer.
5415 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5417         * tst-basic1.c (do_test): Add cast to avoid warning.
5418         * tst-basic2.c (do_test): Likewise.
5420         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
5421         amount of stack correction.
5423         * tst-fork4.c: Use test-skeleton.c.
5425 2003-03-14  Roland McGrath  <roland@redhat.com>
5427         * init.c: Fix typo "#eli" for "#else".
5429 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
5431         * allocatestack.c (__stack_user): Use hidden_data_def.
5432         * pthread_create.c (__pthread_keys): Likewise.
5434         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
5436 2003-03-14  Roland McGrath  <roland@redhat.com>
5438         * tst-fork4.c: New file.
5439         * Makefile (tests): Add it.
5441         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
5442         we always define the padding space.
5443         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
5444         stopped supporting its own extensions fully.
5445         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
5446         struct also called `header', so `header.multiple_threads' is the field
5447         name to use on all machines.
5448         * allocatestack.c (allocate_stack): Use `header.' prefix.
5449         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5450         * pthread_create.c (__pthread_create_2_1): Likewise.
5451         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
5452         (THREAD_SELF): Likewise.
5453         * sysdeps/x86_64/tls.h: Likewise.
5454         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5455         (SINGLE_THREAD_P): Likewise.
5456         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5457         (SINGLE_THREAD_P): Likewise.
5458         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
5459         (SINGLE_THREAD_P): Likewise.
5461         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
5462         value directly.
5464 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5466         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
5467         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
5469         * pthread_create.c (start_thread): setjmp is expected to return 0.
5471         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
5472         (THREAD_GETMEM_NC): Likewise.
5474 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
5476         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
5477         and the size of the stack which must be allocated is a multiple,
5478         allocate one more page.
5479         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
5480         MULTI_PAGE_ALIASING.
5482 2003-03-13  Roland McGrath  <roland@redhat.com>
5484         * pthread_create.c (start_thread): Set EXITING_BIT after the
5485         event-reporting (and destructors), not before.
5487 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
5489         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
5490         lll_futex_wake): Declare register variables as long int instead of
5491         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
5492         Make syscall arguments clobbered by the syscall.
5493         (lll_futex_wait): Define using lll_futex_timed_wait.
5495         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
5496         to void *.
5498         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
5499         PPID if [! NDEBUG].
5501         * allocatestack.c (nptl_ncreated): Only declare if
5502         COLORING_INCREMENT != 0.
5504         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
5505         (__libc_enable_asynccancel_2): Remove prototype.
5507         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
5508         ctid to match kernel.
5510 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5512         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
5513         libc_multiple_threads.
5514         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
5515         __libc_multiple_threads to...
5516         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
5518         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
5519         versioning.
5520         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5521         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5523         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
5524         (__pthread_once_internal): Define.
5526         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
5527         macros instead of .symver directly.
5528         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5529         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
5531         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
5532         * sysdeps/x86_64/tcb-offsets.sym: New file.
5533         * sysdeps/x86_64/Makefile: New file.
5535         * sysdeps/i386/tcb-offsets.sym: Add SELF.
5536         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
5537         to access own pthread_t in TCB.
5538         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5539         Likewise.
5540         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5541         Likewise.
5542         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5544 2003-03-12  Roland McGrath  <roland@redhat.com>
5546         * pthread-errnos.sym: New file.
5547         * Makefile (gen-as-const-headers): New variable, list that file.
5548         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
5549         header <pthread-errnos.h> instead of defining errno values here.
5550         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5551         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5552         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5553         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5554         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5555         Likewise.
5556         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5557         Likewise.
5558         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5559         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5560         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5561         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5562         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5563         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5564         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5565         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5566         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5567         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5568         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5569         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
5570         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
5571         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
5572         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
5573         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5574         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5575         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5576         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5577         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5578         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5579         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5580         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
5581         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
5582         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
5583         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5584         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5586         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
5587         CLONE_CHILD_SETTID worked.
5589 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5591         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
5592         file.
5593         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
5594         file.
5596         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5597         (pthread_cond_t): Add padding.
5599         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
5600         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
5601         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
5603         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
5604         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
5605         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
5606         (__pthread_rwlock_timedrdlock): Likewise.
5607         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
5608         (__pthread_rwlock_wrlock): Likewise.
5609         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
5610         (__pthread_rwlock_rdlock): Likewise.
5612         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
5614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
5615         result of lock re-get if it fails.
5617 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5619         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
5620         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5621         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5622         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5623         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5624         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5625         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5626         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5627         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5628         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5630         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
5631         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
5633         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
5634         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
5635         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
5636         (create_thread): Likewise.
5637         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
5638         * init.c (__pthread_initialize_minimal_internal): Initialize
5639         __libc_multiple_threads_ptr if necessary.
5640         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
5641         __pthread_multiple_threads and __libc_multiple_threads_ptr.
5642         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
5643         __libc_multiple_threads.
5644         (__libc_pthread_init): Return pointer to __libc_pthread_init if
5645         necessary.
5647         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
5648         (THREAD_SETMEM_NC): Likewise.
5650         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
5651         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
5652         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
5653         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
5655         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
5656         Eliminate one entire instruction.
5658         * cancellation.c (__pthread_enable_asynccancel_2): New function.
5659         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
5660         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5661         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
5662         instead of __pthread_enable_asynccancel.
5663         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5664         (__pthread_cond_wait): Likewise.
5665         * sysdeps/pthread/pthread_cond_timedwait.c
5666         (__pthread_cond_timedwait): Likewise.
5667         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5669         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5670         (__condvar_cleanup): Wake up all waiters in case we got signaled
5671         after being woken up but before disabling asynchronous
5672         cancellation.
5673         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5674         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5675         (__condvar_cleanup): Likewise.
5677         * init.c (__NR_set_tid_address): If already defined, don't redefine.
5678         Make it an error if architecture has no #if case.  Add x86-64.
5680         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
5681         pt-initfini.s generation.
5683         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
5684         (TLS_INIT_TP): Fix typo.
5686 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5688         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
5689         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
5691         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
5692         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
5693         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
5694         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
5695         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
5696         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5697         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5698         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5700 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5702         * sysdeps/pthread/pthread_cond_timedwait.c
5703         (__pthread_cond_timedwait): Return the result of the final
5704         locking.  If it succeeds, the regular function return value.
5706         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
5707         Return result of the final locking.
5708         * version.c (__nptl_main): Work around problems with the strange
5709         INTERNAL_SYSCALL macro on ppc32.
5710         * init.c (__pthread_initialize_minimal_internal): Unblock
5711         SIGCANCEL in case the parent blocked it.
5712         Reported by Paul Mackerras <paulus@samba.org>.
5714         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
5715         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
5716         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
5718 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5720         * sysdeps/pthread/pthread_cond_timedwait.c
5721         (__pthread_cond_timedwait): Unlock and fail if
5722         __pthread_mutex_unlock_internal failed.
5724         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
5725         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
5726         Use ARCH_CLONE.
5727         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
5728         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
5729         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
5730         ALLOCATE_STACK): New macros.
5731         (TLS_TPADJ): New macro.
5732         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
5733         (allocate_stack): Handle TLS_DTV_AT_TP and
5734         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
5735         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
5736         Don't set PD->self.
5737         * init.c [__ia64__] (__NR_set_tid_address): Define.
5739         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
5740         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
5741         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
5742         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
5743         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
5744         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
5745         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
5746         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
5747         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
5748         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
5749         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
5750         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
5751         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
5752         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
5753         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
5754         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
5755         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
5756         * sysdeps/ia64/bits/atomic.h: New file.
5757         * sysdeps/ia64/Makefile: New file.
5758         * sysdeps/ia64/pthread_spin_init.c: New file.
5759         * sysdeps/ia64/pthread_spin_lock.c: New file.
5760         * sysdeps/ia64/pthread_spin_trylock.c: New file.
5761         * sysdeps/ia64/pthread_spin_unlock.c: New file.
5762         * sysdeps/ia64/pthreaddef.h: New file.
5763         * sysdeps/ia64/tcb-offsets.sym: New file.
5764         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
5765         * sysdeps/ia64/tls.h: New file.
5767         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
5768         to syscall instead of no arguments.
5770 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
5772         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
5773         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
5774         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
5775         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
5777         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
5778         unused code.
5780         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
5782         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5783         lowlevelbarrier.sym.
5784         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
5785         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
5786         Include lowlevelbarrier.h and don't define offsets locally.
5787         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
5789         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
5790         (__lll_mutex_lock_wait): Reverse order of first two parameters.
5791         (__lll_mutex_timedlock_wait): Likewise.
5792         (lll_mutex_lock): Adjust asm for that.
5793         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
5794         (lll_lock): Adjust asm for operand order change.
5795         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
5796         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
5798         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
5799         Reverse order of parameters.
5800         (__lll_timedwait_tid): Remove regparms attribute.
5801         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
5802         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
5804         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5805         (__lll_timedwait_tid): Remove one unnecessary instruction.
5807         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
5808         __lll_mutex_timedlock_wait only for NOT_IN_libc.
5809         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
5810         lowlevelmutex.S.
5812         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
5813         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
5814         for NOT_IN_libc.
5815         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
5816         lowlevellock.S.
5818         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
5819         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
5820         for libc.so.
5821         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
5822         define LOCK here (if UP is not defined).  The actual code is in
5823         lowlevelmutex.S.
5825         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
5826         LOCK is already defined.  Don't define lll_unlock_wake_cb and
5827         __lll_timedwait_tid for libc.so.
5828         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
5829         define LOCK here (if UP is not defined).  The actual code is in
5830         lowlevellock.S.
5832         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
5833         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
5834         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
5835         instead of lowlevelsem.h.
5836         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5837         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5838         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5840         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5841         lowlevelrwlock.sym.
5842         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
5843         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
5844         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
5846         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
5847         register loading.
5848         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
5849         last changed.  D'oh.
5851         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
5853         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
5854         of __libc_locking_needed.
5855         (lll_trylock): Initialize %eax to zero.
5857         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
5858         pthread_cond_t definition.
5860 2003-03-10  Roland McGrath  <roland@redhat.com>
5862         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
5863         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
5864         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
5865         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
5866         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
5868         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
5869         Instead of setting PD->multiple_threads, set globals
5870         __pthread_multiple_threads and __libc_multiple_threads.
5871         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5872         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
5873         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
5875         * descr.h (struct pthread): Conditionalize first member on
5876         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
5877         containing an anonymous tcbhead_t.  Move `list' member out.
5878         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
5879         * allocatestack.c: Remove use of `header.data.' prefix.
5880         * pthread_create.c: Likewise.
5881         * init.c (__pthread_initialize_minimal_internal): Likewise.
5882         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5883         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
5884         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
5885         * sysdeps/x86_64/tls.h: Likewise.
5886         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5887         (SINGLE_THREAD_P): Likewise.
5888         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5889         (SINGLE_THREAD_P): Likewise.
5890         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
5891         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
5893 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
5895         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
5897         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
5898         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5900         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
5901         leftovers from the ia32 code.
5903         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
5904         memory load.
5905         (clear_once_control): Don't load %esi.
5907         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
5908         handling.
5910         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5912         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
5913         * sysdeps/unix/sysv/linux/createthread.c: ...here.
5915         * Makefile (tests): Add tst-cond10.
5916         * tst-cond10.c: New file.
5918 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
5920         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
5921         * tst-signal3.c (do_test): Likewise.
5922         * tst-sem5.c (do_test): Likewise.
5923         * tst-kill6.c (do_test): Likewise.
5924         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
5926         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
5927         of inc/dec.
5928         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
5929         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
5930         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5931         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5932         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5933         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5934         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5935         Likewise.
5936         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5937         Likewise.
5938         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5939         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5940         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5941         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5942         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5943         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
5944         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5945         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5947         * allocatestack.c (allocate_stack): If mprotect() fails free the
5948         TLS memory.
5950 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
5952         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
5954         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
5955         lll_wake_tid.  This was used only to work around kernel limits in
5956         the early days.
5957         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
5958         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
5959         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5960         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
5962         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
5963         (__pthread_initialize_minimal_internal): Change initialization of
5964         __static_tls_align_m1 appropriately.
5965         * pthreadP.h (__static_tls_align_m1): Renamed from
5966         __static_tls_align.
5967         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
5968         instead of __static_tls_align-1.
5970 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
5972         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
5974         * pthread_create.c: Define __pthread_keys using nocommon
5975         attribute, not by placing it explicitly in bss.
5976         Remove DEFINE_DEALLOC definition.  Not needed anymore.
5978         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
5979         Use it in mmap call to allocate stacks.
5981         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
5983         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
5984         result of the thread function.
5986 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
5988         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
5989         version is just fine.
5991         * sysdeps/unix/sysv/linux/libc_pthread_init.c
5992         (__pthread_child_handler): Renamed from pthread_child_handler,
5993         exported, and marked hidden.  Change all users.
5994         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
5995         free __pthread_child_handler from child list.
5997 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5999         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
6001         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6002         Fix handling of cancellation and failing pthread_mutex_unlock call.
6003         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
6004         (__pthread_cond_wait): Likewise.
6006         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
6007         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
6008         lll_futex_timed_wait call.
6009         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
6010         (pthread_rwlock_timedwrlock): Likewise.
6012         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6013         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
6014         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
6016         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
6017         check of lll_futex_wake return value.
6019 2003-03-03  Roland McGrath  <roland@redhat.com>
6021         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
6023         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6024         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
6025         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
6027 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
6029         * sysdeps/pthread/timer_create.c (timer_create): Return correct
6030         error for CPU clocks.
6032         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6033         _POSIX_MONOTONIC_CLOCK.
6034         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6036         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
6037         recent kernels.
6039 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
6041         * descr.h (struct pthread): Move cleanup field to the front.
6043 2003-03-01  Roland McGrath  <roland@redhat.com>
6045         * sem_open.c (sem_open): Braino fix.
6047 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
6049         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
6050         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
6051         __pthread_cleanup_pop functionality.
6052         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6054         * descr.h (struct pthread): Move tid field to the front now that
6055         it is often used.
6057         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
6058         (__lll_mutex_timedlock_wait): Remove.
6059         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
6060         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6061         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
6062         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6063         (lll_unlock_wake_cb): Don't save and restore %esi.
6064         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
6065         %esi.
6066         (__lll_timedwait_tid): Add alignment.
6067         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
6068         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
6069         %esi.
6070         (__lll_timedwait_tid): Removed.
6071         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6072         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
6073         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
6074         (pthread_barrier_wait): Don't save, load, and restore %esi for
6075         last thread.
6076         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6077         (__pthread_cond_signal): Don't save, load, and restore %esi.
6078         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
6079         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
6080         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
6081         Don't save, load, and restore %esi.
6083 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
6085         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
6086         Release lock before waking up the waiters.
6088         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
6090         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
6091         (reader_thread): Likewise.
6093         * sysdeps/pthread/pthread_rwlock_unlock.c
6094         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
6095         to wake up readers if there are none.
6097         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
6098         Release internal lock before wake threads.
6100 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
6102         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
6103         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
6104         predefined.
6105         * tst-rwlock9.c: Likewise.
6106         * tst-rwlock10.c: New file.
6107         * tst-rwlock11.c: New file.
6109         * Makefile (tests): Add tst-dlsym1.
6110         * tst-dlsym1.c: New file.
6112         * init.c (__pthread_initialize_minimal_internal): Set
6113         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
6114         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
6116 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
6118         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
6120         * tst-cond2.c: Fix sychronization with child.
6122         * tst-rwlock8.c (reader_thread): Remove unused variable.
6124         * Makefile: Add rules to build and run tst-tls3.
6125         * tst-tls3.c: New file.
6126         * tst-tls3mod.c: New file.
6128         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
6129         * tst-rwlock8.c: New file.
6130         * tst-rwlock9.c: New file.
6131         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
6132         complete broken rwlock implementation.
6133         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6134         Likewise.
6135         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6136         Likewise.
6137         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6138         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6139         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6140         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6141         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6142         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
6143         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6145 2003-02-23  Roland McGrath  <roland@redhat.com>
6147         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
6149 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
6151         * Makefile (tests): Add tst-context1.
6152         * tst-context1.c: New file.
6154         * Makefile (tests): Add tst-tls1 and tst-tls2.
6155         * tst-tls1.c: New file.
6156         * tst-tls2.c: New file.
6158         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
6159         for failed cmpxchg.
6161         * pthread_create.c (start_thread): Set EXITING_BIT early.
6163         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
6164         (THREAD_GETMEM_NC): Likewise.
6166 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
6168         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
6169         off 3 more bytes by using offset-less instructions when possible.
6171         * Makefile: Add dependency for $(objpfx)version.d.
6173         * eintr.c (eintr_source): Add unnecessary return but the compiler
6174         insists.
6176         * tst-kill3.c: Include <unistd.h>.
6178 2003-02-21  Roland McGrath  <roland@redhat.com>
6180         * pthread_create.c (start_thread): Call __libc_thread_freeres.
6182 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
6184         * Makefile (tests): Add tst-eintr1.
6185         (distribute): Add eintr.c.
6186         * tst-eintr1.c: New file.
6187         * eintr.c: New file.
6189         * pthread_cancel.c (pthread_cancel): Use tkill directly.
6191         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
6192         Disallow sending SIGCANCEL.
6194         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
6195         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
6196         * tst-kill1.c: New file.
6197         * tst-kill2.c: New file.
6198         * tst-kill3.c: New file.
6199         * tst-kill5.c: New file.
6200         * tst-kill6.c: New file.
6201         * tst-basic7.c: Renamed to...
6202         * tst-kill4.c: ...this.
6204 2003-02-21  Roland McGrath  <roland@redhat.com>
6206         * Makefile (install-lib-ldscripts): New variable.
6208 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
6210         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
6211         * pthread_cancel.c: Use INVALID_TD_P.
6212         * pthread_detach.c: Likewise.
6213         * pthread_getschedparam.c: Likewise.
6214         * pthread_setschedparam.c: Likewise.
6215         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6216         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6217         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
6218         * pthread_timedjoin.c: Likewise.
6220         * tst-basic7.c: Include <signal.h>.
6222         * pthread_join.c (pthread_join): Limited checking for invalid
6223         descriptors.
6224         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
6226 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
6228         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
6229         beginning of the loop.  Clear the entire first block of TSD.
6230         * Makefile (tests): Add tst-key4.
6231         * tst-key4.c: New file.
6233 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
6235         * Makefile (tests): Add tst-basic7.
6236         * tst-basic7.c: New file.
6238         * pthread_create.c (deallocate_tsd): Mark as internal_function.
6239         Add some more __builtin_expect.
6241         * pthreadP.h: Define dummy version of DEBUGGING_P.
6243 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
6245         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
6246         _POSIX_THREAD_PRIORITY_SCHEDULING.
6247         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
6248         _XOPEN_REALTIME_THREADS.
6249         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
6251         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
6252         kernel returns EINVAL for PID <= 0, work around it.
6254         * Makefile (tests): Add tst-signal5.
6255         * tst-signal5.c: New file.
6257         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
6258         and LOGIN_NAME_MAX.
6260         * tst-cancel1.c (tf): Block all signals.
6262         * Makefile (tests): Add tst-basic6.
6263         * tst-basic6.c: New file.
6265         * tst-basic1.c: Add test for process ID.
6267         * Makefile (tests): Add tst-cancel10.
6268         * tst-cancel10.c: New file.
6270         * Makefile (tests): Add tst-signal4.
6271         * tst-signal4.c: New file.
6273         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
6274         __sigismember instead of sigismember.  Add __builtin_expect.
6276 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
6278         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
6279         pthread_setcancelstate, and pthread_rwlock_setpshared.
6281         * tst-cancel7.c (do_test): Make sure the pid file exists before
6282         canceling the thread.
6284         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
6285         pthread_rwlock_timedrdlock tests.
6286         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
6287         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6288         Check for invalid tv_nsec field.
6289         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6290         Likewise.
6292         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
6293         recursive mutex of overflow.
6295         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
6297         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
6298         going into an endless loop.
6299         * Makefile (tests): Add tst-cancel9.
6300         * tst-cancel9.c: New file.
6302         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
6304 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
6306         * tst-mutex5.c (do_test): Add more timedlock tests.
6308         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
6309         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
6311         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
6312         use INLINE_SYSCALL.  Error number is returned, not -1.
6314         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
6315         and __deallocate_stack with internal_function.
6316         * pthread_create.c: Adjust definitions appropriately.
6317         * allocatestack.c: Likewise.
6319         * pthread_join.c: Add one more __builtin_expect.
6320         * pthread_timedjoin.c: Likewise.
6322         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
6323         not data of sequence number does not match.
6324         Add one __builtin_expect.
6326         * Makefile (tests): Add tst-clock1.
6327         * tst-clock1.c: New file.
6329         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
6330         negative arguments.
6331         * Makefile (tests): Add tst-basic5.
6332         * tst-basic5.c: New file.
6334 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
6336         * Makefile (tests): Add tst-basic4.
6337         * tst-basic4.c: New file.
6339         * pthreadP.h: Add declaraction for __nptl_nthreads.
6340         * pthread_create.c: Define __nptl_nthreads
6341         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
6342         after thread is done.  If then zero, call exit(0).
6343         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6344         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
6345         * init.c (pthread_functions): Initialize ptr_nthreads.
6346         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
6347         (__reclaim_stacks): Decrement __nptl_nthreads.
6348         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
6349         Define.
6350         * Makefile (tests): Add tst-basic3.
6351         * tst-basic3.c: New file.
6353         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
6354         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
6355         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
6356         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
6357         if asynchronous canceling is enabled.
6358         * pthread_join.c (pthread_join): When recognizing circular joins,
6359         take into account the other thread might be already canceled.
6360         * Makefile (tests): Add tst-join5.
6361         * tst-join5.c: New file.
6363         * Makefile (tests): Add tst-join4.
6364         * tst-join4.c: New file.
6366 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
6368         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
6370 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6372         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
6373         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
6374         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
6375         warning.
6376         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
6377         to avoid warning.
6378         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
6379         error if lll_futex_wake failed.
6381 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
6383         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
6384         handling of cancellation and failung pthread_mutex_unlock call.
6385         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6386         * Makefile (tests): Add tst-cond8 and tst-cond9.
6387         * tst-cond8.c: New file.
6388         * tst-cond9.c: New file.
6390         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
6392         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
6393         non-standard initializers with __USE_GNU.
6395         * Makefile (tests): Add tst-cleanup3.
6396         * tst-cleanup3.c: New file.
6398 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
6400         * Makefile (tests): Add tst-attr1 and tst-attr2.
6401         * tst-attr1.c: New file.
6402         * tst-attr2.c: New file.
6404         * Makefile: Add rules to build and run tst-atfork2 test.
6405         * tst-atfork2.c: New file.
6406         * tst-atfork2mod.c: New file.
6408         * sysdeps/unix/sysv/linux/unregister-atfork.c
6409         (__unregister_atfork): Free the memory allocated for the handlers
6410         after removing them from the lists.
6412         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
6413         cleanup function.
6415         * tst-atfork1.c (do_test): Wait for the child we forked.
6416         Report error in child.
6418         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
6420         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
6422 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
6424         * Makefile (tests): Add tst-cancel8.
6425         * tst-cancel8.c: New file.
6427         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
6428         clearing of control variable.
6429         * Makefile (tests): Add tst-once3 and tst-once4.
6430         * tst-once3.c: New file.
6431         * tst-once4.c: New file.
6433 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
6435         * sysdeps/sh/Makefile: New file.
6436         * sysdeps/sh/bits/atomic.h: New file.
6437         * sysdeps/sh/pthread_spin_init.c: New file.
6438         * sysdeps/sh/pthread_spin_lock.c: New file.
6439         * sysdeps/sh/pthread_spin_trylock.S: New file.
6440         * sysdeps/sh/pthread_spin_unlock.S: New file.
6441         * sysdeps/sh/pthreaddef.h: New file.
6442         * sysdeps/sh/tcb-offsets.sym: New file.
6443         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
6444         * sysdeps/sh/tls.h: New file.
6445         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
6446         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
6447         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
6448         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
6449         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
6450         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
6451         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
6452         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
6453         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
6454         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
6455         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
6456         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
6457         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
6458         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
6459         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
6460         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
6461         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
6462         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
6463         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
6464         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
6465         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
6466         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
6467         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
6468         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
6469         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
6470         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
6471         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
6472         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
6473         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
6474         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
6476 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
6478         * tst-cond2.c: Rearrange code to not rely on behavior undefined
6479         according to POSIX.
6481         * tst-basic2.c (do_test): Lock mutex before creating the thread.
6483 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
6485         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
6486         (TLS_GET_FS): New #define.
6487         (TLS_SET_FS): New #define.
6488         Correct value of __NR_set_thread_area.
6490         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
6492 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
6494         * Makefile (tests): Add tst-popen1.
6495         * tst-popen1.c: New file.
6497         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
6498         but inactive generalization.
6499         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6500         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6501         Minor optimization, remove one instruction.
6502         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6504 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6506         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
6508 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6510         * init.c (__NR_set_tid_address): Add #ifdef for s390.
6511         * sysdeps/pthread/pthread_barrier_wait.c: New file.
6512         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
6513         * sysdeps/pthread/pthread_cond_signal.c: New file.
6514         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
6515         * sysdeps/pthread/pthread_cond_wait.c: New file.
6516         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
6517         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
6518         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
6519         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
6520         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
6521         * sysdeps/s390/Makefile: New file.
6522         * sysdeps/s390/bits/atomic.h: New file.
6523         * sysdeps/s390/pthread_spin_init.c: New file.
6524         * sysdeps/s390/pthread_spin_lock.c: New file.
6525         * sysdeps/s390/pthread_spin_trylock.c: New file.
6526         * sysdeps/s390/pthread_spin_unlock.c: New file.
6527         * sysdeps/s390/pthreaddef.h: New file.
6528         * sysdeps/s390/tcb-offsets.sym: New file.
6529         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
6530         * sysdeps/s390/tls.h: New file.
6531         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
6532         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
6533         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
6534         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
6535         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
6536         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
6537         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6538         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
6539         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
6540         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
6541         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
6542         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
6543         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
6544         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
6545         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
6546         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
6547         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
6548         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
6549         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
6550         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
6551         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
6552         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6553         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
6555 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
6557         * atomic.h: Add a couple more default implementations.
6558         (atomic_compare_and_exchange_acq): Use
6559         __arch_compare_and_exchange_32_acq in return value definition.  It
6560         always exists.
6561         (atomic_bit_set): Renamed from atomic_set_bit.
6562         Add missing atomic_ prefixes.
6564         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
6565         thread library is available, use correct value to mark initialized
6566         once variable.
6568 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
6570         * allocatestack.c (allocate_stack): Use __getpagesize instead of
6571         __sysconf to determine pagesize.
6573         * pthread_create.c: Include <atomic.h>.
6574         * allocatestack.c (allocate_stack): Implement coloring of the
6575         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
6576         size minus one.  Adjust users.
6577         * sysdeps/i386/i686/Makefile: New file.
6579 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
6581         * allocatestack.c: Improve comment throughout the file.
6583         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6584         (__lll_lock_wait): Add branch prediction.
6585         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
6586         (__lll_lock_wait): Likewise.
6587         (lll_unlock_wake_cb): Removed.
6589 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
6591         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
6592         _POSIX_THREAD_PRIORITY_SCHEDULING.
6594 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
6596         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6597         Fix return type of ptr___pthread_getspecific.
6599 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
6601         * Makefile (tests): Add tst-umask1.
6602         (tst-umask1-ARGS): Define.
6603         * tst-umask1.c: New file.
6605 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
6607         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
6608         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
6609         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
6610         pthread_rwlock_unlock.
6611         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
6612         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
6613         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
6614         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
6615         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6616         New file.
6617         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
6618         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6619         New file.
6620         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
6621         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
6622         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
6623         New file.
6624         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
6625         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
6626         New file.
6627         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
6628         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
6629         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
6630         New file.
6631         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
6632         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
6633         New file.
6634         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
6636         * Makefile (libpthread-routines): Remove lowlevelcond and
6637         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
6638         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
6639         and pthread_cond_broadcast.
6640         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
6641         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
6642         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
6643         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
6644         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
6645         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
6646         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
6647         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
6648         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
6649         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
6650         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
6651         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
6652         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
6653         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
6654         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
6655         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
6656         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
6657         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
6658         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
6659         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
6660         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
6661         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
6662         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
6663         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
6664         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
6665         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
6666         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
6667         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
6668         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
6669         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
6670         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
6672         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
6673         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
6674         of the code is moved to ...
6675         * sysdeps/pthread/createthread.c: ...here.  New file.
6677 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
6679         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
6680         (__new_sem_post): Clear %eax before returning.
6681         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
6683         * Makefile (tests): Add tst-cleanup2.
6684         * tst-cleanup2.c: New file.
6686         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6687         Interpret first parameter correctly.
6689 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
6691         * Makefile (headers): Add bits/semaphore.h.
6693 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
6695         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
6696         if not SHARED.
6698 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
6700         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
6701         must be used and mapping failed.
6702         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
6704         * Makefile (CFLAGS-pthread_self.os): Define this, not
6705         CFLAGS-pthread_self.c.
6707 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6709         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
6710         lll_unlock_wake_cb.
6712         * Makefile (libpthread-routines): Add version.  Add rules to build
6713         version.os and banner.h.
6714         * version.c: New file.
6716 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
6718         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
6719         the alias unconditional.
6720         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
6722 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6724         * Makefile (CFLAGS-pthread_self.c): New definition.
6726 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6728         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
6729         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
6730         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
6731         * init.c (__pthread_initialize_minimal_internal): Likewise.
6733 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
6735         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
6737         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6738         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6739         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6740         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6741         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6742         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6744 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6746         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
6747         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
6748         * tst-cancel-wrappers.sh: Remove all exceptions.
6750 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
6752         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
6753         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
6755         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
6756         Use __libc_pthread_functions array if SHARED.
6758         * pthreadP.h: Move pthread_cond_2_0_t definition to...
6759         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
6761         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
6762         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
6763         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
6764         __libc_ptf_call instead of __libc_maybe_call.
6765         (PTF): New #define.
6766         (__libc_cleanup_region_start): Wrap function name with PTF call.
6767         (__libc_cleanup_region_end): Likewise.
6768         (__libc_cleanup_end): Likewise.
6770         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
6771         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
6772         * pthread_key_create.c: Add __pthread_key_create_internal alias.
6773         * pthreadP.h: Add prototypes.
6775         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
6776         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
6777         __pthread_rwlock_unlock aliases.
6778         * pthreadP.h: Add prototypes for new aliases.
6780         * pthreadP.h (struct pthead_functions): Moved to...
6781         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
6782         * init.c (pthread_functions): Add initializers for new elements.
6784         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
6785         __pthread_cleanup_pop_restore aliases.
6786         * pthreadP.h: Add prototypes.
6788         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
6789         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
6790         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
6791         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
6792         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
6793         * pthreadP.h: Adjust prototypes and callers.
6795 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
6797         * Makefile (tests): Add tst-cancel7.
6798         (tst-cancel7-ARGS): New variable.
6799         * tst-cancel7.c: New file.
6801         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
6802         around gcc defficiencies.
6803         * old_pthread_cond_signal.c: Likewise.
6804         * old_pthread_cond_timedwait.c: Likewise.
6805         * old_pthread_cond_wait.c: Likewise.
6807         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
6809 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6811         * Makefile (tests): Add tst-cond7.
6812         * tst-cond7.c: New file.
6814         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6815         (condvar_cleanup): Get condvar address from the right place.
6817         * atomic.h: Correct definitions of atomic_full_barrier,
6818         atomic_read_barrier, atomic_write_barrier.
6820         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
6821         race-free.
6822         * old_pthread_cond_signal.c: Likewise.
6823         * old_pthread_cond_timedwait.c: Likewise.
6824         * old_pthread_cond_wait.c: Likewise.
6826 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
6828         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
6830 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6832         * pthreadP.h (pthread_cond_2_0_t): New type.
6833         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
6834         Use new type for the 2.0 condvar function prototypes.
6835         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
6836         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
6837         parameter.
6838         * old_pthread_cond_destroy.c: Likewise.
6839         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
6840         * old_pthread_cond_signal.c: Likewise.
6841         * old_pthread_cond_timedwait.c: Likewise.
6842         * old_pthread_cond_wait.c: Likewise.
6844         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6845         (__pthread_cond_wait): Don't save cancellation mode and seq value
6846         in same location.
6848         * herrno.c (__h_errno_location): Don't define as weak.
6850 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6852         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
6853         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
6854         and pthread_cond_wait.
6855         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
6856         Renamed to...
6857         (__pthread_cond_broadcast_2_0): ... this.
6858         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
6859         Renamed to...
6860         (__pthread_cond_destroy_2_0): ... this.
6861         * old_pthread_cond_init.c (__old_pthread_cond_init):
6862         Renamed to...
6863         (__pthread_cond_init_2_0): ... this.
6864         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
6865         Renamed to...
6866         (__pthread_cond_signal_2_0): ... this.
6867         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
6868         Renamed to...
6869         (__pthread_cond_wait_2_0): ... this.
6870         * pthread_cond_destroy.c: Include shlib-compat.h.
6871         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
6872         * pthread_cond_init.c: Include shlib-compat.h.
6873         (pthread_cond_init): Change strong_alias into versioned_symbol.
6874         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
6875         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
6876         fields.
6877         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
6878         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
6879         __pthread_cond_wait_2_0): New prototypes.
6880         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
6881         __old_pthread_cond_init, __old_pthread_cond_signal,
6882         __old_pthread_cond_wait): Removed.
6883         * init.c: Include shlib-compat.h.
6884         (pthread_functions): Guard ptr___pthread_attr_init_2_0
6885         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
6886         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
6887         ptr___pthread_cond_*_2_0 fields.
6888         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
6889         pthread_cond_*@GLIBC_2.0 compatibility symbols.
6891         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
6892         LIBC_SIGACTION was not yet defined.
6893         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
6894         [!defined LIBC_SIGACTION] (__sigaction): New function and
6895         libc_hidden_weak.
6896         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
6897         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
6899 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6901         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
6903 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
6905         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6906         New, larger type definition.
6907         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
6908         implementation.
6909         * Versions [libpthread]: Add definitions for new pthread_cond_*
6910         interfaces for version GLIBC_2.3.2.
6911         * pthread_cond_init.c: Update initialization for new type definition.
6912         * Makefile (libpthread-routines): Remove pthread_cond_wait,
6913         pthread_cond_timedwait, pthread_cond_signal, and
6914         pthread_cond_broadcast.  Add old_pthread_cond_init,
6915         old_pthread_cond_destroy, old_pthread_cond_wait,
6916         old_pthread_cond_timedwait, old_pthread_cond_signal, and
6917         old_pthread_cond_broadcast.
6918         * old_pthread_cond_broadcast.c: New file.
6919         * old_pthread_cond_destroy.c: New file.
6920         * old_pthread_cond_init.c: New file.
6921         * old_pthread_cond_signal.c: New file.
6922         * old_pthread_cond_timedwait.c: New file.
6923         * old_pthread_cond_wait.c: New file.
6924         * pthreadP.h: Add prototypes for the compatibility interfaces.
6926         * pthread_cond_destroy.c: Don't include <errno.h>.
6928 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
6930         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
6931         unnecessary zero offset when addressing MUTEX.
6933 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6935         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6936         __register_atfork.
6937         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
6938         for __register_atfork.
6940 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6942         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
6943         instead of ASSEMBLER test macro.
6945         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
6946         __libc_current_sigrtmax): Add libc_hidden_def.
6948         * sysdeps/pthread/list.h: Remove assert.h include.
6950 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6952         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
6953         __pthread_initialize_minimal_internal not
6954         __pthread_initialize_minimal.
6956 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
6958         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
6959         __pthread_initialize_minimal as hidden.
6961         * init.c (__pthread_initialize_minimal_internal): Don't mark as
6962         constructor.
6964 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6966         * Makefile ($(inst_libdir)/libpthread.so): Depend on
6967         $(common-objpfx)format.lds, include that into the output script.
6968         Fix comment.
6969         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
6971 2002-12-28  Andreas Jaeger  <aj@suse.de>
6973         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
6974         nsec resolution changes.
6975         (xstat64_conv): Likewise.
6976         (xstat32_conv): Likewise.
6977         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
6978         struct kernel_stat.
6979         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
6980         structs stat and stat64.
6981         * time/time.h (__timespec_defined): Define for __USE_MISC.
6982         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
6984 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
6986         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
6987         argument.
6988         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
6989         (pthread_exit): Use strong_alias to avoid warnings.
6990         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
6991         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
6992         ptr___pthread_attr_init_2_*.
6993         * init.c (pthread_functions): Adjust.
6995 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
6997         * forward.c: Make all functions available by default again.  It
6998         caused too much trouble.
7000         * pt-siglongjmp.c: Removed.
7002 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
7004         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
7005         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
7006         * sysdeps/i386/Makefile: New file.
7007         * sysdeps/i386/tcb-offsets.sym: New file.
7008         * sysdeps/pthread/tcb-offsets.h: New file.
7009         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7010         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
7012         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
7013         __register_atfork...
7014         (GLIBC_2.3.2): ...here.
7016 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
7018         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
7019         pthread_attr_setstackaddr with __attribute_deprecated__.
7021 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
7023         * pt-system.c (system): Remove cancellation handling.
7024         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
7025         cancellation routines.
7027 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
7029         * descr.h: Include <dl-sysdep.h>.
7030         (struct pthread): Move header.data.list to the back of the struct.
7031         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
7032         (MULTIPLE_THREADS_OFFSET): Adjust offset.
7033         (SYSINFO_OFFSEET): Likewise.
7035 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
7037         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
7038         Define.
7039         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
7040         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
7041         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
7042         (USE_DL_SYSINFO): Undef.
7044 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
7046         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
7047         $(common-objpfx)libc.so.
7048         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
7049         it is bigger than pipe buffer size even on arches with bigger
7050         page size.
7051         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
7053 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
7055         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
7056         correct errno access for case that USE___THREAD is not defined.
7058 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
7060         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
7061         Patch by Marijn Ros <marijn@mad.scientist.com>.
7063 2002-12-22  Roland McGrath  <roland@redhat.com>
7065         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
7067 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
7069         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
7071 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
7073         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
7074         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
7075         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
7077         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
7078         of int $0x80.
7079         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7080         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
7081         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
7082         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7083         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7084         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
7085         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
7086         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
7088         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
7089         sysenter.
7090         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
7092         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
7094         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
7095         in new TCB.
7096         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
7097         that sysinfo is properly initialized.
7098         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
7099         to 1 only for ld.so.
7101         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
7102         RTLD_CORRECT_DYNAMIC_WEAK.
7104 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
7106         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
7107         Use return 0 as 6th argument to FORWARD4.
7108         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
7110 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
7112         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
7113         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
7114         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
7115         (INIT_SYSINFO): New #define.
7116         (TLS_TP_INIT): Use INIT_SYSINFO.
7117         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7118         At test to make sure SYSINFO_OFFSET value is correct.
7119         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
7121 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
7123         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
7124         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
7125         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
7126         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
7127         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
7128         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
7129         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
7131 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
7133         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
7134         macro instead of using int $0x80 directly.
7136         * sysdeps/pthread/bits/stdio-lock.h: New file.
7137         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
7138         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
7139         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
7140         * Makefile (routines): Add libc-lowlevelmutex.
7142         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
7143         __i686.get_pc_thunk.dx.
7145 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
7147         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
7148         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
7149         ($(objpfx)tst-cancel-wrappers.out): New rule.
7150         * tst-cancel-wrappers.sh: New test.
7151         * tst-locale1.c: Include signal.h.
7152         (uselocale): Test static linking of __libc_current_sigrt*.
7154 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
7156         * Makefile (tests): Add tst-cancel6.
7157         * tst-cancel6.c: New file
7159 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
7161         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
7162         Define meaningfully for assembler as well.
7163         * pthreadP.h (struct pthread_functions): Remove
7164         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
7165         and ptr_pthread_attr_init_2_1 fields.
7166         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
7167         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
7168         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
7169         (FORWARD3): Define using FORWARD4.
7170         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
7171         versions.
7172         * pt-system.c: Remove duplicate stdlib.h include.
7174 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
7176         * sem_init.c: Define sem_init@GLIBC_2.0.
7177         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
7178         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
7180         * flockfile.c: Moved to...
7181         * sysdeps/pthread/flockfile.c: ...here.  New file.
7182         * funlockfile.c: Moved to...
7183         * sysdeps/pthread/funlockfile.c: ...here.  New file.
7184         * ftrylockfile.c: Moved to...
7185         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
7187 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
7189         * libc-cancellation.c: Guard both function with
7190         #if !defined NOT_IN_libc.
7191         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
7192         automatically provided pthread wrappers.
7193         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
7194         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
7195         nor in libpthread.
7196         * pt-open.c: Removed.
7197         * pt-fcntl.c: Removed.
7198         * pt-fsync.c: Removed.
7199         * pt-lseek.c: Removed.
7200         * pt-msgrcv.c: Removed.
7201         * pt-msgsnd.c: Removed.
7202         * pt-msync.c: Removed.
7203         * pt-nanosleep.c: Removed.
7204         * pt-open64.c: Removed.
7205         * pt-pause.c: Removed.
7206         * pt-pread.c: Removed.
7207         * pt-pread64.c: Removed.
7208         * pt-pwrite.c: Removed.
7209         * pt-pwrite64.c: Removed.
7210         * pt-read.c: Removed.
7211         * pt-recv.c: Removed.
7212         * pt-recvfrom.c: Removed.
7213         * pt-recvmsg.c: Removed.
7214         * pt-send.c: Removed.
7215         * pt-sendto.c: Removed.
7216         * pt-sigtimedwait.c: Removed.
7217         * pt-sigwait.c: Removed.
7218         * pt-wait.c: Removed.
7219         * pt-waitpid.c: Removed.
7220         * pt-write.c: Removed.
7221         * pt-accept.c: Removed.
7222         * pt-close.c: Removed.
7223         * pt-connect.c: Removed.
7224         * pt-lseek64.c: Removed.
7225         * pt-sendmsg.c: Removed.
7226         * pt-tcdrain.c: Removed.
7228 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
7230         * init.c (__pthread_initialize_minimal_internal): Renamed from
7231         __pthread_initialize_minimal.  Make old name an alias.  This
7232         converts a normal relocation into a relative relocation.
7234         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
7236         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
7237         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
7238         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
7239         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
7240         pt-sigwaitinfo, pt-waitid, and pt-writev.
7241         * pt-creat.c: Removed.
7242         * pt-poll.c: Removed.
7243         * pt-pselect.c: Removed.
7244         * pt-readv.c: Removed.
7245         * pt-select.c: Removed.
7246         * pt-sigpause.c: Removed.
7247         * pt-sigsuspend.c: Removed.
7248         * pt-sigwaitinfo.c: Removed.
7249         * pt-waitid.c: Removed.
7250         * pt-writev.c: Removed.
7252         * init.c (pthread_functions): New variable.
7253         (__pthread_initialize_minimal): Pass pointer to pthread_functions
7254         (or NULL) to __libc_pthread_init.
7255         * forward.c: Rewrite to use __libc:pthread_functions array to get
7256         function addresses.
7257         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
7258         prototype.
7259         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7260         Take new parameter.  Copy content of variable pointed to by it
7261         to __libc_pthread_init.
7263         * pthreadP.h (struct pthread_functions): New type.
7264         (__libc_pthread_init): Declare.
7266         * pthread_attr_destroy.c: Add namespace protected alias.
7267         * pthread_attr_getdetachstate.c: Likewise.
7268         * pthread_attr_getinheritsched.c: Likewise.
7269         * pthread_attr_getschedparam.c: Likewise.
7270         * pthread_attr_getschedpolicy.c: Likewise.
7271         * pthread_attr_getscope.c: Likewise.
7272         * pthread_attr_setdetachstate.c: Likewise.
7273         * pthread_attr_setinheritsched.c: Likewise.
7274         * pthread_attr_setschedparam.c: Likewise.
7275         * pthread_attr_setschedpolicy.c: Likewise.
7276         * pthread_attr_setscope.c: Likewise.
7277         * pthread_cond_broadcast.c: Likewise.
7278         * pthread_cond_destroy.c: Likewise.
7279         * pthread_cond_init.c: Likewise.
7280         * pthread_cond_signal.c: Likewise.
7281         * pthread_cond_wait.c: Likewise.
7282         * pthread_condattr_destroy.c: Likewise.
7283         * pthread_condattr_init.c: Likewise.
7284         * pthread_equal.c: Likewise.
7285         * pthread_exit.c: Likewise.
7286         * pthread_getschedparam.c: Likewise.
7287         * pthread_self.c: Likewise.
7288         * pthread_setcancelstate.c: Likewise.
7289         * pthread_setschedparam.c: Likewise.
7290         * pthread_mutex_destroy.c: Likewise.
7291         * pthread_mutex_init.c: Likewise.
7292         * pthreadP.h: Add prototypes for the aliases.
7294         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
7295         multiple_threads member in correct TCB to 1.
7297         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
7298         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
7299         member of thread decriptor, otherwise return unconditionally 1.
7301 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
7303         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
7304         regular Linux version.  Remove file.
7305         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
7306         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
7307         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
7308         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
7309         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
7310         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
7311         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
7312         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
7313         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
7314         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
7315         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
7316         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
7317         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
7318         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
7319         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
7320         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
7321         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
7322         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
7323         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
7324         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
7325         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
7326         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
7327         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
7328         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
7329         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
7330         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
7331         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
7332         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
7333         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
7334         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
7336 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
7338         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
7339         * sysdeps/unix/sysv/linux/open.c: Removed.
7340         * sysdeps/unix/sysv/linux/fsync.c: Removed.
7341         * sysdeps/unix/sysv/linux/lseek.c: Removed.
7342         * sysdeps/unix/sysv/linux/msync.c: Removed.
7343         * sysdeps/unix/sysv/linux/read.c: Removed.
7344         * sysdeps/unix/sysv/linux/close.c: Removed.
7345         * sysdeps/unix/sysv/linux/creat.c: Removed.
7346         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
7347         * sysdeps/unix/sysv/linux/pause.c: Removed.
7348         * sysdeps/unix/sysv/linux/select.c: Removed.
7349         * sysdeps/unix/sysv/linux/write.c: Removed.
7351 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
7353         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
7354         element in TCB to see whether locking is needed.
7356         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
7357         MULTIPLE_THREADS_OFFSET value is correct.
7359         * sysdeps/unix/sysv/linux/close.c: New file.
7360         * sysdeps/unix/sysv/linux/connect.S: New file.
7361         * sysdeps/unix/sysv/linux/creat.c: New file.
7362         * sysdeps/unix/sysv/linux/fsync.c: New file.
7363         * sysdeps/unix/sysv/linux/llseek.c: New file.
7364         * sysdeps/unix/sysv/linux/lseek.c: New file.
7365         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
7366         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
7367         * sysdeps/unix/sysv/linux/msync.c: New file.
7368         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
7369         * sysdeps/unix/sysv/linux/open.c: New file.
7370         * sysdeps/unix/sysv/linux/open64.c: New file.
7371         * sysdeps/unix/sysv/linux/pause.c: New file.
7372         * sysdeps/unix/sysv/linux/poll.c: New file.
7373         * sysdeps/unix/sysv/linux/pread.c: New file.
7374         * sysdeps/unix/sysv/linux/pread64.c: New file.
7375         * sysdeps/unix/sysv/linux/pselect.c: New file.
7376         * sysdeps/unix/sysv/linux/pwrite.c: New file.
7377         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
7378         * sysdeps/unix/sysv/linux/readv.c: New file.
7379         * sysdeps/unix/sysv/linux/recv.S: New file.
7380         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
7381         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
7382         * sysdeps/unix/sysv/linux/select.c: New file.
7383         * sysdeps/unix/sysv/linux/send.S: New file.
7384         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
7385         * sysdeps/unix/sysv/linux/sendto.S: New file.
7386         * sysdeps/unix/sysv/linux/sigpause.c: New file.
7387         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
7388         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7389         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7390         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7391         * sysdeps/unix/sysv/linux/system.c: New file.
7392         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
7393         * sysdeps/unix/sysv/linux/wait.c: New file.
7394         * sysdeps/unix/sysv/linux/waitid.c: New file.
7395         * sysdeps/unix/sysv/linux/waitpid.c: New file.
7396         * sysdeps/unix/sysv/linux/writev.c: New file.
7397         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
7399         * pt-readv.c: Fix comment.
7401 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
7403         * tst-cleanup1.c: Include stdlib.h.
7405         * tst-cancel5.c: New test.
7406         * Makefile (tests): Add tst-cancel5.
7407         (tst-cancel5): Link against libc.so libpthread.so in that order.
7409 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
7411         * forward.c (test_loaded): Prevent recursive calls.
7413         * Makefile (routines): Add libc-cancellation.
7414         * libc-cancellation.c: New file.
7415         * descr.h (struct pthread): Add multiple_threads field.
7416         * allocatestack.c (allocate_stack): Initialize multiple_header field of
7417         new thread descriptor to 1.
7418         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
7419         Initialize multiple_thread field after successful thread creation.
7420         * cancellation.c (__do_cancel): Move to pthreadP.h.
7421         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
7422         (__pthread_disable_asynccancel): Add internal_function attribute.
7423         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
7424         * pthread_setcancelstate.c: Likewise.
7425         * pthread_setcanceltype.c: Likewise.
7426         * pthread_exit.c: Likewise.
7427         * pthreadP.h (CANCELLATION_P): Likewise.
7428         (__do_cancel): Define as static inline.
7429         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
7430         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
7431         declarations.
7432         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
7433         fields.  Define MULTIPLE_THREADS_OFFSET.
7434         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
7435         declaration.
7436         * sysdeps/unix/sysv/linux/accept.S: New file.
7437         * sysdeps/unix/sysv/linux/read.c: New file.
7438         * sysdeps/unix/sysv/linux/write.c: New file.
7439         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
7440         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
7441         initialization of __libc_locking_needed.
7442         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
7443         __libc_locking_needed, use multiple_threads field in TCB.
7444         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7446 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7448         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
7449         version.
7450         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
7452         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
7453         access to __libc_locking_needed for PIC.
7455 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
7457         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
7458         declare for libc.so.
7459         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
7460         expression.
7461         (__libc_lock_lock): Put into statement expression.
7462         (__libc_lock_unlock): Remove trailing semicolon.
7463         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
7465 2002-12-12  Roland McGrath  <roland@redhat.com>
7467         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
7468         "m" constraint to refer to __libc_locking_needed.  Declare it here.
7470 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7472         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
7473         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
7474         Initialize __libc_locking_needed.
7475         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
7476         instead of __register_pthread_fork_handler.
7477         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
7478         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
7479         fork-gen with libc_pthread_init.
7480         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
7481         of __register_pthread_fork_handler.
7482         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
7483         of __register_pthread_fork_handler.
7484         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
7485         __libc_locking_needed to determine whether lock prefix can be avoided.
7486         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7488 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
7490         * Makefile (tests): Add tst-cleanup1.
7491         * tst-cleanup1.c: New file.
7492         * cancellation.c (__cleanup_thread): Removed.
7493         (__do_cancel): Remove call to __cleanup_thread.
7494         * pthreadP.h: Remove __cleanup_thread prorotype.
7496         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
7497         Remember function and argument even if cancellation handler
7498         function is not available.
7499         (__libc_cleanup_region_end): Execute registered function directly if
7500         pthread functions are not available.
7501         (__libc_cleanup_end): Likewise.
7503         * init.c (__pthread_initialize_minimal): Fix initialization in
7504         static lib by preventing gcc from being too clever.
7506 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
7508         * init.c (__pthread_initialize_minimal): Remove unneccesary
7509         sigaddset call.
7511         * Makefile (tests): We can run tst-locale2 now.
7513 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
7515         * Versions: Remove duplicated sigwait entry.
7517 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
7519         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
7520         inside libpthread.
7522         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
7524         * pthreadP.h: Declare __pthread_enable_asynccancel and
7525         __pthread_disable_asynccancel.
7526         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
7527         (CANCEL_RESET): Use __pthread_disable_asynccancel.
7528         * cancellation.c (__pthread_enable_asynccancel): New function.
7529         (__pthread_disable_asynccancel): New function.
7530         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
7531         * pt-close.c: Likewise.
7532         * pt-connect.c: Likewise.
7533         * pt-creat.c: Likewise.
7534         * pt-fcntl.c: Likewise.
7535         * pt-fsync.c: Likewise.
7536         * pt-lseek.c: Likewise.
7537         * pt-lseek64.c: Likewise.
7538         * pt-msgrcv.c: Likewise.
7539         * pt-msgsnd.c: Likewise.
7540         * pt-msync.c: Likewise.
7541         * pt-nanosleep.c: Likewise.
7542         * pt-open.c: Likewise.
7543         * pt-open64.c: Likewise.
7544         * pt-pause.c: Likewise.
7545         * pt-poll.c: Likewise.
7546         * pt-pread.c: Likewise.
7547         * pt-pread64.c: Likewise.
7548         * pt-pselect.c: Likewise.
7549         * pt-pwrite.c: Likewise.
7550         * pt-pwrite64.c: Likewise.
7551         * pt-read.c: Likewise.
7552         * pt-readv.c: Likewise.
7553         * pt-recv.c: Likewise.
7554         * pt-recvfrom.c: Likewise.
7555         * pt-recvmsg.c: Likewise.
7556         * pt-select.c: Likewise.
7557         * pt-send.c: Likewise.
7558         * pt-sendmsg.c: Likewise.
7559         * pt-sendto.c: Likewise.
7560         * pt-sigpause.c: Likewise.
7561         * pt-sigsuspend.c: Likewise.
7562         * pt-sigtimedwait.c: Likewise.
7563         * pt-sigwait.c: Likewise.
7564         * pt-sigwaitinfo.c: Likewise.
7565         * pt-system.c: Likewise.
7566         * pt-tcdrain.c: Likewise.
7567         * pt-wait.c: Likewise.
7568         * pt-waitid.c: Likewise.
7569         * pt-waitpid.c: Likewise.
7570         * pt-write.c: Likewise.
7571         * pt-writev.c: Likewise.
7572         * pthread_join.c: Likewise.
7573         * pthread_timedjoin.c: Likewise.
7575         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
7576         (__xpg_sigpause): New function.
7577         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
7579 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
7581         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
7583         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
7584         _GI_pthread_cleanup_pop to pthreadP.h.
7586         * ftrylockfile.c: Use _IO_lock_trylock instead of
7587         pthread_mutex_trylock.
7589         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
7590         (CANCEL_RESET): Likewise.
7591         (__pthread_setcanceltype_): Declare.
7592         (__pthread_mutex_lock_internal): Declare.
7593         (__pthread_mutex_unlock_internal): Declare.
7594         (__pthread_once_internal): Declare.
7595         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
7596         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
7598         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
7599         and pthread_mutex_unlock.
7600         * pthread_cond_wait.c: Likewise.
7601         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
7602         * pthread_mutex_unlock.c: Likewise.
7604         * pthread_setcanceltype.c: Add additional alias
7605         __pthread_setcanceltype.
7607         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
7608         * sem_open.c (sem_open): Likewise.
7609         Use __libc_open, __libc_write, and __libc_close instead of
7610         open, write, and close respectively.
7612         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
7613         Rewrite as statement expression since it must return a value.
7615         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
7616         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
7617         __pthread_kill.
7619         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
7620         alias __pthread_once_internal.
7622         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
7624 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
7626         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
7627         * tst-stdio1.c: New file.
7628         * tst-stdio2.c: New file.
7630         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
7632         * Makefile (tests): Comment out tst-locale2 for now.
7633         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
7635         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
7636         -D_IO_MTSAFE_IO.
7637         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
7638         Use _IO_lock_init instead of explicit assignment.
7640         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
7641         Define __libc_lock_* and __libc_lock_recursive macros with
7642         lowlevellock macros, not pthread mutexes.
7644         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
7645         of pthread_mutex_lock.
7646         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
7647         instead of pthread_mutex_unlock.
7649 2002-12-06  Roland McGrath  <roland@redhat.com>
7651         * allocatestack.c (__stack_user): Use uninitialized defn.
7652         * init.c (__pthread_initialize_minimal): Initialize it here.
7654 2002-12-05  Roland McGrath  <roland@redhat.com>
7656         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
7657         string.
7658         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
7660         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
7661         missing & here too.
7663 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
7665         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7666         lowlevellock.
7667         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
7668         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
7669         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
7670         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
7671         for __libc_lock_* macros.
7672         * Makefile (routines): Add libc-lowlevellock.
7674 2002-10-09  Roland McGrath  <roland@redhat.com>
7676         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
7677         Under [__PIC__], call the function via the pointer fetched for
7678         comparison rather than a call by name that uses the PLT.
7679         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
7680         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
7681         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
7682         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
7683         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
7685 2002-12-04  Roland McGrath  <roland@redhat.com>
7687         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
7689         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
7690         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
7692         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
7694 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7696         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
7697         a completely opaque, non-integer type.
7698         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7700 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
7702         * sysdeps/i386/tls.h: Include stdlib.h.
7703         * sysdeps/x86_64/tls.h: Likewise.
7705 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7707         * Makefile (tests): Add tst-locale2.
7708         (tests-static): Likewise.
7709         * tst-locale2.c: New file.
7711         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
7712         volatile and add memory clobbers to lock operations.
7714 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
7716         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
7717         * sysdeps/i386/i486/bits/atomic.h: New file.
7718         * sysdeps/i386/i586/bits/atomic.h: New file.
7719         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
7720         include i486 version.
7721         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
7722         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
7723         Patch by Marijn Ros <marijn@mad.scientist.com>.
7725         * allocatestack.c (get_cached_stack): Don't crash if we first
7726         found a stack with a larger size then needed.
7727         Reported by Hui Huang <hui.huang@sun.com>.
7729         * Makefile (tests): Add tst-sysconf.
7730         * tst-sysconf.c: New file.
7732         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
7733         PTHREAD_THREADS_MAX.
7735 2002-12-02  Roland McGrath  <roland@redhat.com>
7737         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
7738         Declare using hidden_proto instead of attribute_hidden, so there are
7739         non-.hidden static symbols for gdb to find.
7740         (__pthread_keys): Likewise.
7741         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
7742         * allocatestack.c (__stack_user): Likewise.
7743         * pthread_create.c (__pthread_keys): Likewise.
7744         (__nptl_threads_events, __nptl_last_event): Make these static instead
7745         of hidden.
7746         * pthread_key_create.c (__pthread_pthread_keys_max,
7747         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
7749 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
7751         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
7752         statically.
7753         * tst-locale1.c: New file.
7755         * pthread_cond_timedwait.c: Include <stdlib.h>.
7757         * Makefile (tests): Add tst-fork2 and tst-fork3.
7758         * tst-fork2.c: New file.
7759         * tst-fork3.c: New file.
7761 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
7763         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
7765         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
7766         require it to 200112L.
7768         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
7769         instruction only if HAVE_CMOV is defined.
7770         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
7772         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
7774         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
7776         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
7778         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
7780 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
7782         * sysdeps/x86_64/bits/atomic.h: New file.
7784         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
7785         16-bit operations.
7787         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
7788         possible since gettid cannot fail.
7790         * sysdeps/x86_64/pthreaddef.h: New file.
7792         * sysdeps/i386/pthreaddef.h (gettid): Removed.
7794         * sysdeps/x86_64/pthread_spin_init.c: New file.
7795         * sysdeps/x86_64/pthread_spin_lock.c: New file.
7796         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
7797         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
7799         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
7800         Add missing lock prefix.  Minute optimization.
7802         * tst-spin2.c (main): Also check successful trylock call.
7804         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
7805         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
7807         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
7808         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
7810         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
7811         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
7812         value in case of an error.  Add support for INTERNAL_SYSCALL.
7814         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
7815         value in case of an error.
7817         * sysdeps/x86_64/tls.h: New file.
7819 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7821         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
7822         takes the array member name and the index as parameters.
7823         (THREAD_SETMEM_NC): Likewise.
7824         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
7825         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
7826         interfaces.
7828         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
7829         to decide which code to use.
7830         (THREAD_SETMEM_NC): Likewise.
7832         * allocatestack.c (queue_stack): Don't remove stack from list here.
7833         Do it in the caller.  Correct condition to prematurely terminate
7834         loop to free stacks.
7835         (__deallocate_stack): Remove stack from list here.
7837 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7839         * Makefile (tests): Add tst-stack1.
7840         * tst-stack1.c: New file.
7842         * allocatestack.c (allocate_stack): Initialize the TCB on a user
7843         provided stack.
7845         * pthread_attr_getstack.c: Return bottom of the thread area.
7847 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
7849         * Makefile (libpthread-routines): Add pt-allocrtsig and
7850         pthread_kill_other_threads.
7851         * pt-allocrtsig.c: New file.
7852         * pthread_kill_other_threads.c: New file.
7853         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
7854         all three functions.
7855         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7856         allocrtsig.
7857         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
7858         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
7859         and __libc_allocate_rtsig_private.
7860         * Versions (libpthread): Export pthread_kill_other_threads_np,
7861         __libc_current_sigrtmin, and __libc_current_sigrtmax.
7863 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
7865         * allocatestack.c (allocate_stack): stackaddr in attribute points to
7866         the end of the stack.  Adjust computations.
7867         When mprotect call fails dequeue stack and free it.
7868         * pthread_attr_setstack.c: Store top of the stack in stackaddr
7869         attribute.
7870         * pthread_getattr_np.c: Likewise.
7872         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
7873         surprises.
7875 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
7877         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
7878         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7880 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
7882         * pthread_getspecific.c: Optimize access to first 2nd-level array.
7883         * pthread_setspecific.c: Likewise.
7885 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
7887         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
7888         definitions.  Get them from the official place.
7889         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
7891         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
7892         Use new CLONE_ flags in clone() calls.
7894         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
7895         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
7897         * Versions: Add pthread_* functions for libc.
7898         * forward.c: New file.
7900         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
7901         errno-loc.
7902         * herrno.c: New file.
7903         * res.c: New file.
7905         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
7906         sem_trywait, and sem_timedwait.  Add herrno and res.
7907         * sem_init.c: Don't initialize lock and waiters members.
7908         * sem_open.c: Likewise.
7909         * sem_post.c: Removed.
7910         * sem_wait.c: Removed.
7911         * sem_trywait.c: Removed.
7912         * sem_timedwait.c: Removed.
7913         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
7914         Includes full implementations of sem_post, sem_wait, sem_trywait,
7915         and sem_timedwait.
7916         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
7917         for new implementation.
7918         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
7919         and waiters fields.
7921         * tst-sem3.c: Improve error message.
7922         * tst-signal3.c: Likewise.
7924         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
7925         to tell the kernel about the termination futex and to initialize tid
7926         member.  Don't initialize main_thread.
7927         * descr.h (struct pthread): Remove main_thread member.
7928         * cancelllation.c (__do_cancel): Remove code handling main thread.
7929         The main thread is not special anymore.
7931         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
7932         size of the stacks to stack_cache_actsize.
7934         * pt-readv.c: Add missing "defined".
7935         * pt-sigwait.c: Likewise.
7936         * pt-writev.c: Likewise.
7938 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
7940         * Versions: Export __connect from libpthread.
7941         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7943         * Makefile (libpthread-routines): Add pt-raise.
7944         * sysdeps/unix/sysv/linux/raise.c: New file.
7945         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
7946         * sysdeps/generic/pt-raise.c: New file.
7948         * pthread_cond_init.c: Initialize all data elements of the condvar
7949         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7951         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
7952         * pthread_create.c: Likewise.
7954         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
7955         * tst-key1.c: New file.
7956         * tst-key2.c: New file.
7957         * tst-key3.c: New file.
7959         * Versions: Export pthread_detach for version GLIBC_2.0.
7960         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
7962 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
7964         * pthread_key_create.c: Terminate search after an unused key was found.
7965         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7967         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
7968         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7970 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
7972         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
7973         dynamic lookup for errno in PIC.
7975         * allocatestack.c (get_cached_stack): Rearrange code slightly to
7976         release the stack lock as soon as possible.
7977         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
7978         the static TLS block.
7979         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
7981         * cancellation.c: Renamed from cancelation.c.
7982         * Makefile: Adjust accordingly.
7983         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
7984         * cleanup_defer.c: Use CANCELLATION_P.
7985         * pthread_testcancel.c: Likewise.
7986         * descr.h: Fix spelling in comments.
7987         * init.c: Likewise.
7988         * pthread_getattr_np.c: Likewise.
7989         * pthread_getschedparam.c: Likewise.
7990         * pthread_setschedparam.c: Likewise.
7991         * Versions: Likewise.
7993         * pt-pselect.c: New file.
7994         * Makefile (libpthread-routines): Add pt-pselect.
7995         * Versions: Add pselect.
7997         * tst-cancel4.c: New file.
7998         * Makefile (tests): Add tst-cancel4.
8000 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
8002         * pthread_mutex_lock.c: Always record lock ownership.
8003         * pthread_mutex_timedlock.c: Likewise.
8004         * pthread_mutex_trylock.c: Likewise.
8006         * pt-readv.c: New file.
8007         * pt-writev.c: New file.
8008         * pt-creat.c: New file.
8009         * pt-msgrcv.c: New file.
8010         * pt-msgsnd.c: New file.
8011         * pt-poll.c: New file.
8012         * pt-select.c: New file.
8013         * pt-sigpause.c: New file.
8014         * pt-sigsuspend.c: New file.
8015         * pt-sigwait.c: New file.
8016         * pt-sigwaitinfo.c: New file.
8017         * pt-waitid.c: New file.
8018         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
8019         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
8020         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
8021         * Versions: Add all the new functions.
8023         * tst-exit1.c: New file.
8024         * Makefile (tests): Add tst-exit1.
8026         * sem_timedwait.c: Minor optimization for more optimal fastpath.
8028 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
8030         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
8032         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
8033         call.  pthread_join is an official cancellation point.
8034         * pthread_timedjoin.c: Likewise.
8036         * pthread_cond_wait.c: Revert order in which internal lock are dropped
8037         and the condvar's mutex are retrieved.
8038         * pthread_cond_timedwait.c: Likewise.
8039         Reported by dice@saros.East.Sun.COM.
8041 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
8043         * pthreadP.h: Cut out all type definitions and move them...
8044         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
8045         * pthreadP.h: Include <internaltypes.h>.
8047         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
8048         performance tweaks.
8050         * sem_trywait.c: Shuffle #includes around to get right order.
8051         * sem_timedwait.c: Likewise.
8052         * sem_post.c: Likewise.
8053         * sem_wait.c: Likewise.
8055         * nptl 0.3 released.
8057         * Makefile (tests): Add tst-signal3.
8058         * tst-signal3.c: New file.
8060 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
8062         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
8063         the asms modify the sem object.
8064         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
8066         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
8067         the actual members.
8068         * pthreadP.h (struct sem): New type.  Actual semaphore type.
8069         * semaphoreP.h: Include pthreadP.h.
8070         * sem_getvalue.c: Adjust to sem_t change.
8071         * sem_init.c: Likewise.
8072         * sem_open.c: Likewise.
8073         * sem_post.c: Likewise.
8074         * sem_timedwait.c: Likewise.
8075         * sem_trywait.c: Likewise.
8076         * sem_wait.c: Likewise.
8078 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
8080         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
8081         * tst-basic2.c: New file.
8082         * tst-exec1.c: New file.
8083         * tst-exec2.c: New file.
8084         * tst-exec3.c: New file.
8086         * tst-fork1.c: Remove extra */.
8088         * nptl 0.2 released.  The API for IA-32 is complete.