Update.
[glibc.git] / nptl / ChangeLog
blob6d04d991077f8d61063500e7f3a8c4937014bc3c
1 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
3         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
4         weak.
6 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
8         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
9         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
10         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
11         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
12         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
13         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
14         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
15         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
16         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
17         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
18         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
19         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
20         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
21         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
22         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
23         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
24         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
25         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
26         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
27         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
28         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
29         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
30         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
31         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
32         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
33         * sysdeps/sparc/tls.h: New file.
34         * sysdeps/sparc/tcb-offsets.sym: New file.
35         * sysdeps/sparc/Makefile: New file.
36         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
37         * init.c [__sparc__] (__NR_set_tid_address): Define.
39 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
41         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
42         _IO_release_lock): Define.
44 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
46         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
47         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
49 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
51         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
52         (__pthread_cleanup_class): Add missing return types of member
53         functions.
55 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
57         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
58         (lll_mutex_unlock_force): Add memory barrier between store and futex
59         syscall.
61 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
63         * tst-cancel4.c (do_test): Also unlink tempfname and remove
64         tempmsg in first loop.
66 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
68         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
69         _POSIX_THREAD_PRIORITY_SCHEDULING.
70         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
72 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
74         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
75         (__rtld_lock_default_lock_recursive,
76         __rtld_lock_default_unlock_recursive): Define.
77         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
78         __rtld_lock_unlock_recursive): Define using
79         GL(_dl_rtld_*lock_recursive).
80         * init.c (__pthread_initialize_minimal_internal): Initialize
81         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
82         Lock GL(_dl_load_lock) the same number of times as
83         GL(_dl_load_lock) using non-mt implementation was nested.
85         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
86         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
88 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
90         * tst-cancel17.c (do_test): Make len2 maximum of page size and
91         PIPE_BUF.
93 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
95         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
97 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
99         * sysdeps/pthread/createthread.c (do_clone): Move error handling
100         to first syscall error check.  Move syscall error check for tkill
101         into __ASSUME_CLONE_STOPPED #ifdef.
103 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
105         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
106         is not defined, do explicit synchronization.
107         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
108         is not defined also unlock pd->lock for non-debugging case in case
109         it is necessary.
110         * pthread_create.c (start_thread): Always get and release pd->lock
111         if __ASSUME_CLONE_STOPPED is not defined.
112         (start_thread_debug): Removed.  Adjust users.
113         * allocatestack.c (allocate_stack): Always initialize lock if
114         __ASSUME_CLONE_STOPPED is not defined.
115         * Makefile (tests): Add tst-sched1.
116         * tst-sched1.c: New file.
118         * sysdeps/pthread/createthread.c (do_clone): Only use
119         sched_setschduler and pass correct parameters.
121 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
123         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
124         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
125         PTHREAD_STACK_MIN in comments.
127 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
129         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
130         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
131         argument.
132         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
133         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
134         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
135         (__pthread_cleanup_upto): Fix prototype.
136         (_longjmp_unwind): Adjust caller.
137         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
138         Change second argument to const struct pointer.
139         * tst-sem8.c (main): Remove unused s2 and s3 variables.
140         * tst-sem9.c (main): Likewise.
141         * unwind.c: Include string.h for strlen prototype.
143 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
145         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
146         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
147         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
148         Define HAVE_CMOV.
149         Patch by Nicholas Miell <nmiell@attbi.com>.
151 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
153         * init.c (__pthread_initialize_minimal_internal): Initialize
154         GL(dl_init_static_tls).
155         * pthreadP.h (__pthread_init_static_tls): New prototype.
156         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
157         New functions.
158         * Makefile (tests): Add tst-tls4.
159         (modules-names): Add tst-tls4moda and tst-tls4modb.
160         ($(objpfx)tst-tls4): Link against libdl and libpthread.
161         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
162         tst-tls4modb.so.
163         * tst-tls4.c: New file.
164         * tst-tls4moda.c: New file.
165         * tst-tls4modb.c: New file.
167 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
169         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
170         before __timer_dealloc.
171         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
172         Don't call list_unlink.
174 2003-07-29  Roland McGrath  <roland@redhat.com>
176         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
178 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
180         * tst-cancel17.c (do_test): Check if aio_cancel failed.
181         Don't reuse struct aiocb A if it failed.
182         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
183         not just one byte, as that does not block.
185 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
187         * sysdeps/pthread/unwind-resume.c: New file.
188         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
189         unwind-resume in csu subdir.
190         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
191         exceptions.
192         (librt-sysdep_routines, librt-shared-only-routines): Add
193         rt-unwind-resume.
194         * sysdeps/pthread/rt-unwind-resume.c: New file.
195         * unwind-forcedunwind.c: New file.
196         * Makefile (libpthread-routines): Add unwind-forcedunwind.
197         (libpthread-shared-only-routines): Likewise.
198         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
199         * pthreadP.h (pthread_cancel_init): New prototype.
200         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
202         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
203         attr argument const struct pthread_attr *.
205         * res.c (__res_state): Return __resp.
206         * descr.h: Include resolv.h.
207         (struct pthread): Add res field.
208         * pthread_create.c: Include resolv.h.
209         (start_thread): Initialize __resp.
210         * Makefile (tests): Add tst-_res1.
211         (module-names): Add tst-_res1mod1, tst-_res1mod2.
212         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
213         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
214         libpthread.
215         * tst-_res1.c: New file.
216         * tst-_res1mod1.c: New file.
217         * tst-_res1mod2.c: New file.
219 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
221         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
223         * Makefile: Define various *-no-z-defs variables for test DSOs
224         which has undefined symbols.
226 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
228         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
229         Retry if the stwcx fails to store once_control.
231 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
233         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
234         pthread_attr_setaffinity.
235         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
236         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
237         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
238         * pthread_attr_destroy.c: Free cpuset element if allocated.
239         * pthread_create.c: Pass iattr as additional parameter to
240         create_thread.
241         * sysdeps/pthread/createthread.c: If attribute is provided and
242         a new thread is created with affinity set or scheduling parameters,
243         start thread with CLONE_STOPPED.
244         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
245         pthread_attr_setaffinity.
246         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
247         cpuset element.
249 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
251         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
253 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
255         * sysdeps/pthread/configure.in: Require CFI directives also for
256         ppc and s390.
258 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
260         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
261         Add cfi directives.
263 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
265         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
266         CLEANUP_JMP_BUF.
267         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
268         registers as variables.  Call __pthread_mutex_unlock_usercnt.
269         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
270         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
271         not self pointer in __writer.  Compare with TID to determine
272         deadlocks.
273         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
274         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
275         Likewise.
276         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
277         Likewise.
278         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
279         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
280         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
281         macros also when compiling librt.
283 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
285         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
286         -fasynchronous-unwind-tables.
287         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
288         (PSEUDO): Add cfi directives.
289         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
290         Likewise.
291         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
292         Likewise.
294 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
296         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
297         __pthread_unregister_cancel): Add prototypes and hidden_proto.
298         * unwind.c (__pthread_unwind_next): Add hidden_def.
299         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
300         Likewise.
301         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
302         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
303         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
304         Likewise.
305         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
306         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
307         Likewise.
308         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
309         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
310         __pthread_unregister_cancel and __pthread_unwind_next.
312 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
314         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
315         different symbol for the cancellation syscall wrapper and
316         non-cancellation syscall wrapper.
317         (PSEUDO_END): Define.
319 2003-07-05  Richard Henderson  <rth@redhat.com>
321         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
322         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
323         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
324         return actual return value from the syscall, not 0.
326 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
328         * descr.h (struct pthread): Add pid field.
329         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
330         (__reclaim_stacks): Likewise.
331         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
332         also check for PID of the signal source.
333         (__pthread_initialize_minimal_internal): Also initialize pid field
334         of initial thread's descriptor.
335         * pthread_cancel.c: Use tgkill instead of tkill if possible.
336         * sysdeps/unix/sysv/linux/fork.c: Likewise.
337         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
338         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
339         * sysdeps/unix/sysv/linux/raise.c: Likewise.
341 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
343         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
344         Fix use of parameter.
345         (__libc_cleanup_pop): Likewise.
347 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
349         * init.c (sigcancel_handler): Change parameters to match handler
350         for SA_SIGACTION.  Check signal number and code to recognize
351         invalid invocations.
353 2003-07-03  Roland McGrath  <roland@redhat.com>
355         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
356         Apply sizeof (struct pthread) bias to r13 value.
358 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
360         * sysdeps/pthread/configure.in: Require CFI directives.
362         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
363         definition.
364         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
365         libpthread compilation.
366         * unwind.c (__pthread_unwind): Add hidden_def.
367         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
369 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
371         * libc-cancellation.c (__libc_cleanup_routine): Define.
372         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
373         (__pthread_cleanup_pop): Define.
375 2003-07-01  Richard Henderson  <rth@redhat.com>
377         * sysdeps/alpha/elf/pt-initfini.c: New file.
378         * sysdeps/alpha/pthread_spin_lock.S: New file.
379         * sysdeps/alpha/pthread_spin_trylock.S: New file.
380         * sysdeps/alpha/pthreaddef.h: New file.
381         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
382         * sysdeps/alpha/tls.h: New file.
383         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
384         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
385         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
386         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
387         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
388         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
389         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
390         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
391         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
392         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
394 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
396         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
397         cleanup support and unwind info.
399 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
401         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
402         Use correct cleanup handler registration.  Add unwind info.
403         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
404         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
405         * tst-once3.c: Add cleanup handler and check it is called.
406         * tst-once4.c: Likewise.
407         * tst-oncex3.c: New file.
408         * tst-oncex4.c: New file.
409         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
411 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
413         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
415 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
417         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
418         (tf_msgsnd): Likewise.
420         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
421         premature returns a bit more.
423 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
425         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
426         definition to the front.
428         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
429         the cleanup functions to make the names unique.  Fix dwarf opcode
430         un unwind table.
431         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
432         functions to make the names unique.  Fix CFA offset for two blocks.
434 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
436         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
437         missing closing braces.
438         Patch by Christophe Saout <christophe@saout.de>.
440 2003-06-24  Roland McGrath  <roland@redhat.com>
442         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
444 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
446         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
447         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
449         * pthreadP.h: Declare __find_thread_by_id.
450         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
451         * pthread_clock_gettime.c: Allow using other thread's clock.
452         * pthread_clock_settime.c: Likewise.
453         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
454         * Makefile: Add rules to build and run tst-clock2.
455         * tst-clock2.c: New file.
457 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
459         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
460         to use exception-based cleanup handler.
461         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
463         * tst-cond8.c (ch): Announce that we are done.
465         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
467         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
468         Also test aio_suspend with timeout value.
470 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
472         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
473         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
474         attribute_hidden.
476         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
477         (__pthread_mutex_lock_internal): Likewise.
478         (__pthread_mutex_unlock_internal): Likewise.
479         (__pthread_mutex_unlock_usercnt): Declare.
480         * pthread_mutex_destroy.c: Always fail if used in any way.
481         * pthread_mutex_init.c: Update comment.
482         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
483         * pthread_mutex_timedlock.c: Adjust __nusers.
484         * pthread_mutex_trylock.c: Adjust __nusers.
485         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
486         and public interfaces are wrapper with pass additional parameter.
487         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
488         parameter zero.
489         * tst-mutex8.c: New file.
490         * Makefile (tests): Add tst-mutex8.
491         * sysdeps/pthread/pthread_cond_timedwait.c: Call
492         __pthread_mutex_unlock_usercnt.
493         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
494         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
495         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
496         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
497         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
498         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
499         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
500         Add __nusers.
501         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
502         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
503         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
504         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
505         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
507         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
508         * pthread_mutex_timedlock.c: Likewise.
509         * pthread_mutex_trylock.c: Adjust __nusers.
510         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
511         * tst-mutex9.c: New file.
512         * Makefile (tests): Add tst-mutex9.
513         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
514         * sysdeps/ia64/tls.h: Likewise.
515         * sysdeps/powerpc/tls.h: Likewise.
516         * sysdeps/s390/tls.h: Likewise.
517         * sysdeps/sh/tls.h: Likewise.
518         * sysdeps/x86_64/tls.h: Likewise.
519         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
520         Change type of __owner.
521         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
522         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
523         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
524         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
525         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
527 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
529         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
530         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
532         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
533         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
534         instead of nr to lll_futex_wake.  Only set errno and return -1
535         if err < 0.
537         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
538         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
539         return actual return value from the syscall, not 0.
541 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
543         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
544         find a random value.
545         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
546         errno==EIDRM.
548         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
549         compat_timer_settime.
550         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
551         compat_timer_gettime.
552         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
553         compat_timer_getoverrun.
554         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
555         compat_timer_delete.
557         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
558         error-checking mutex detect busy mutexes.
560 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
562         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
563         Add ax to clobber list.
564         (lll_mutex_cond_lock): Likewise.
565         (lll_mutex_unlock): Likewise.
566         (lll_lock): Likewise.
567         (lll_unlock): Likewise.
569         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
570         * tst-cancel18.c: New file.
571         * tst-cancelx18.c: New file.
573         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
574         and tcdrain.
576         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
577         * tst-cancel17.c: New file.
578         * tst-cancelx17.c: New file.
580         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
581         * sysdeps/unix/sysv/linux/sigwait.c: New file.
582         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
584         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
586 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
588         * sysdeps/pthread/createthread.c (create_thread): Set
589         header.multiple_threads unconditionally.
590         * allocatestack.c (allocate_stack): Likewise.
591         * descr.h (struct pthread): Add header.multiple_threads
592         unconditionally.
593         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
594         Define for librt.  #error if neither libpthread, libc nor librt.
595         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
596         Likewise.
597         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
598         CDISABLE): Likewise.
599         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
600         CDISABLE): Likewise.
601         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
602         CDISABLE): Likewise.
603         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
604         CDISABLE): Likewise.  Access header.multiple_threads outside of
605         libc and libpthread.
606         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
607         Likewise.
608         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
609         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
611 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
613         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
614         Also test early cancellation before the thread reaches the cancellation
615         point.
617         * Makefile: Compile forward.c with exceptions.
619         * sysdeps/unix/sysv/linux/sleep.c: New file.
621 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
623         * Makefile: Add CFLAGS definition to compile function wrappers
624         duplicated from libc with exceptions.
625         * tst-cancel4.c: Also check cancellation handlers.
627         * Makefile: Add rules to build and run tst-cancel16 and
628         tst-cancelx16.  Add missing CFLAGS definitions.
629         * tst-cancel16.c: New file.
630         * tst-cancelx16.c: New file.
632 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
634         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
635         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
636         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
637         (DL_SYSINFO_IMPLEMENTATION): Likewise.
639         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
640         (LIBC_CANCEL_RESET): Likewise.
641         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
642         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
643         librt-cancellation.
644         (CFLAGS-libcrt-cancellation.c): Define.
645         * sysdeps/pthread/librt-cancellation.c: New file.
646         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
647         macros also when compiling librt.
648         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
649         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
650         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
651         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
652         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
653         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
654         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
656         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
657         compat_timer_create.
659 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
661         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
663         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
664         __register_atfork.
665         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
666         Add libc_hidden_def.
668 2003-06-13  Roland McGrath  <roland@redhat.com>
670         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
671         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
673 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
675         * allocatestack.c (queue_stack): Always inline.
676         * ptreadhP.h (__do_cancel): Likewise.
678 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
680         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
681         a typo.
683 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
685         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
686         (__pthread_cond_signal): Remove incorrect second addition for
687         cond_lock!=0.
689 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
691         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
692         (__pthread_cond_signal): Use correct futex pointer in
693         __lll_mutex_lock_wait call.
695         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
696         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
698 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
700         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
701         cancelable.
702         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
703         Likewise.
705         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
706         hand-written CFI generation code.  Since ENTRY/END also initiated
707         CFI frames this caused two CFI sets to be generated.
709 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
711         * cleanup_routine.c: New file.
712         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
713         * sysdeps/pthread/pthread.h: Add support for fully exception-based
714         cleanup handling.
715         * Makefile (libpthread-routines): Add cleanup_routine.
716         Add more CFLAGS variables to compile with exceptions.  Add comments
717         why which file needs unwind tables.
718         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
719         tests.
720         * tst-cancelx1.c: New file.
721         * tst-cancelx2.c: New file.
722         * tst-cancelx3.c: New file.
723         * tst-cancelx4.c: New file.
724         * tst-cancelx5.c: New file.
725         * tst-cancelx6.c: New file.
726         * tst-cancelx7.c: New file.
727         * tst-cancelx8.c: New file.
728         * tst-cancelx9.c: New file.
729         * tst-cancelx10.c: New file.
730         * tst-cancelx11.c: New file.
731         * tst-cancelx12.c: New file.
732         * tst-cancelx13.c: New file.
733         * tst-cancelx14.c: New file.
734         * tst-cancelx15.c: New file.
735         * tst-cleanupx0.c: New file.
736         * tst-cleanupx0.expect: New file.
737         * tst-cleanupx1.c: New file.
738         * tst-cleanupx2.c: New file.
739         * tst-cleanupx3.c: New file.
741         * tst-cleanup0.c: Make standard compliant.
742         * tst-cleanup1.c: Likewise.
744         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
745         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
746         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
747         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
748         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
749         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
750         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
751         CLEANUP_JMP_BUF.
752         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
753         * tst-cancel12.c: New file.
754         * tst-cancel13.c: New file.
755         * tst-cancel14.c: New file.
756         * tst-cancel15.c: New file.
757         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
758         and tst-cancel15.
760         * tst-cancel1.c: Add some comments.
762         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
763         timeout correctly.
765 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
767         * Makefile (CFLAGS-pthread_cancel.c): Define.
769 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
771         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
772         Change type of __writer element to int.
773         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
774         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
775         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
776         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
777         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
778         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
779         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
780         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
781         Compare with TID to determine deadlocks.
782         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
783         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
784         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
785         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
786         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
787         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
788         Likewise.
789         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
790         Likewise.
791         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
792         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
793         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
794         Likewise.
795         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
796         Likewise.
797         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
798         * Makefile (tests): Add tst-rwlock12.
799         * tst-rwlock12.c: New file.
801 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
803         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
804         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
805         Remove bogus hidden_proto.
806         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
807         Likewise.
808         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
809         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
810         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
811         ___lll_mutex_timedlock): Likewise.
813 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
815         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
816         (__pthread_cond_signal): Add some code to eventually handle
817         cond_lock!=0.
819 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
821         * Makefile (tests): Add tst-exec4.
822         (tst-exec4-ARGS): Define.
823         * tst-exec4.c: New file.
825 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
827         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
828         Also fail if tv_nsec < 0.
829         (__lll_timedwait_tid): Likewise.
830         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
831         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
832         Likewise.
833         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
834         Likewise.
835         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
836         Likewise.
837         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
838         Likewise.
839         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
840         Likewise.
841         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
842         Likewise.
844         * Makefile (tests): Add tst-sem8 and tst-sem9.
845         * tst-sem8.c: New file.
846         * tst-sem9.c: New file.
847         * sem_open.c: Fix creation of in_use record if the file exists but
848         no internal record.
850         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
851         definitions.
853         * sysdeps/pthread/timer_create.c (timer_create): In case
854         evp==NULL, assign timer ID to sival_ptr.
856         * descr.h (struct pthread_unwind_buf): Change type of prev element to
857         struct pthread_unwind_buf *.
858         (struct pthread): Likewise for cleanup_jmp_buf element.
860         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
861         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
862         * unwind.c (__pthread_unwind_next): Likewise.
864 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
866         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
867         (lll_futex_timed_wait): Use int for futex value parameter.
868         (lll_futex_wake): Likewise.
869         (lll_futex_requeue): Likewise.
871         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
872         Replace one memory operation with one register operation.
874         * tst-join4.c (do_test): Fix error message.
876         * tst-rwlock6.c (do_test): Use correct format specifier.
878         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
879         (__lll_mutex_lock_wait): Replace one memory operation with one
880         register operation.
881         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
882         (__lll_mutex_lock_wait): Likewise.
884         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
885         (__lll_mutex_cond_lock): Add one to value parameter of
886         __lll_lock_wait to reflect reality in the futex syscall.
887         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
888         (lll_mutex_cond_lock): Likewise.
890 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
892         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
893         New function.
894         (lll_mutex_cond_lock): Define.
896 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
898         * Makefile (tests): Add tst-signal6.
899         * tst-signal6.c: New file.
901         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
902         (__lll_mutex_unlock_force): New function
903         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
905         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
906         (__lll_mutex_unlock_force): New function.
907         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
909         * tst-rwlock7.c (do_test): Use correct format specifier.
911         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
912         Find break parameter in correct asm argument.
914 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
916         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
917         Remove out4.
918         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
919         error occured.
920         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
921         Add __mutex.
922         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
923         lll_futex_requeue, lll_mutex_unlock_force): Define.
925 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
927         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
928         (pthread_cond_t): Add __mutex.
929         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
930         lll_futex_requeue, lll_mutex_unlock_force): Define.
932 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
934         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
935         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
936         Add __mutex field.
937         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
938         Define.
939         (lll_futex_wait, lll_futex_wake): Define.
940         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
941         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
942         FUTEX_REQUEUE instead of FUTEX_WAIT.
943         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
944         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
945         mutex which was used in condvar structure.  Call
946         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
947         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
949         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
950         include tcb-offsets.h.  Read wakeup value in locked region.
951         Use the value of gbr register as THREAD_ID.
952         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
953         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
954         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
956         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
957         macros.
959 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
961         * sysdeps/pthread/pthread_cond_broadcast.c
962         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
964 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
966         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
967         typo in register name.
968         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
969         correctly.  Actually use requeue.  Little optimization.
970         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
971         mutex address early.  Handle cancellation state as 32-bit value.
972         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
973         Remove unnecessary label.
975 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
977         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
978         instead of FUTEX_WAIT.
979         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
980         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
981         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
982         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
983         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
984         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
985         used in condvar structure.  Call __pthread_mutex_cond_lock instead
986         of __pthread_mutex_lock_internal.
987         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
988         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
989         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
990         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
991         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
992         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
993         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
994         Add pthread_mutex_cond_lock.
995         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
996         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
997         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
998         lll_mutex_cond_lock.
999         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1000         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1001         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1002         Add __mutex field.
1003         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1004         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1006         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
1007         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1009         * pthreadP.h: Declare __pthread_mutex_cond_lock.
1010         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
1011         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
1012         macro don't define aliases.
1014         * cancellation.c: Remove __pthread_enable_asynccancel_2.
1015         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
1016         * sysdeps/pthread/pthread_cond_timedwait.c: Use
1017         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
1018         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1019         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1020         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1021         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1022         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1024 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
1026         * sem_open.c: Fix one endless loop.  Implement correct semantics
1027         wrt opening the same semaphore more then once.
1028         * sem_close.c: Adjust for sem_open change.
1029         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
1030         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
1031         * Makefile (tests): Add tst-sem7.
1032         * tst-sem7.c: New file.
1034 2003-05-16  Roland McGrath  <roland@redhat.com>
1036         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
1037         uninitialized variable braino.
1039 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
1041         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
1042         test for syscall availability.
1044         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
1045         __no_posix_timers to -1 if the syscalls don't exist.
1047         * pthread_join.c (pthread_join): Set tid field of the joined
1048         thread to -1.  This isn't necessary but helps to recognize some
1049         error conditions with almost no cost.
1051         * allocatestack.c (FREE_P): Also negative values indicate an
1052         unused stack.
1054         * unwind.c: Include <unistd.h>.
1056 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
1058         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
1060 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
1062         * Makefile (crti-objs, crtn-objs): New variables.
1063         (omit-deps, extra-objs): Add crtn.
1064         ($(objpfx)libpthread.so): Depend on both crti and crtn
1065         and links to them in multidir.
1066         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
1068 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
1070         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1071         (lll_mutex_unlock): Use atomic_exchange_rel.
1073 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
1075         * cond-perf.c (cons): Add missing locking around setting of alldone.
1077 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
1079         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
1080         related macros.
1081         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
1083 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
1085         * tst-sem6.c: New file.
1086         * Makefile (tests): Add tst-sem6.
1088         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
1089         Use atomic_exchange_rel instead of atomic_exchange.
1090         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
1091         Likewise.
1093         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
1094         code for lll_futex_wait and lll_futex_wake in static apps.  Use
1095         vsyscall is possible.
1097         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
1098         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
1099         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
1100         pthread_setaffinity_np.
1101         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
1102         and pthread_setaffinity_np.
1103         * Makefile (libpthread-routines): Add pthread_getaffinity and
1104         pthread_setaffinity.
1106         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
1107         use it in case mmap to allocate the stack fails.
1108         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
1109         ARCH_MAP_FLAGS here.
1110         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
1111         ARCH_RETRY_MMAP.
1113 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
1115         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
1116         handler implementation.  It is now lockless in fork().
1117         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
1118         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1119         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
1120         declare the __fork_*_lists.
1121         (struct fork_handler): Include pointers to all three functions.
1122         Add next, refcntr and need_signal elements.
1123         (__fork_handlers): New declaration.
1124         (__register_atfork_malloc): Remove declaration.
1125         (HAVE_register_atfork_malloc): Remove definition.
1126         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
1127         __pthread_child_handler variable.
1128         (__libc_pthread_init): Use __register_atfork instead of explicitly
1129         adding to the list.
1130         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
1131         and lll_futex_wake.
1132         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1134         * unwind.c (unwind_cleanup): Print error message and then abort.  This
1135         function must never be reached.
1137         * cond-perf.c: New file.
1139 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
1141         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
1143 2003-05-04  Roland McGrath  <roland@redhat.com>
1145         * Makefile ($(objpfx)../libc.so): New target.
1147 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
1149         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1150         (pthread_condattr_t): Size is only an int, don't use long for
1151         alignment.
1152         (pthread_mutexattr_t): Likewise.
1153         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1154         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1155         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1157 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
1159         * sysdeps/i386/tls.h: Define THREAD_ID.
1160         * sysdeps/ia64/tls.h: Likewise.
1161         * sysdeps/powerpc/tls.h: Likewise.
1162         * sysdeps/s390/tls.h: Likewise.
1163         * sysdeps/sh/tls.h: Likewise.
1164         * sysdeps/x86_64/tls.h: Likewise.
1165         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
1166         record ownership.
1167         * pthread_mutex_timedlock.c: Likewise.
1168         * pthread_mutex_trylock.c: Likewise.
1169         * pthread_mutex_unlock.c: Likewise.
1170         * pthread_rwlock_trywrlock.c: Likewise.
1171         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
1172         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
1173         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1174         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
1176         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
1177         flag.
1179 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
1181         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1182         (__SIZEOF_PTHREAD_COND_T): Define to 48.
1183         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
1184         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1185         Make __align long long instead of long.
1186         (pthread_rwlock_t): Formatting.
1187         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
1188         (pthread_rwlock_t): Formatting.
1189         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1190         (pthread_cond_t): Make __align long long instead of long.
1191         (pthread_rwlock_t): Move __flags field to the same position as in
1192         linuxthreads.
1194 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
1196         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
1197         * tst-rwlock7.c (do_test): Likewise.
1199 2003-04-26  Roland McGrath  <roland@redhat.com>
1201         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
1203 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
1205         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
1206         sizeof (struct pthread).
1207         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
1208         1 struct pthread.
1209         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
1210         to 0.
1211         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
1212         struct pthread.
1213         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
1214         to 32-bit bytes.
1215         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
1216         tcbp.
1217         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
1218         unneccessarily.
1219         (NO_TLS_OFFSET): Define.
1220         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
1221         add TLS_TCB_SIZE unnecessarily.
1223 2003-04-22  Roland McGrath  <roland@redhat.com>
1225         * Makeconfig (shared-thread-library): Reverse link order to work
1226         around linker bug.
1228 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
1230         * semaphore.h: Fix typo in comment.
1232 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
1234         * sysdeps/pthread/sigfillset.c: New file.
1236         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
1237         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
1238         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
1239         * sysdeps/pthread/sigaction.c: Likewise.
1240         * sysdeps/pthread/sigprocmask.c: New file.
1241         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
1242         __SIGRTMIN+1.
1243         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1244         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
1245         in this case.
1247 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
1249         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
1250         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
1252         * sysdeps/unix/sysv/linux/unregister-atfork.c
1253         (__unregister_atfork): Don't free memory not allocated dynamically.
1255         * semaphore.h: Remove __THROW marker from cancellation points.
1256         * nptl/sysdeps/pthread/pthread.h: Likewise.
1258 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
1260         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
1261         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
1262         __THROW.
1264 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
1266         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
1268 2003-04-15  Roland McGrath  <roland@redhat.com>
1270         * forward.c (__pthread_unwind): Tweak to avoid warning.
1272 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
1274         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
1276 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
1278         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
1279         overflow CFA advance instructions.
1280         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1282 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
1284         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
1285         * sysdeps/i386/pthread_spin_lock.c: Likewise.
1286         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
1287         defined.
1289         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
1290         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
1291         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
1292         DW_CFA_advance_loc for .Laddl-.Lsubl.
1294 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
1296         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
1297         position-independent unwind data for static libraries.
1298         Add missing unwind info.  Add comments.
1300         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
1301         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1302         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1303         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1305 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
1307         * Makefile: Make sure all cancellation points are compiled with
1308         exception and asynchronous unwind tables.
1310         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
1311         which mishandles loading of global object addresses in PIC.
1312         (THREAD_SETMEM_NC): Likewise.
1314 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
1316         * pthread.h: Define new data structure for cleanup buffer.  Declare
1317         new cleanup handler interfaces.
1318         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
1319         (struct pthread): Add cleanup_jmp_buf pointer.  Define
1320         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
1321         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
1322         it.  Declare old cleanup handler installation functions.
1323         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
1324         handling.
1325         * cleanup_defer.c: Likewise.
1326         * cleanup_compat.c: New file.  Old cleanup code.
1327         * cleanup_def_compat.c: New file.  Old cleanup code.
1328         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
1329         if own thread descriptor.
1330         * unwind.c: New file.
1331         * forward.c: Add __pthread_unwind.
1332         * init.c (pthread_functions): Add __pthread_unwind.
1333         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
1334         Add ptr___pthread_unwind.
1335         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
1336         and unwind function.
1337         * Makefile (libpthread-routines): Add cleanup_compat,
1338         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
1339         table generation if necessary.
1340         * version.c: Record whether unwind support is compiled in.
1341         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
1342         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
1343         handler interfaces.
1344         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
1345         complication to generate unwind information for syscall wrappers.
1346         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1347         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
1348         __cleanup_fct_attribute.
1350         * Makefile: Add rules to build and run tst-cleanup0.
1351         * tst-cleanup0.c: New file.
1352         * tst-cleanup0.expect: New file.
1354         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
1355         caller.  Optimize to avoid often unecessary local variable.
1357 2003-04-11  Roland McGrath  <roland@redhat.com>
1359         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
1360         sets variable `multidir'; include that.
1361         (generated): Add it.
1362         ($(objpfx)$(multidir)/crti.o): New target.
1363         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
1365 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
1367         * tst-attr2.c (do_test): Add cast to avoid warning.
1368         * tst-mutex4.c (do_test): Likewise.
1370 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
1372         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
1373         in child.
1375 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
1377         * Makefile (tests): Add tst-detach1.
1378         * tst-detach1.c: New file.
1380 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
1382         * sysdeps/pthread/pthread.h: Remove duplicate
1383         pthread_cleanup_{push,pop} definitions.
1385         * tst-barrier2.c: Eliminate warnings.
1386         * tst-cancel4.c: Likewise.
1387         * tst-cond4.c: Likewise.
1388         * tst-cond6.c: Likewise.
1389         * tst-detach1.c: Likewise.
1390         * tst-rwlock4.c: Likewise.
1391         * tst-rwlock6.c: Likewise.
1392         * tst-rwlock7.c: Likewise.
1393         * tst-sem3.c: Likewise.
1394         * tst-spin2.c: Likewise.
1395         * tst-umask1.c: Likewise.
1397 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
1399         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
1401 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
1403         * descr.h (struct pthread): Move cancelhandling member to the front.
1405 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
1407         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
1408         malloc_parent, and malloc_child statically.
1409         (__register_atfork_malloc): New function.
1410         (free_mem): Don't free any of the malloc_* variables on the list.
1411         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
1412         Define HAVE_register_atfork_malloc.
1414 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
1416         * sysdeps/pthread/createthread.c (create_thread): Add some more
1417         comments explaining when to set multiple_threads and when not.
1419         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
1420         THREAD_ATOMIC_BIT_SET if not already defined.
1421         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
1422         THREAD_ATOMIC_BIT_SET:
1423         * sysdeps/x86_64/tls.h: Likewise.
1424         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
1425         THREAD_ATOMIC_CMPXCHG_VAL.
1426         (_pthread_cleanup_pop_restore): Likewise.
1427         * cancellation.c (__pthread_enable_asynccancel): Likewise.
1428         (__pthread_enable_asynccancel_2): Likewise.
1429         (__pthread_disable_asynccancel): Likewise.
1430         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
1431         (__libc_disable_asynccancel): Likewise.
1432         * init.c (sigcancel_handler): Likewise.
1433         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
1434         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
1436 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
1438         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
1439         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
1440         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
1441         * Makefile (tests): Add tst-cancel11.
1442         * tst-cancel11.c: New file.
1444 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
1446         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
1447         round, not the first.  Use specific_used flag instead of local
1448         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
1449         (__free_tcb): Don't call deallocate_tsd here.
1450         (start_thread): Call deallocate_tsd here.
1451         * pthread_setspecific.c: Set specific_used flag really only when
1452         needed.
1453         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
1454         * tst-tsd3.c: New file.
1455         * tst-tsd4.c: New file.
1457 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
1459         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
1460         Use atomic_exchange_and_add instead of __lll_add.
1461         (__lll_mutex_timedlock): Likewise.
1462         Patch by Ian Wienand.
1464 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
1466         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1467         (SINGLE_THREAD_P): Fix typo.
1468         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
1470 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
1472         * Makefile (tests): Add tst-align.
1473         * tst-align.c: New file.
1474         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
1476         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
1477         function correctly.
1479         * tst-tsd2.c: Add casts to avoid warnings.
1481 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
1483         * descr.h (struct pthread): Move most often used elements to the front.
1485 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
1487         * Makefile (libpthread-routines): Add pthread_atfork.
1488         (libpthread-static-only-routines): Add pthread_atfork.
1490 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1492         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
1493         of TLS_DTV_AT_TP.
1494         (INSTALL_DTV): Add parens.
1495         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
1496         Use passed descr instead of THREAD_SELF.
1497         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
1498         (__lll_mutex_timedlock_wait): Correct expected value after
1499         spurious wakeup.
1500         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
1501         Release lock before waking up the waiters.
1502         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
1503         criteria.  Reorderstruct passed to cleanup handler.  Fix
1504         handling of cancellation and failung pthread_mutex_unlock call.
1505         Use __pthread_enable_asynccancel_2 instead of
1506         __pthread_enable_asynccancel.
1507         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1508         Return result of lock re-get if it fails.
1509         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
1510         for __pthread_cleanup_push.
1511         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
1512         completely broken rwlock implementation.
1513         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1514         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1515         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1516         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1517         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1518         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
1519         versioned_symbol macro.
1520         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
1521         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
1523 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
1525         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
1526         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
1527         and __helper_tid.
1528         (struct timer): Remove th and bar field.
1529         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
1530         debugging code.  Create only one helper thread.
1531         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
1532         helper thread.
1533         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1534         Renamed.  Define statically.  Use thread info from siginfo.
1535         (__helper_once): New variable.
1536         (__helper_tid): New variable.
1537         (__reset_helper_control): New function.
1538         (__start_helper_thread): New function.
1540         * pthread_create.c (start_thread): Don't use setjmp inside
1541         __builtin_expect to work around gcc bug.
1543         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
1544         timer_delete syscall fails, but not with ENOSYS, set
1545         __no_posix_timers.
1547         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
1548         (timer_settime): Fix typo.
1549         * sysdeps/unix/sysv/linux/timer_getoverr.c
1550         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
1552 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
1554         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
1555         offset of cleanupbuf.__prev.
1557 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
1559         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
1560         of included file.
1562 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
1564         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
1565         NULL provide default definition to syscall.
1567 2003-03-25  Roland McGrath  <roland@redhat.com>
1569         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
1570         (timer_id2ptr): Fix typo.
1572 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
1574         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
1575         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
1576         * sysdeps/ia64/pthreaddef.h: Likewise.
1577         * sysdeps/powerpc/pthreaddef.h: Likewise.
1578         * sysdeps/s390/pthreaddef.h: Likewise.
1579         * sysdeps/sh/pthreaddef.h: Likewise.
1580         * sysdeps/x86_64/pthreaddef.h: Likewise.
1581         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
1582         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
1583         being changed.
1584         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
1585         SIGTIMER is not unblocked.
1586         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
1587         RT signal taken.
1588         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
1589         be send.
1590         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
1591         pass pointer through as ID.
1592         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
1593         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
1594         * sysdeps/unix/sysv/linux/timer_create.c: New file.
1595         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
1596         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
1597         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
1598         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
1599         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
1600         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
1601         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
1602         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
1603         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
1604         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
1605         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
1606         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
1607         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
1608         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
1609         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
1610         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
1611         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
1612         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
1613         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
1614         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
1615         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
1616         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
1617         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
1618         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
1619         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
1620         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
1621         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
1622         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
1623         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
1624         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
1626         * pthreadP.h: Remove FRAME_LEFT definition.
1627         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
1628         already left frame.  Programs which have this problem are not POSIX
1629         compliant.
1630         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
1632 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
1634         * sysdeps/pthread/tst-timer.c: Check return values of the
1635         functions we test.
1637 2003-03-23  Roland McGrath  <roland@redhat.com>
1639         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
1640         * tst-tls3mod.c: Likewise.
1641         * tst-tls1.c: Likewise.
1642         * tst-tls2.c: Likewise.
1644         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
1645         undefined behavior.
1647         * tst-join5.c (tf1, tf2): Add a cast.
1649         * Makeconfig (includes): Append -I$(..)nptl to this variable.
1651         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
1652         Don't test anything.
1653         * tst-cond4.c: Likewise.
1654         * tst-cond6.c: Likewise.
1655         * tst-flock2.c: Likewise.
1656         * tst-mutex4.c: Likewise.
1657         * tst-rwlock4.c: Likewise.
1658         * tst-signal1.c: Likewise.
1659         * tst-spin2.c: Likewise.
1660         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
1662         * tst-mutex4.c: Use test-skeleton.c.
1663         * tst-spin2.c: Likewise.
1664         * tst-sysconf.c: Likewise.
1665         * tst-barrier2.c: Likewise.
1666         * tst-cond4.c: Likewise.
1667         * tst-cond6.c: Likewise.
1668         * tst-rwlock4.c: Likewise.
1669         * tst-unload.c: Likewise.
1670         * tst-flock2.c (do_test): Use return instead of exit.
1672 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
1674         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
1676 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
1678         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
1679         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
1680         instead of __lll_compare_and_swap.
1681         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
1682         Likewise.
1683         Removed definition if __lll_compare_and_swap.
1685         * cancellation.c: Adjust for new form of compare&exchange macros.
1686         * cleanup_defer.c: Likewise.
1687         * init.c: Likewise.
1688         * libc-cancellation.c: Likewise.
1689         * old_pthread_cond_broadcast.c: Likewise.
1690         * old_pthread_cond_signal.c: Likewise.
1691         * old_pthread_cond_timedwait.c: Likewise.
1692         * old_pthread_cond_wait.c: Likewise.
1693         * pthread_cancel.c: Likewise.
1694         * pthread_create.c: Likewise.
1695         * pthread_detach.c: Likewise.
1696         * pthread_join.c: Likewise.
1697         * pthread_key_delete.c: Likewise.
1698         * pthread_setcancelstate.c: Likewise.
1699         * pthread_setcanceltype.c: Likewise.
1700         * pthread_timedjoin.c: Likewise.
1701         * pthread_tryjoin.c: Likewise.
1702         * sysdeps/pthread/createthread.c: Likewise.
1704 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
1706         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
1707         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
1708         definitions.  Replace uses with calls to atomic_* functions.
1709         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1710         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
1711         __lll_test_and_set calls with atomic_exchange_and_add and
1712         atomic_exchange calls respectively.
1713         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1714         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1715         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
1716         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1717         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
1718         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
1719         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
1721         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
1722         returns the old value.
1724 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
1726         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
1727         int for variable OLDVAL and correct inline assembler contraint.
1728         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
1729         type int for variable OLD.
1731         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
1732         only for s390-32.
1733         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1734         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
1735         instead of multiple_threads field in the TCB.
1737 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
1739         * sysdeps/i386/i686/bits/atomic.h: Removed.
1740         * sysdeps/i386/i586/bits/atomic.h: Removed.
1741         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
1742         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
1743         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
1744         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
1745         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
1746         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
1747         * atomic.h: Removed.  Moved to glibc.
1749         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
1750         support for clock selection.
1752         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
1753         signalling waiters.
1755 2003-03-18  Roland McGrath  <roland@redhat.com>
1757         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
1758         Add __lll_rel_instr first.  Add memory clobber.
1759         (lll_mutex_unlock): Use __lll_test_and_set.
1760         From Paul Mackerras <paulus@samba.org>.
1762         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
1763         unconditionally.
1764         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1765         (SINGLE_THREAD_P):  Add `header.' prefix.
1766         From Paul Mackerras <paulus@samba.org>.
1768         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
1769         pthread_timedjoin_np to ...
1770         (libpthread: GLIBC_2.3.3): ... here.
1771         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
1773         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1774         Avoid shadowing VAL variable.
1776         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
1777         New macro.
1779 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
1781         * Makefile (tests): Add tst-cond11.
1782         * tst-cond11.c: New file.
1784         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
1785         struct passed to cleanup handler to eliminate one more
1786         instruction.
1787         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1789         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1790         (pthrad_cond_t): Replace __unused field with __clock.
1792         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
1793         waken all waiters in cleanup handler.
1794         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1795         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1797         * pthread_condattr_getclock.c: New file.
1798         * pthread_condattr_setclock.c: New file.
1799         * sysdeps/pthread/pthread.h: Declare these new functions.
1800         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
1801         * Makefile (libpthread-routines): Add the new functions.
1802         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
1803         Renamed field to value.  Document use of the bits.
1804         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
1805         change.
1806         * pthread_condattr_setpshared.c: Likewise.
1807         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
1808         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
1809         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1810         Add __clock field.
1811         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1812         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1813         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1814         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1815         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1816         Implement clock selection.
1817         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1818         * pthread-errnos.sym: Add ENOSYS.
1819         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1820         _POSIX_CLOCK_SELECTION.
1821         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1823         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
1824         invalid .size directive.
1826 2003-03-17  Roland McGrath  <roland@redhat.com>
1828         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
1829         Formatting tweaks.
1831 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
1833         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
1834         Use __lll_add instead of spelling it out.  Use protected symbol names.
1835         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
1836         Use __lll_add.
1837         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
1838         Renamed from lll_compare_and_swap.  Use new name where necessary.
1839         (__lll_add): Defined.
1840         (__lll_dec_if_positive): Defined.
1841         (__lll_test_and_set): Defined.
1842         * sysdeps/ia64/pthread_spin_init.c: Removed.
1843         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
1844         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
1845         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
1846         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
1847         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
1848         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
1849         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
1850         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
1851         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1852         __sync_lock_release_si.
1853         Patch by Jakub Jelinek.
1855         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
1856         Fix timeout handling.
1857         (__lll_timedwait_tid): Likewise.
1858         (lll_unlock_wake_cb): Wake up other waiters if necessary.
1859         Patch by Jakub Jelinek.
1861         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
1863 2003-03-17  Roland McGrath  <roland@redhat.com>
1865         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
1866         * sysdeps/pthread/pthread_spin_init.c: New file.
1867         * sysdeps/pthread/pthread_spin_unlock.c: New file.
1868         * sysdeps/powerpc/Makefile: New file.
1869         * sysdeps/powerpc/pthread_spin_lock.c: New file.
1870         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
1871         * sysdeps/powerpc/pthreaddef.h: New file.
1872         * sysdeps/powerpc/tcb-offsets.sym: New file.
1873         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
1874         * sysdeps/powerpc/tls.h: New file.
1875         * sysdeps/powerpc/bits/atomic.h: New file.
1876         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
1877         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
1878         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
1880         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
1881         * sysdeps/unix/sysv/linux/sem_post.c: New file.
1882         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
1883         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
1884         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
1885         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
1886         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
1887         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
1888         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
1889         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
1890         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
1891         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
1892         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
1893         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
1894         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
1896         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
1897         not gettimeofday.
1898         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
1899         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
1900         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
1901         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
1902         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
1904 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
1906         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
1907         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1908         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1909         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1910         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
1912 2003-03-16  Roland McGrath  <roland@redhat.com>
1914         * tst-fork4.c: Include <string.h>.
1915         * tst-signal2.c: Likewise.
1916         * tst-mutex5.c (do_test): exit -> return.
1917         * tst-mutex2.c: Include <stdlib.h>.
1919 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
1921         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
1922         (__lll_mutex_timedlock_wait): Correct expected value after
1923         spurious wakeup.  Otherwise we would never wait again.
1925         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
1926         zone versus inline asm stupidity.  Use correct instructions.
1928         * tst-rwlock6.c: Add some more status output.
1930 2003-03-15  Roland McGrath  <roland@redhat.com>
1932         * sysdeps/pthread/configure.in: New file.
1933         * sysdeps/pthread/configure: New file (generated).
1935 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
1937         * allocatestack.c (allocate_stack): Store the exact stack size of
1938         user allocated stacks.
1940 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
1942         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1943         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
1944         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
1945         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
1946         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1947         Use `header.' prefix.
1948         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
1950 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
1952         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
1953         __builtin_frame_address, use stack pointer.
1955         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
1956         instead of __builtin_frame_pointer.
1958 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
1960         * tst-basic1.c (do_test): Add cast to avoid warning.
1961         * tst-basic2.c (do_test): Likewise.
1963         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
1964         amount of stack correction.
1966         * tst-fork4.c: Use test-skeleton.c.
1968 2003-03-14  Roland McGrath  <roland@redhat.com>
1970         * init.c: Fix typo "#eli" for "#else".
1972 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
1974         * allocatestack.c (__stack_user): Use hidden_data_def.
1975         * pthread_create.c (__pthread_keys): Likewise.
1977         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
1979 2003-03-14  Roland McGrath  <roland@redhat.com>
1981         * tst-fork4.c: New file.
1982         * Makefile (tests): Add it.
1984         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
1985         we always define the padding space.
1986         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
1987         stopped supporting its own extensions fully.
1988         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
1989         struct also called `header', so `header.multiple_threads' is the field
1990         name to use on all machines.
1991         * allocatestack.c (allocate_stack): Use `header.' prefix.
1992         * sysdeps/pthread/createthread.c (create_thread): Likewise.
1993         * pthread_create.c (__pthread_create_2_1): Likewise.
1994         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
1995         (THREAD_SELF): Likewise.
1996         * sysdeps/x86_64/tls.h: Likewise.
1997         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
1998         (SINGLE_THREAD_P): Likewise.
1999         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
2000         (SINGLE_THREAD_P): Likewise.
2001         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2002         (SINGLE_THREAD_P): Likewise.
2004         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
2005         value directly.
2007 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
2009         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
2010         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
2012         * pthread_create.c (start_thread): setjmp is expected to return 0.
2014         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
2015         (THREAD_GETMEM_NC): Likewise.
2017 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
2019         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
2020         and the size of the stack which must be allocated is a multiple,
2021         allocate one more page.
2022         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
2023         MULTI_PAGE_ALIASING.
2025 2003-03-13  Roland McGrath  <roland@redhat.com>
2027         * pthread_create.c (start_thread): Set EXITING_BIT after the
2028         event-reporting (and destructors), not before.
2030 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
2032         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
2033         lll_futex_wake): Declare register variables as long int instead of
2034         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
2035         Make syscall arguments clobbered by the syscall.
2036         (lll_futex_wait): Define using lll_futex_timed_wait.
2038         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
2039         to void *.
2041         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
2042         PPID if [! NDEBUG].
2044         * allocatestack.c (nptl_ncreated): Only declare if
2045         COLORING_INCREMENT != 0.
2047         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
2048         (__libc_enable_asynccancel_2): Remove prototype.
2050         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
2051         ctid to match kernel.
2053 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
2055         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
2056         libc_multiple_threads.
2057         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
2058         __libc_multiple_threads to...
2059         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
2061         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
2062         versioning.
2063         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2064         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2066         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
2067         (__pthread_once_internal): Define.
2069         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
2070         macros instead of .symver directly.
2071         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2072         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2074         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
2075         * sysdeps/x86_64/tcb-offsets.sym: New file.
2076         * sysdeps/x86_64/Makefile: New file.
2078         * sysdeps/i386/tcb-offsets.sym: Add SELF.
2079         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
2080         to access own pthread_t in TCB.
2081         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2082         Likewise.
2083         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2084         Likewise.
2085         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2087 2003-03-12  Roland McGrath  <roland@redhat.com>
2089         * pthread-errnos.sym: New file.
2090         * Makefile (gen-as-const-headers): New variable, list that file.
2091         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
2092         header <pthread-errnos.h> instead of defining errno values here.
2093         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2094         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2095         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2096         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2097         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2098         Likewise.
2099         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2100         Likewise.
2101         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2102         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2103         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
2104         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2105         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2106         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2107         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2108         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2109         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2110         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
2111         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2112         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
2113         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2114         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
2115         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
2116         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2117         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2118         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2119         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2120         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
2121         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2122         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
2123         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
2124         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
2125         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
2126         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2127         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2129         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
2130         CLONE_CHILD_SETTID worked.
2132 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
2134         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
2135         file.
2136         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
2137         file.
2139         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
2140         (pthread_cond_t): Add padding.
2142         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
2143         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
2144         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
2146         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
2147         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
2148         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
2149         (__pthread_rwlock_timedrdlock): Likewise.
2150         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
2151         (__pthread_rwlock_wrlock): Likewise.
2152         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
2153         (__pthread_rwlock_rdlock): Likewise.
2155         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
2157         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
2158         result of lock re-get if it fails.
2160 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
2162         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
2163         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2164         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
2165         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2166         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2167         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
2168         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2169         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2170         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2171         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2173         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
2174         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
2176         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
2177         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
2178         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
2179         (create_thread): Likewise.
2180         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
2181         * init.c (__pthread_initialize_minimal_internal): Initialize
2182         __libc_multiple_threads_ptr if necessary.
2183         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
2184         __pthread_multiple_threads and __libc_multiple_threads_ptr.
2185         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
2186         __libc_multiple_threads.
2187         (__libc_pthread_init): Return pointer to __libc_pthread_init if
2188         necessary.
2190         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
2191         (THREAD_SETMEM_NC): Likewise.
2193         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
2194         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
2195         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
2196         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
2198         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
2199         Eliminate one entire instruction.
2201         * cancellation.c (__pthread_enable_asynccancel_2): New function.
2202         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
2203         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2204         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
2205         instead of __pthread_enable_asynccancel.
2206         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2207         (__pthread_cond_wait): Likewise.
2208         * sysdeps/pthread/pthread_cond_timedwait.c
2209         (__pthread_cond_timedwait): Likewise.
2210         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2212         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2213         (__condvar_cleanup): Wake up all waiters in case we got signaled
2214         after being woken up but before disabling asynchronous
2215         cancellation.
2216         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
2217         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2218         (__condvar_cleanup): Likewise.
2220         * init.c (__NR_set_tid_address): If already defined, don't redefine.
2221         Make it an error if architecture has no #if case.  Add x86-64.
2223         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
2224         pt-initfini.s generation.
2226         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
2227         (TLS_INIT_TP): Fix typo.
2229 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
2231         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
2232         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
2234         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
2235         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
2236         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
2237         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
2238         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
2239         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
2240         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
2241         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
2243 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
2245         * sysdeps/pthread/pthread_cond_timedwait.c
2246         (__pthread_cond_timedwait): Return the result of the final
2247         locking.  If it succeeds, the regular function return value.
2249         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
2250         Return result of the final locking.
2251         * version.c (__nptl_main): Work around problems with the strange
2252         INTERNAL_SYSCALL macro on ppc32.
2253         * init.c (__pthread_initialize_minimal_internal): Unblock
2254         SIGCANCEL in case the parent blocked it.
2255         Reported by Paul Mackerras <paulus@samba.org>.
2257         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
2258         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
2259         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
2261 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
2263         * sysdeps/pthread/pthread_cond_timedwait.c
2264         (__pthread_cond_timedwait): Unlock and fail if
2265         __pthread_mutex_unlock_internal failed.
2267         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
2268         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
2269         Use ARCH_CLONE.
2270         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
2271         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
2272         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
2273         ALLOCATE_STACK): New macros.
2274         (TLS_TPADJ): New macro.
2275         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
2276         (allocate_stack): Handle TLS_DTV_AT_TP and
2277         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
2278         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
2279         Don't set PD->self.
2280         * init.c [__ia64__] (__NR_set_tid_address): Define.
2282         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
2283         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
2284         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
2285         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
2286         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
2287         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
2288         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
2289         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
2290         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
2291         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
2292         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
2293         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
2294         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
2295         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
2296         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
2297         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
2298         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
2299         * sysdeps/ia64/bits/atomic.h: New file.
2300         * sysdeps/ia64/Makefile: New file.
2301         * sysdeps/ia64/pthread_spin_init.c: New file.
2302         * sysdeps/ia64/pthread_spin_lock.c: New file.
2303         * sysdeps/ia64/pthread_spin_trylock.c: New file.
2304         * sysdeps/ia64/pthread_spin_unlock.c: New file.
2305         * sysdeps/ia64/pthreaddef.h: New file.
2306         * sysdeps/ia64/tcb-offsets.sym: New file.
2307         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
2308         * sysdeps/ia64/tls.h: New file.
2310         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
2311         to syscall instead of no arguments.
2313 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
2315         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
2316         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
2317         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
2318         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
2320         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
2321         unused code.
2323         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
2325         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2326         lowlevelbarrier.sym.
2327         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
2328         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
2329         Include lowlevelbarrier.h and don't define offsets locally.
2330         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
2332         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2333         (__lll_mutex_lock_wait): Reverse order of first two parameters.
2334         (__lll_mutex_timedlock_wait): Likewise.
2335         (lll_mutex_lock): Adjust asm for that.
2336         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
2337         (lll_lock): Adjust asm for operand order change.
2338         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
2339         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
2341         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
2342         Reverse order of parameters.
2343         (__lll_timedwait_tid): Remove regparms attribute.
2344         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
2345         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
2347         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2348         (__lll_timedwait_tid): Remove one unnecessary instruction.
2350         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
2351         __lll_mutex_timedlock_wait only for NOT_IN_libc.
2352         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
2353         lowlevelmutex.S.
2355         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
2356         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
2357         for NOT_IN_libc.
2358         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
2359         lowlevellock.S.
2361         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
2362         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
2363         for libc.so.
2364         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
2365         define LOCK here (if UP is not defined).  The actual code is in
2366         lowlevelmutex.S.
2368         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
2369         LOCK is already defined.  Don't define lll_unlock_wake_cb and
2370         __lll_timedwait_tid for libc.so.
2371         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
2372         define LOCK here (if UP is not defined).  The actual code is in
2373         lowlevellock.S.
2375         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
2376         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
2377         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
2378         instead of lowlevelsem.h.
2379         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
2380         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
2381         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
2383         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2384         lowlevelrwlock.sym.
2385         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
2386         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
2387         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
2389         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
2390         register loading.
2391         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
2392         last changed.  D'oh.
2394         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
2396         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
2397         of __libc_locking_needed.
2398         (lll_trylock): Initialize %eax to zero.
2400         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
2401         pthread_cond_t definition.
2403 2003-03-10  Roland McGrath  <roland@redhat.com>
2405         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
2406         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
2407         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
2408         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
2409         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
2411         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
2412         Instead of setting PD->multiple_threads, set globals
2413         __pthread_multiple_threads and __libc_multiple_threads.
2414         * sysdeps/pthread/createthread.c (create_thread): Likewise.
2415         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
2416         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
2418         * descr.h (struct pthread): Conditionalize first member on
2419         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
2420         containing an anonymous tcbhead_t.  Move `list' member out.
2421         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
2422         * allocatestack.c: Remove use of `header.data.' prefix.
2423         * pthread_create.c: Likewise.
2424         * init.c (__pthread_initialize_minimal_internal): Likewise.
2425         * sysdeps/pthread/createthread.c (create_thread): Likewise.
2426         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
2427         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
2428         * sysdeps/x86_64/tls.h: Likewise.
2429         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
2430         (SINGLE_THREAD_P): Likewise.
2431         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
2432         (SINGLE_THREAD_P): Likewise.
2433         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
2434         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
2436 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
2438         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
2440         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
2441         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
2443         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
2444         leftovers from the ia32 code.
2446         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
2447         memory load.
2448         (clear_once_control): Don't load %esi.
2450         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
2451         handling.
2453         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
2455         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
2456         * sysdeps/unix/sysv/linux/createthread.c: ...here.
2458         * Makefile (tests): Add tst-cond10.
2459         * tst-cond10.c: New file.
2461 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
2463         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
2464         * tst-signal3.c (do_test): Likewise.
2465         * tst-sem5.c (do_test): Likewise.
2466         * tst-kill6.c (do_test): Likewise.
2467         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
2469         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
2470         of inc/dec.
2471         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
2472         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
2473         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2474         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2475         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2476         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2477         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2478         Likewise.
2479         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2480         Likewise.
2481         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2482         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2483         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2484         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2485         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2486         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2487         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
2488         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2490         * allocatestack.c (allocate_stack): If mprotect() fails free the
2491         TLS memory.
2493 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
2495         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
2497         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
2498         lll_wake_tid.  This was used only to work around kernel limits in
2499         the early days.
2500         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2501         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
2502         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2503         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2505         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
2506         (__pthread_initialize_minimal_internal): Change initialization of
2507         __static_tls_align_m1 appropriately.
2508         * pthreadP.h (__static_tls_align_m1): Renamed from
2509         __static_tls_align.
2510         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
2511         instead of __static_tls_align-1.
2513 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
2515         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
2517         * pthread_create.c: Define __pthread_keys using nocommon
2518         attribute, not by placing it explicitly in bss.
2519         Remove DEFINE_DEALLOC definition.  Not needed anymore.
2521         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
2522         Use it in mmap call to allocate stacks.
2524         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
2526         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
2527         result of the thread function.
2529 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
2531         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
2532         version is just fine.
2534         * sysdeps/unix/sysv/linux/libc_pthread_init.c
2535         (__pthread_child_handler): Renamed from pthread_child_handler,
2536         exported, and marked hidden.  Change all users.
2537         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
2538         free __pthread_child_handler from child list.
2540 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2542         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
2544         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2545         Fix handling of cancellation and failing pthread_mutex_unlock call.
2546         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
2547         (__pthread_cond_wait): Likewise.
2549         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
2550         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
2551         lll_futex_timed_wait call.
2552         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2553         (pthread_rwlock_timedwrlock): Likewise.
2555         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2556         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
2557         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
2559         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
2560         check of lll_futex_wake return value.
2562 2003-03-03  Roland McGrath  <roland@redhat.com>
2564         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
2566         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2567         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
2568         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2570 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
2572         * sysdeps/pthread/timer_create.c (timer_create): Return correct
2573         error for CPU clocks.
2575         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2576         _POSIX_MONOTONIC_CLOCK.
2577         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2579         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
2580         recent kernels.
2582 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
2584         * descr.h (struct pthread): Move cleanup field to the front.
2586 2003-03-01  Roland McGrath  <roland@redhat.com>
2588         * sem_open.c (sem_open): Braino fix.
2590 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
2592         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
2593         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
2594         __pthread_cleanup_pop functionality.
2595         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2597         * descr.h (struct pthread): Move tid field to the front now that
2598         it is often used.
2600         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
2601         (__lll_mutex_timedlock_wait): Remove.
2602         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
2603         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2604         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
2605         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2606         (lll_unlock_wake_cb): Don't save and restore %esi.
2607         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
2608         %esi.
2609         (__lll_timedwait_tid): Add alignment.
2610         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
2611         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
2612         %esi.
2613         (__lll_timedwait_tid): Removed.
2614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2615         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
2616         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
2617         (pthread_barrier_wait): Don't save, load, and restore %esi for
2618         last thread.
2619         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2620         (__pthread_cond_signal): Don't save, load, and restore %esi.
2621         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
2622         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
2623         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
2624         Don't save, load, and restore %esi.
2626 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
2628         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
2629         Release lock before waking up the waiters.
2631         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
2633         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
2634         (reader_thread): Likewise.
2636         * sysdeps/pthread/pthread_rwlock_unlock.c
2637         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
2638         to wake up readers if there are none.
2640         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
2641         Release internal lock before wake threads.
2643 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
2645         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
2646         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
2647         predefined.
2648         * tst-rwlock9.c: Likewise.
2649         * tst-rwlock10.c: New file.
2650         * tst-rwlock11.c: New file.
2652         * Makefile (tests): Add tst-dlsym1.
2653         * tst-dlsym1.c: New file.
2655         * init.c (__pthread_initialize_minimal_internal): Set
2656         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
2657         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
2659 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
2661         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
2663         * tst-cond2.c: Fix sychronization with child.
2665         * tst-rwlock8.c (reader_thread): Remove unused variable.
2667         * Makefile: Add rules to build and run tst-tls3.
2668         * tst-tls3.c: New file.
2669         * tst-tls3mod.c: New file.
2671         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
2672         * tst-rwlock8.c: New file.
2673         * tst-rwlock9.c: New file.
2674         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
2675         complete broken rwlock implementation.
2676         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2677         Likewise.
2678         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2679         Likewise.
2680         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2681         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2682         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2683         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2684         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
2685         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
2686         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2688 2003-02-23  Roland McGrath  <roland@redhat.com>
2690         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
2692 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
2694         * Makefile (tests): Add tst-context1.
2695         * tst-context1.c: New file.
2697         * Makefile (tests): Add tst-tls1 and tst-tls2.
2698         * tst-tls1.c: New file.
2699         * tst-tls2.c: New file.
2701         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
2702         for failed cmpxchg.
2704         * pthread_create.c (start_thread): Set EXITING_BIT early.
2706         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
2707         (THREAD_GETMEM_NC): Likewise.
2709 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
2711         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
2712         off 3 more bytes by using offset-less instructions when possible.
2714         * Makefile: Add dependency for $(objpfx)version.d.
2716         * eintr.c (eintr_source): Add unnecessary return but the compiler
2717         insists.
2719         * tst-kill3.c: Include <unistd.h>.
2721 2003-02-21  Roland McGrath  <roland@redhat.com>
2723         * pthread_create.c (start_thread): Call __libc_thread_freeres.
2725 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
2727         * Makefile (tests): Add tst-eintr1.
2728         (distribute): Add eintr.c.
2729         * tst-eintr1.c: New file.
2730         * eintr.c: New file.
2732         * pthread_cancel.c (pthread_cancel): Use tkill directly.
2734         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
2735         Disallow sending SIGCANCEL.
2737         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
2738         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
2739         * tst-kill1.c: New file.
2740         * tst-kill2.c: New file.
2741         * tst-kill3.c: New file.
2742         * tst-kill5.c: New file.
2743         * tst-kill6.c: New file.
2744         * tst-basic7.c: Renamed to...
2745         * tst-kill4.c: ...this.
2747 2003-02-21  Roland McGrath  <roland@redhat.com>
2749         * Makefile (install-lib-ldscripts): New variable.
2751 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
2753         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
2754         * pthread_cancel.c: Use INVALID_TD_P.
2755         * pthread_detach.c: Likewise.
2756         * pthread_getschedparam.c: Likewise.
2757         * pthread_setschedparam.c: Likewise.
2758         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2759         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2760         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
2761         * pthread_timedjoin.c: Likewise.
2763         * tst-basic7.c: Include <signal.h>.
2765         * pthread_join.c (pthread_join): Limited checking for invalid
2766         descriptors.
2767         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
2769 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
2771         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
2772         beginning of the loop.  Clear the entire first block of TSD.
2773         * Makefile (tests): Add tst-key4.
2774         * tst-key4.c: New file.
2776 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
2778         * Makefile (tests): Add tst-basic7.
2779         * tst-basic7.c: New file.
2781         * pthread_create.c (deallocate_tsd): Mark as internal_function.
2782         Add some more __builtin_expect.
2784         * pthreadP.h: Define dummy version of DEBUGGING_P.
2786 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
2788         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
2789         _POSIX_THREAD_PRIORITY_SCHEDULING.
2790         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
2791         _XOPEN_REALTIME_THREADS.
2792         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
2794         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
2795         kernel returns EINVAL for PID <= 0, work around it.
2797         * Makefile (tests): Add tst-signal5.
2798         * tst-signal5.c: New file.
2800         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
2801         and LOGIN_NAME_MAX.
2803         * tst-cancel1.c (tf): Block all signals.
2805         * Makefile (tests): Add tst-basic6.
2806         * tst-basic6.c: New file.
2808         * tst-basic1.c: Add test for process ID.
2810         * Makefile (tests): Add tst-cancel10.
2811         * tst-cancel10.c: New file.
2813         * Makefile (tests): Add tst-signal4.
2814         * tst-signal4.c: New file.
2816         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
2817         __sigismember instead of sigismember.  Add __builtin_expect.
2819 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
2821         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
2822         pthread_setcancelstate, and pthread_rwlock_setpshared.
2824         * tst-cancel7.c (do_test): Make sure the pid file exists before
2825         canceling the thread.
2827         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
2828         pthread_rwlock_timedrdlock tests.
2829         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
2830         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2831         Check for invalid tv_nsec field.
2832         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2833         Likewise.
2835         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
2836         recursive mutex of overflow.
2838         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
2840         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
2841         going into an endless loop.
2842         * Makefile (tests): Add tst-cancel9.
2843         * tst-cancel9.c: New file.
2845         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
2847 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
2849         * tst-mutex5.c (do_test): Add more timedlock tests.
2851         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
2852         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
2854         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
2855         use INLINE_SYSCALL.  Error number is returned, not -1.
2857         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
2858         and __deallocate_stack with internal_function.
2859         * pthread_create.c: Adjust definitions appropriately.
2860         * allocatestack.c: Likewise.
2862         * pthread_join.c: Add one more __builtin_expect.
2863         * pthread_timedjoin.c: Likewise.
2865         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
2866         not data of sequence number does not match.
2867         Add one __builtin_expect.
2869         * Makefile (tests): Add tst-clock1.
2870         * tst-clock1.c: New file.
2872         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
2873         negative arguments.
2874         * Makefile (tests): Add tst-basic5.
2875         * tst-basic5.c: New file.
2877 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
2879         * Makefile (tests): Add tst-basic4.
2880         * tst-basic4.c: New file.
2882         * pthreadP.h: Add declaraction for __nptl_nthreads.
2883         * pthread_create.c: Define __nptl_nthreads
2884         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
2885         after thread is done.  If then zero, call exit(0).
2886         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2887         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
2888         * init.c (pthread_functions): Initialize ptr_nthreads.
2889         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
2890         (__reclaim_stacks): Decrement __nptl_nthreads.
2891         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
2892         Define.
2893         * Makefile (tests): Add tst-basic3.
2894         * tst-basic3.c: New file.
2896         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
2897         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
2898         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
2899         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
2900         if asynchronous canceling is enabled.
2901         * pthread_join.c (pthread_join): When recognizing circular joins,
2902         take into account the other thread might be already canceled.
2903         * Makefile (tests): Add tst-join5.
2904         * tst-join5.c: New file.
2906         * Makefile (tests): Add tst-join4.
2907         * tst-join4.c: New file.
2909 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
2911         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
2913 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2915         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
2916         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
2917         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
2918         warning.
2919         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
2920         to avoid warning.
2921         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
2922         error if lll_futex_wake failed.
2924 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
2926         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
2927         handling of cancellation and failung pthread_mutex_unlock call.
2928         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2929         * Makefile (tests): Add tst-cond8 and tst-cond9.
2930         * tst-cond8.c: New file.
2931         * tst-cond9.c: New file.
2933         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
2935         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
2936         non-standard initializers with __USE_GNU.
2938         * Makefile (tests): Add tst-cleanup3.
2939         * tst-cleanup3.c: New file.
2941 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
2943         * Makefile (tests): Add tst-attr1 and tst-attr2.
2944         * tst-attr1.c: New file.
2945         * tst-attr2.c: New file.
2947         * Makefile: Add rules to build and run tst-atfork2 test.
2948         * tst-atfork2.c: New file.
2949         * tst-atfork2mod.c: New file.
2951         * sysdeps/unix/sysv/linux/unregister-atfork.c
2952         (__unregister_atfork): Free the memory allocated for the handlers
2953         after removing them from the lists.
2955         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
2956         cleanup function.
2958         * tst-atfork1.c (do_test): Wait for the child we forked.
2959         Report error in child.
2961         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
2963         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
2965 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
2967         * Makefile (tests): Add tst-cancel8.
2968         * tst-cancel8.c: New file.
2970         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
2971         clearing of control variable.
2972         * Makefile (tests): Add tst-once3 and tst-once4.
2973         * tst-once3.c: New file.
2974         * tst-once4.c: New file.
2976 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
2978         * sysdeps/sh/Makefile: New file.
2979         * sysdeps/sh/bits/atomic.h: New file.
2980         * sysdeps/sh/pthread_spin_init.c: New file.
2981         * sysdeps/sh/pthread_spin_lock.c: New file.
2982         * sysdeps/sh/pthread_spin_trylock.S: New file.
2983         * sysdeps/sh/pthread_spin_unlock.S: New file.
2984         * sysdeps/sh/pthreaddef.h: New file.
2985         * sysdeps/sh/tcb-offsets.sym: New file.
2986         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
2987         * sysdeps/sh/tls.h: New file.
2988         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
2989         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
2990         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
2991         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
2992         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
2993         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
2994         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
2995         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
2996         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
2997         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
2998         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
2999         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
3000         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
3001         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
3002         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
3003         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
3004         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
3005         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
3006         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
3007         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
3008         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
3009         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
3010         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
3011         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
3012         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
3013         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
3014         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
3015         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
3016         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
3017         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
3019 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
3021         * tst-cond2.c: Rearrange code to not rely on behavior undefined
3022         according to POSIX.
3024         * tst-basic2.c (do_test): Lock mutex before creating the thread.
3026 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
3028         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
3029         (TLS_GET_FS): New #define.
3030         (TLS_SET_FS): New #define.
3031         Correct value of __NR_set_thread_area.
3033         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
3035 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
3037         * Makefile (tests): Add tst-popen1.
3038         * tst-popen1.c: New file.
3040         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
3041         but inactive generalization.
3042         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3043         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3044         Minor optimization, remove one instruction.
3045         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3047 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3049         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
3051 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3053         * init.c (__NR_set_tid_address): Add #ifdef for s390.
3054         * sysdeps/pthread/pthread_barrier_wait.c: New file.
3055         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
3056         * sysdeps/pthread/pthread_cond_signal.c: New file.
3057         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
3058         * sysdeps/pthread/pthread_cond_wait.c: New file.
3059         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
3060         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
3061         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
3062         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
3063         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
3064         * sysdeps/s390/Makefile: New file.
3065         * sysdeps/s390/bits/atomic.h: New file.
3066         * sysdeps/s390/pthread_spin_init.c: New file.
3067         * sysdeps/s390/pthread_spin_lock.c: New file.
3068         * sysdeps/s390/pthread_spin_trylock.c: New file.
3069         * sysdeps/s390/pthread_spin_unlock.c: New file.
3070         * sysdeps/s390/pthreaddef.h: New file.
3071         * sysdeps/s390/tcb-offsets.sym: New file.
3072         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
3073         * sysdeps/s390/tls.h: New file.
3074         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
3075         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
3076         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
3077         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
3078         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
3079         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
3080         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
3081         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
3082         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
3083         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
3084         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
3085         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
3086         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
3087         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
3088         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
3089         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
3090         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
3091         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
3092         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
3093         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
3094         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
3095         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
3096         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
3098 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
3100         * atomic.h: Add a couple more default implementations.
3101         (atomic_compare_and_exchange_acq): Use
3102         __arch_compare_and_exchange_32_acq in return value definition.  It
3103         always exists.
3104         (atomic_bit_set): Renamed from atomic_set_bit.
3105         Add missing atomic_ prefixes.
3107         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
3108         thread library is available, use correct value to mark initialized
3109         once variable.
3111 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
3113         * allocatestack.c (allocate_stack): Use __getpagesize instead of
3114         __sysconf to determine pagesize.
3116         * pthread_create.c: Include <atomic.h>.
3117         * allocatestack.c (allocate_stack): Implement coloring of the
3118         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
3119         size minus one.  Adjust users.
3120         * sysdeps/i386/i686/Makefile: New file.
3122 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
3124         * allocatestack.c: Improve comment throughout the file.
3126         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3127         (__lll_lock_wait): Add branch prediction.
3128         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
3129         (__lll_lock_wait): Likewise.
3130         (lll_unlock_wake_cb): Removed.
3132 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
3134         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
3135         _POSIX_THREAD_PRIORITY_SCHEDULING.
3137 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
3139         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3140         Fix return type of ptr___pthread_getspecific.
3142 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
3144         * Makefile (tests): Add tst-umask1.
3145         (tst-umask1-ARGS): Define.
3146         * tst-umask1.c: New file.
3148 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
3150         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
3151         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
3152         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
3153         pthread_rwlock_unlock.
3154         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
3155         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
3156         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
3157         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
3158         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3159         New file.
3160         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
3161         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3162         New file.
3163         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
3164         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
3165         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
3166         New file.
3167         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
3168         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
3169         New file.
3170         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
3171         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
3172         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
3173         New file.
3174         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
3175         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
3176         New file.
3177         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
3179         * Makefile (libpthread-routines): Remove lowlevelcond and
3180         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
3181         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
3182         and pthread_cond_broadcast.
3183         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
3184         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
3185         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
3186         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
3187         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
3188         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
3189         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
3190         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
3191         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
3192         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
3193         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
3194         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
3195         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
3196         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
3197         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
3198         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
3199         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
3200         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
3201         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
3202         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
3203         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
3204         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
3205         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
3206         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
3207         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
3208         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
3209         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
3210         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
3211         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
3212         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
3213         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
3215         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
3216         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
3217         of the code is moved to ...
3218         * sysdeps/pthread/createthread.c: ...here.  New file.
3220 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
3222         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
3223         (__new_sem_post): Clear %eax before returning.
3224         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
3226         * Makefile (tests): Add tst-cleanup2.
3227         * tst-cleanup2.c: New file.
3229         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
3230         Interpret first parameter correctly.
3232 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
3234         * Makefile (headers): Add bits/semaphore.h.
3236 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
3238         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
3239         if not SHARED.
3241 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
3243         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
3244         must be used and mapping failed.
3245         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
3247         * Makefile (CFLAGS-pthread_self.os): Define this, not
3248         CFLAGS-pthread_self.c.
3250 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
3252         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
3253         lll_unlock_wake_cb.
3255         * Makefile (libpthread-routines): Add version.  Add rules to build
3256         version.os and banner.h.
3257         * version.c: New file.
3259 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
3261         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
3262         the alias unconditional.
3263         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
3265 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
3267         * Makefile (CFLAGS-pthread_self.c): New definition.
3269 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
3271         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
3272         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
3273         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
3274         * init.c (__pthread_initialize_minimal_internal): Likewise.
3276 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
3278         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
3280         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3281         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
3282         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
3283         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
3284         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
3285         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
3287 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
3289         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
3290         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
3291         * tst-cancel-wrappers.sh: Remove all exceptions.
3293 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
3295         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
3296         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
3298         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
3299         Use __libc_pthread_functions array if SHARED.
3301         * pthreadP.h: Move pthread_cond_2_0_t definition to...
3302         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
3304         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
3305         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
3306         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
3307         __libc_ptf_call instead of __libc_maybe_call.
3308         (PTF): New #define.
3309         (__libc_cleanup_region_start): Wrap function name with PTF call.
3310         (__libc_cleanup_region_end): Likewise.
3311         (__libc_cleanup_end): Likewise.
3313         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
3314         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
3315         * pthread_key_create.c: Add __pthread_key_create_internal alias.
3316         * pthreadP.h: Add prototypes.
3318         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
3319         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
3320         __pthread_rwlock_unlock aliases.
3321         * pthreadP.h: Add prototypes for new aliases.
3323         * pthreadP.h (struct pthead_functions): Moved to...
3324         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
3325         * init.c (pthread_functions): Add initializers for new elements.
3327         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
3328         __pthread_cleanup_pop_restore aliases.
3329         * pthreadP.h: Add prototypes.
3331         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
3332         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
3333         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
3334         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
3335         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3336         * pthreadP.h: Adjust prototypes and callers.
3338 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
3340         * Makefile (tests): Add tst-cancel7.
3341         (tst-cancel7-ARGS): New variable.
3342         * tst-cancel7.c: New file.
3344         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
3345         around gcc defficiencies.
3346         * old_pthread_cond_signal.c: Likewise.
3347         * old_pthread_cond_timedwait.c: Likewise.
3348         * old_pthread_cond_wait.c: Likewise.
3350         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
3352 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
3354         * Makefile (tests): Add tst-cond7.
3355         * tst-cond7.c: New file.
3357         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
3358         (condvar_cleanup): Get condvar address from the right place.
3360         * atomic.h: Correct definitions of atomic_full_barrier,
3361         atomic_read_barrier, atomic_write_barrier.
3363         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
3364         race-free.
3365         * old_pthread_cond_signal.c: Likewise.
3366         * old_pthread_cond_timedwait.c: Likewise.
3367         * old_pthread_cond_wait.c: Likewise.
3369 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
3371         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
3373 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
3375         * pthreadP.h (pthread_cond_2_0_t): New type.
3376         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
3377         Use new type for the 2.0 condvar function prototypes.
3378         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
3379         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
3380         parameter.
3381         * old_pthread_cond_destroy.c: Likewise.
3382         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
3383         * old_pthread_cond_signal.c: Likewise.
3384         * old_pthread_cond_timedwait.c: Likewise.
3385         * old_pthread_cond_wait.c: Likewise.
3387         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
3388         (__pthread_cond_wait): Don't save cancellation mode and seq value
3389         in same location.
3391         * herrno.c (__h_errno_location): Don't define as weak.
3393 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
3395         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
3396         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
3397         and pthread_cond_wait.
3398         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
3399         Renamed to...
3400         (__pthread_cond_broadcast_2_0): ... this.
3401         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
3402         Renamed to...
3403         (__pthread_cond_destroy_2_0): ... this.
3404         * old_pthread_cond_init.c (__old_pthread_cond_init):
3405         Renamed to...
3406         (__pthread_cond_init_2_0): ... this.
3407         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
3408         Renamed to...
3409         (__pthread_cond_signal_2_0): ... this.
3410         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
3411         Renamed to...
3412         (__pthread_cond_wait_2_0): ... this.
3413         * pthread_cond_destroy.c: Include shlib-compat.h.
3414         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
3415         * pthread_cond_init.c: Include shlib-compat.h.
3416         (pthread_cond_init): Change strong_alias into versioned_symbol.
3417         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
3418         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
3419         fields.
3420         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
3421         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
3422         __pthread_cond_wait_2_0): New prototypes.
3423         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
3424         __old_pthread_cond_init, __old_pthread_cond_signal,
3425         __old_pthread_cond_wait): Removed.
3426         * init.c: Include shlib-compat.h.
3427         (pthread_functions): Guard ptr___pthread_attr_init_2_0
3428         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
3429         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
3430         ptr___pthread_cond_*_2_0 fields.
3431         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
3432         pthread_cond_*@GLIBC_2.0 compatibility symbols.
3434         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
3435         LIBC_SIGACTION was not yet defined.
3436         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
3437         [!defined LIBC_SIGACTION] (__sigaction): New function and
3438         libc_hidden_weak.
3439         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
3440         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
3442 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
3444         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
3446 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
3448         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3449         New, larger type definition.
3450         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
3451         implementation.
3452         * Versions [libpthread]: Add definitions for new pthread_cond_*
3453         interfaces for version GLIBC_2.3.2.
3454         * pthread_cond_init.c: Update initialization for new type definition.
3455         * Makefile (libpthread-routines): Remove pthread_cond_wait,
3456         pthread_cond_timedwait, pthread_cond_signal, and
3457         pthread_cond_broadcast.  Add old_pthread_cond_init,
3458         old_pthread_cond_destroy, old_pthread_cond_wait,
3459         old_pthread_cond_timedwait, old_pthread_cond_signal, and
3460         old_pthread_cond_broadcast.
3461         * old_pthread_cond_broadcast.c: New file.
3462         * old_pthread_cond_destroy.c: New file.
3463         * old_pthread_cond_init.c: New file.
3464         * old_pthread_cond_signal.c: New file.
3465         * old_pthread_cond_timedwait.c: New file.
3466         * old_pthread_cond_wait.c: New file.
3467         * pthreadP.h: Add prototypes for the compatibility interfaces.
3469         * pthread_cond_destroy.c: Don't include <errno.h>.
3471 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
3473         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
3474         unnecessary zero offset when addressing MUTEX.
3476 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
3478         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
3479         __register_atfork.
3480         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
3481         for __register_atfork.
3483 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
3485         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
3486         instead of ASSEMBLER test macro.
3488         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
3489         __libc_current_sigrtmax): Add libc_hidden_def.
3491         * sysdeps/pthread/list.h: Remove assert.h include.
3493 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
3495         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
3496         __pthread_initialize_minimal_internal not
3497         __pthread_initialize_minimal.
3499 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
3501         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
3502         __pthread_initialize_minimal as hidden.
3504         * init.c (__pthread_initialize_minimal_internal): Don't mark as
3505         constructor.
3507 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
3509         * Makefile ($(inst_libdir)/libpthread.so): Depend on
3510         $(common-objpfx)format.lds, include that into the output script.
3511         Fix comment.
3512         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
3514 2002-12-28  Andreas Jaeger  <aj@suse.de>
3516         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
3517         nsec resolution changes.
3518         (xstat64_conv): Likewise.
3519         (xstat32_conv): Likewise.
3520         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
3521         struct kernel_stat.
3522         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
3523         structs stat and stat64.
3524         * time/time.h (__timespec_defined): Define for __USE_MISC.
3525         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
3527 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
3529         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
3530         argument.
3531         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
3532         (pthread_exit): Use strong_alias to avoid warnings.
3533         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
3534         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
3535         ptr___pthread_attr_init_2_*.
3536         * init.c (pthread_functions): Adjust.
3538 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
3540         * forward.c: Make all functions available by default again.  It
3541         caused too much trouble.
3543         * pt-siglongjmp.c: Removed.
3545 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
3547         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
3548         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
3549         * sysdeps/i386/Makefile: New file.
3550         * sysdeps/i386/tcb-offsets.sym: New file.
3551         * sysdeps/pthread/tcb-offsets.h: New file.
3552         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3553         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
3555         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
3556         __register_atfork...
3557         (GLIBC_2.3.2): ...here.
3559 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
3561         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
3562         pthread_attr_setstackaddr with __attribute_deprecated__.
3564 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
3566         * pt-system.c (system): Remove cancellation handling.
3567         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
3568         cancellation routines.
3570 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
3572         * descr.h: Include <dl-sysdep.h>.
3573         (struct pthread): Move header.data.list to the back of the struct.
3574         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
3575         (MULTIPLE_THREADS_OFFSET): Adjust offset.
3576         (SYSINFO_OFFSEET): Likewise.
3578 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
3580         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
3581         Define.
3582         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
3583         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
3584         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
3585         (USE_DL_SYSINFO): Undef.
3587 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
3589         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
3590         $(common-objpfx)libc.so.
3591         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
3592         it is bigger than pipe buffer size even on arches with bigger
3593         page size.
3594         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
3596 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
3598         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
3599         correct errno access for case that USE___THREAD is not defined.
3601 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
3603         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
3604         Patch by Marijn Ros <marijn@mad.scientist.com>.
3606 2002-12-22  Roland McGrath  <roland@redhat.com>
3608         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
3610 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
3612         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
3614 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
3616         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
3617         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
3618         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
3620         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
3621         of int $0x80.
3622         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3623         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
3624         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
3625         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3626         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
3627         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
3628         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
3629         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3631         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
3632         sysenter.
3633         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
3635         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
3637         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
3638         in new TCB.
3639         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
3640         that sysinfo is properly initialized.
3641         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
3642         to 1 only for ld.so.
3644         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
3645         RTLD_CORRECT_DYNAMIC_WEAK.
3647 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
3649         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
3650         Use return 0 as 6th argument to FORWARD4.
3651         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
3653 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
3655         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
3656         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
3657         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
3658         (INIT_SYSINFO): New #define.
3659         (TLS_TP_INIT): Use INIT_SYSINFO.
3660         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3661         At test to make sure SYSINFO_OFFSET value is correct.
3662         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
3664 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
3666         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
3667         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
3668         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
3669         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
3670         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
3671         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
3672         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
3674 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
3676         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
3677         macro instead of using int $0x80 directly.
3679         * sysdeps/pthread/bits/stdio-lock.h: New file.
3680         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
3681         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
3682         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
3683         * Makefile (routines): Add libc-lowlevelmutex.
3685         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
3686         __i686.get_pc_thunk.dx.
3688 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
3690         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
3691         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
3692         ($(objpfx)tst-cancel-wrappers.out): New rule.
3693         * tst-cancel-wrappers.sh: New test.
3694         * tst-locale1.c: Include signal.h.
3695         (uselocale): Test static linking of __libc_current_sigrt*.
3697 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
3699         * Makefile (tests): Add tst-cancel6.
3700         * tst-cancel6.c: New file
3702 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
3704         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
3705         Define meaningfully for assembler as well.
3706         * pthreadP.h (struct pthread_functions): Remove
3707         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
3708         and ptr_pthread_attr_init_2_1 fields.
3709         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
3710         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
3711         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
3712         (FORWARD3): Define using FORWARD4.
3713         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
3714         versions.
3715         * pt-system.c: Remove duplicate stdlib.h include.
3717 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
3719         * sem_init.c: Define sem_init@GLIBC_2.0.
3720         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
3721         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
3723         * flockfile.c: Moved to...
3724         * sysdeps/pthread/flockfile.c: ...here.  New file.
3725         * funlockfile.c: Moved to...
3726         * sysdeps/pthread/funlockfile.c: ...here.  New file.
3727         * ftrylockfile.c: Moved to...
3728         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
3730 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
3732         * libc-cancellation.c: Guard both function with
3733         #if !defined NOT_IN_libc.
3734         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
3735         automatically provided pthread wrappers.
3736         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
3737         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
3738         nor in libpthread.
3739         * pt-open.c: Removed.
3740         * pt-fcntl.c: Removed.
3741         * pt-fsync.c: Removed.
3742         * pt-lseek.c: Removed.
3743         * pt-msgrcv.c: Removed.
3744         * pt-msgsnd.c: Removed.
3745         * pt-msync.c: Removed.
3746         * pt-nanosleep.c: Removed.
3747         * pt-open64.c: Removed.
3748         * pt-pause.c: Removed.
3749         * pt-pread.c: Removed.
3750         * pt-pread64.c: Removed.
3751         * pt-pwrite.c: Removed.
3752         * pt-pwrite64.c: Removed.
3753         * pt-read.c: Removed.
3754         * pt-recv.c: Removed.
3755         * pt-recvfrom.c: Removed.
3756         * pt-recvmsg.c: Removed.
3757         * pt-send.c: Removed.
3758         * pt-sendto.c: Removed.
3759         * pt-sigtimedwait.c: Removed.
3760         * pt-sigwait.c: Removed.
3761         * pt-wait.c: Removed.
3762         * pt-waitpid.c: Removed.
3763         * pt-write.c: Removed.
3764         * pt-accept.c: Removed.
3765         * pt-close.c: Removed.
3766         * pt-connect.c: Removed.
3767         * pt-lseek64.c: Removed.
3768         * pt-sendmsg.c: Removed.
3769         * pt-tcdrain.c: Removed.
3771 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
3773         * init.c (__pthread_initialize_minimal_internal): Renamed from
3774         __pthread_initialize_minimal.  Make old name an alias.  This
3775         converts a normal relocation into a relative relocation.
3777         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
3779         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
3780         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
3781         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
3782         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
3783         pt-sigwaitinfo, pt-waitid, and pt-writev.
3784         * pt-creat.c: Removed.
3785         * pt-poll.c: Removed.
3786         * pt-pselect.c: Removed.
3787         * pt-readv.c: Removed.
3788         * pt-select.c: Removed.
3789         * pt-sigpause.c: Removed.
3790         * pt-sigsuspend.c: Removed.
3791         * pt-sigwaitinfo.c: Removed.
3792         * pt-waitid.c: Removed.
3793         * pt-writev.c: Removed.
3795         * init.c (pthread_functions): New variable.
3796         (__pthread_initialize_minimal): Pass pointer to pthread_functions
3797         (or NULL) to __libc_pthread_init.
3798         * forward.c: Rewrite to use __libc:pthread_functions array to get
3799         function addresses.
3800         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
3801         prototype.
3802         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3803         Take new parameter.  Copy content of variable pointed to by it
3804         to __libc_pthread_init.
3806         * pthreadP.h (struct pthread_functions): New type.
3807         (__libc_pthread_init): Declare.
3809         * pthread_attr_destroy.c: Add namespace protected alias.
3810         * pthread_attr_getdetachstate.c: Likewise.
3811         * pthread_attr_getinheritsched.c: Likewise.
3812         * pthread_attr_getschedparam.c: Likewise.
3813         * pthread_attr_getschedpolicy.c: Likewise.
3814         * pthread_attr_getscope.c: Likewise.
3815         * pthread_attr_setdetachstate.c: Likewise.
3816         * pthread_attr_setinheritsched.c: Likewise.
3817         * pthread_attr_setschedparam.c: Likewise.
3818         * pthread_attr_setschedpolicy.c: Likewise.
3819         * pthread_attr_setscope.c: Likewise.
3820         * pthread_cond_broadcast.c: Likewise.
3821         * pthread_cond_destroy.c: Likewise.
3822         * pthread_cond_init.c: Likewise.
3823         * pthread_cond_signal.c: Likewise.
3824         * pthread_cond_wait.c: Likewise.
3825         * pthread_condattr_destroy.c: Likewise.
3826         * pthread_condattr_init.c: Likewise.
3827         * pthread_equal.c: Likewise.
3828         * pthread_exit.c: Likewise.
3829         * pthread_getschedparam.c: Likewise.
3830         * pthread_self.c: Likewise.
3831         * pthread_setcancelstate.c: Likewise.
3832         * pthread_setschedparam.c: Likewise.
3833         * pthread_mutex_destroy.c: Likewise.
3834         * pthread_mutex_init.c: Likewise.
3835         * pthreadP.h: Add prototypes for the aliases.
3837         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
3838         multiple_threads member in correct TCB to 1.
3840         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
3841         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
3842         member of thread decriptor, otherwise return unconditionally 1.
3844 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
3846         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
3847         regular Linux version.  Remove file.
3848         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
3849         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
3850         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
3851         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
3852         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
3853         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
3854         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
3855         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
3856         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
3857         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
3858         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
3859         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
3860         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
3861         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
3862         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
3863         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
3864         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
3865         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
3866         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
3867         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
3868         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
3869         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
3870         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
3871         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
3872         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
3873         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
3874         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
3875         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
3876         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
3877         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
3879 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
3881         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
3882         * sysdeps/unix/sysv/linux/open.c: Removed.
3883         * sysdeps/unix/sysv/linux/fsync.c: Removed.
3884         * sysdeps/unix/sysv/linux/lseek.c: Removed.
3885         * sysdeps/unix/sysv/linux/msync.c: Removed.
3886         * sysdeps/unix/sysv/linux/read.c: Removed.
3887         * sysdeps/unix/sysv/linux/close.c: Removed.
3888         * sysdeps/unix/sysv/linux/creat.c: Removed.
3889         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
3890         * sysdeps/unix/sysv/linux/pause.c: Removed.
3891         * sysdeps/unix/sysv/linux/select.c: Removed.
3892         * sysdeps/unix/sysv/linux/write.c: Removed.
3894 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
3896         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
3897         element in TCB to see whether locking is needed.
3899         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
3900         MULTIPLE_THREADS_OFFSET value is correct.
3902         * sysdeps/unix/sysv/linux/close.c: New file.
3903         * sysdeps/unix/sysv/linux/connect.S: New file.
3904         * sysdeps/unix/sysv/linux/creat.c: New file.
3905         * sysdeps/unix/sysv/linux/fsync.c: New file.
3906         * sysdeps/unix/sysv/linux/llseek.c: New file.
3907         * sysdeps/unix/sysv/linux/lseek.c: New file.
3908         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
3909         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
3910         * sysdeps/unix/sysv/linux/msync.c: New file.
3911         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
3912         * sysdeps/unix/sysv/linux/open.c: New file.
3913         * sysdeps/unix/sysv/linux/open64.c: New file.
3914         * sysdeps/unix/sysv/linux/pause.c: New file.
3915         * sysdeps/unix/sysv/linux/poll.c: New file.
3916         * sysdeps/unix/sysv/linux/pread.c: New file.
3917         * sysdeps/unix/sysv/linux/pread64.c: New file.
3918         * sysdeps/unix/sysv/linux/pselect.c: New file.
3919         * sysdeps/unix/sysv/linux/pwrite.c: New file.
3920         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
3921         * sysdeps/unix/sysv/linux/readv.c: New file.
3922         * sysdeps/unix/sysv/linux/recv.S: New file.
3923         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
3924         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
3925         * sysdeps/unix/sysv/linux/select.c: New file.
3926         * sysdeps/unix/sysv/linux/send.S: New file.
3927         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
3928         * sysdeps/unix/sysv/linux/sendto.S: New file.
3929         * sysdeps/unix/sysv/linux/sigpause.c: New file.
3930         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
3931         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
3932         * sysdeps/unix/sysv/linux/sigwait.c: New file.
3933         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
3934         * sysdeps/unix/sysv/linux/system.c: New file.
3935         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
3936         * sysdeps/unix/sysv/linux/wait.c: New file.
3937         * sysdeps/unix/sysv/linux/waitid.c: New file.
3938         * sysdeps/unix/sysv/linux/waitpid.c: New file.
3939         * sysdeps/unix/sysv/linux/writev.c: New file.
3940         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
3942         * pt-readv.c: Fix comment.
3944 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
3946         * tst-cleanup1.c: Include stdlib.h.
3948         * tst-cancel5.c: New test.
3949         * Makefile (tests): Add tst-cancel5.
3950         (tst-cancel5): Link against libc.so libpthread.so in that order.
3952 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
3954         * forward.c (test_loaded): Prevent recursive calls.
3956         * Makefile (routines): Add libc-cancellation.
3957         * libc-cancellation.c: New file.
3958         * descr.h (struct pthread): Add multiple_threads field.
3959         * allocatestack.c (allocate_stack): Initialize multiple_header field of
3960         new thread descriptor to 1.
3961         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
3962         Initialize multiple_thread field after successful thread creation.
3963         * cancellation.c (__do_cancel): Move to pthreadP.h.
3964         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
3965         (__pthread_disable_asynccancel): Add internal_function attribute.
3966         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
3967         * pthread_setcancelstate.c: Likewise.
3968         * pthread_setcanceltype.c: Likewise.
3969         * pthread_exit.c: Likewise.
3970         * pthreadP.h (CANCELLATION_P): Likewise.
3971         (__do_cancel): Define as static inline.
3972         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
3973         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
3974         declarations.
3975         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
3976         fields.  Define MULTIPLE_THREADS_OFFSET.
3977         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
3978         declaration.
3979         * sysdeps/unix/sysv/linux/accept.S: New file.
3980         * sysdeps/unix/sysv/linux/read.c: New file.
3981         * sysdeps/unix/sysv/linux/write.c: New file.
3982         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
3983         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
3984         initialization of __libc_locking_needed.
3985         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
3986         __libc_locking_needed, use multiple_threads field in TCB.
3987         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3989 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
3991         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
3992         version.
3993         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
3995         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
3996         access to __libc_locking_needed for PIC.
3998 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
4000         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
4001         declare for libc.so.
4002         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
4003         expression.
4004         (__libc_lock_lock): Put into statement expression.
4005         (__libc_lock_unlock): Remove trailing semicolon.
4006         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
4008 2002-12-12  Roland McGrath  <roland@redhat.com>
4010         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
4011         "m" constraint to refer to __libc_locking_needed.  Declare it here.
4013 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
4015         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
4016         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
4017         Initialize __libc_locking_needed.
4018         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
4019         instead of __register_pthread_fork_handler.
4020         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
4021         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
4022         fork-gen with libc_pthread_init.
4023         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
4024         of __register_pthread_fork_handler.
4025         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
4026         of __register_pthread_fork_handler.
4027         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
4028         __libc_locking_needed to determine whether lock prefix can be avoided.
4029         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
4031 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
4033         * Makefile (tests): Add tst-cleanup1.
4034         * tst-cleanup1.c: New file.
4035         * cancellation.c (__cleanup_thread): Removed.
4036         (__do_cancel): Remove call to __cleanup_thread.
4037         * pthreadP.h: Remove __cleanup_thread prorotype.
4039         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
4040         Remember function and argument even if cancellation handler
4041         function is not available.
4042         (__libc_cleanup_region_end): Execute registered function directly if
4043         pthread functions are not available.
4044         (__libc_cleanup_end): Likewise.
4046         * init.c (__pthread_initialize_minimal): Fix initialization in
4047         static lib by preventing gcc from being too clever.
4049 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
4051         * init.c (__pthread_initialize_minimal): Remove unneccesary
4052         sigaddset call.
4054         * Makefile (tests): We can run tst-locale2 now.
4056 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
4058         * Versions: Remove duplicated sigwait entry.
4060 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
4062         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
4063         inside libpthread.
4065         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
4067         * pthreadP.h: Declare __pthread_enable_asynccancel and
4068         __pthread_disable_asynccancel.
4069         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
4070         (CANCEL_RESET): Use __pthread_disable_asynccancel.
4071         * cancellation.c (__pthread_enable_asynccancel): New function.
4072         (__pthread_disable_asynccancel): New function.
4073         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
4074         * pt-close.c: Likewise.
4075         * pt-connect.c: Likewise.
4076         * pt-creat.c: Likewise.
4077         * pt-fcntl.c: Likewise.
4078         * pt-fsync.c: Likewise.
4079         * pt-lseek.c: Likewise.
4080         * pt-lseek64.c: Likewise.
4081         * pt-msgrcv.c: Likewise.
4082         * pt-msgsnd.c: Likewise.
4083         * pt-msync.c: Likewise.
4084         * pt-nanosleep.c: Likewise.
4085         * pt-open.c: Likewise.
4086         * pt-open64.c: Likewise.
4087         * pt-pause.c: Likewise.
4088         * pt-poll.c: Likewise.
4089         * pt-pread.c: Likewise.
4090         * pt-pread64.c: Likewise.
4091         * pt-pselect.c: Likewise.
4092         * pt-pwrite.c: Likewise.
4093         * pt-pwrite64.c: Likewise.
4094         * pt-read.c: Likewise.
4095         * pt-readv.c: Likewise.
4096         * pt-recv.c: Likewise.
4097         * pt-recvfrom.c: Likewise.
4098         * pt-recvmsg.c: Likewise.
4099         * pt-select.c: Likewise.
4100         * pt-send.c: Likewise.
4101         * pt-sendmsg.c: Likewise.
4102         * pt-sendto.c: Likewise.
4103         * pt-sigpause.c: Likewise.
4104         * pt-sigsuspend.c: Likewise.
4105         * pt-sigtimedwait.c: Likewise.
4106         * pt-sigwait.c: Likewise.
4107         * pt-sigwaitinfo.c: Likewise.
4108         * pt-system.c: Likewise.
4109         * pt-tcdrain.c: Likewise.
4110         * pt-wait.c: Likewise.
4111         * pt-waitid.c: Likewise.
4112         * pt-waitpid.c: Likewise.
4113         * pt-write.c: Likewise.
4114         * pt-writev.c: Likewise.
4115         * pthread_join.c: Likewise.
4116         * pthread_timedjoin.c: Likewise.
4118         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
4119         (__xpg_sigpause): New function.
4120         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
4122 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
4124         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
4126         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
4127         _GI_pthread_cleanup_pop to pthreadP.h.
4129         * ftrylockfile.c: Use _IO_lock_trylock instead of
4130         pthread_mutex_trylock.
4132         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
4133         (CANCEL_RESET): Likewise.
4134         (__pthread_setcanceltype_): Declare.
4135         (__pthread_mutex_lock_internal): Declare.
4136         (__pthread_mutex_unlock_internal): Declare.
4137         (__pthread_once_internal): Declare.
4138         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
4139         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
4141         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
4142         and pthread_mutex_unlock.
4143         * pthread_cond_wait.c: Likewise.
4144         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
4145         * pthread_mutex_unlock.c: Likewise.
4147         * pthread_setcanceltype.c: Add additional alias
4148         __pthread_setcanceltype.
4150         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
4151         * sem_open.c (sem_open): Likewise.
4152         Use __libc_open, __libc_write, and __libc_close instead of
4153         open, write, and close respectively.
4155         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
4156         Rewrite as statement expression since it must return a value.
4158         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
4159         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
4160         __pthread_kill.
4162         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
4163         alias __pthread_once_internal.
4165         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
4167 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
4169         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
4170         * tst-stdio1.c: New file.
4171         * tst-stdio2.c: New file.
4173         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
4175         * Makefile (tests): Comment out tst-locale2 for now.
4176         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
4178         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
4179         -D_IO_MTSAFE_IO.
4180         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
4181         Use _IO_lock_init instead of explicit assignment.
4183         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
4184         Define __libc_lock_* and __libc_lock_recursive macros with
4185         lowlevellock macros, not pthread mutexes.
4187         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
4188         of pthread_mutex_lock.
4189         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
4190         instead of pthread_mutex_unlock.
4192 2002-12-06  Roland McGrath  <roland@redhat.com>
4194         * allocatestack.c (__stack_user): Use uninitialized defn.
4195         * init.c (__pthread_initialize_minimal): Initialize it here.
4197 2002-12-05  Roland McGrath  <roland@redhat.com>
4199         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
4200         string.
4201         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
4203         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
4204         missing & here too.
4206 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
4208         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
4209         lowlevellock.
4210         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
4211         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
4212         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
4213         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
4214         for __libc_lock_* macros.
4215         * Makefile (routines): Add libc-lowlevellock.
4217 2002-10-09  Roland McGrath  <roland@redhat.com>
4219         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
4220         Under [__PIC__], call the function via the pointer fetched for
4221         comparison rather than a call by name that uses the PLT.
4222         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
4223         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
4224         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
4225         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
4226         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
4228 2002-12-04  Roland McGrath  <roland@redhat.com>
4230         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
4232         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
4233         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
4235         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
4237 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
4239         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
4240         a completely opaque, non-integer type.
4241         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4243 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
4245         * sysdeps/i386/tls.h: Include stdlib.h.
4246         * sysdeps/x86_64/tls.h: Likewise.
4248 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
4250         * Makefile (tests): Add tst-locale2.
4251         (tests-static): Likewise.
4252         * tst-locale2.c: New file.
4254         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
4255         volatile and add memory clobbers to lock operations.
4257 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
4259         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
4260         * sysdeps/i386/i486/bits/atomic.h: New file.
4261         * sysdeps/i386/i586/bits/atomic.h: New file.
4262         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
4263         include i486 version.
4264         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
4265         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
4266         Patch by Marijn Ros <marijn@mad.scientist.com>.
4268         * allocatestack.c (get_cached_stack): Don't crash if we first
4269         found a stack with a larger size then needed.
4270         Reported by Hui Huang <hui.huang@sun.com>.
4272         * Makefile (tests): Add tst-sysconf.
4273         * tst-sysconf.c: New file.
4275         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
4276         PTHREAD_THREADS_MAX.
4278 2002-12-02  Roland McGrath  <roland@redhat.com>
4280         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
4281         Declare using hidden_proto instead of attribute_hidden, so there are
4282         non-.hidden static symbols for gdb to find.
4283         (__pthread_keys): Likewise.
4284         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
4285         * allocatestack.c (__stack_user): Likewise.
4286         * pthread_create.c (__pthread_keys): Likewise.
4287         (__nptl_threads_events, __nptl_last_event): Make these static instead
4288         of hidden.
4289         * pthread_key_create.c (__pthread_pthread_keys_max,
4290         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
4292 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
4294         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
4295         statically.
4296         * tst-locale1.c: New file.
4298         * pthread_cond_timedwait.c: Include <stdlib.h>.
4300         * Makefile (tests): Add tst-fork2 and tst-fork3.
4301         * tst-fork2.c: New file.
4302         * tst-fork3.c: New file.
4304 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
4306         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
4308         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
4309         require it to 200112L.
4311         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
4312         instruction only if HAVE_CMOV is defined.
4313         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
4315         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
4317         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
4319         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
4321         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
4323 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
4325         * sysdeps/x86_64/bits/atomic.h: New file.
4327         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
4328         16-bit operations.
4330         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
4331         possible since gettid cannot fail.
4333         * sysdeps/x86_64/pthreaddef.h: New file.
4335         * sysdeps/i386/pthreaddef.h (gettid): Removed.
4337         * sysdeps/x86_64/pthread_spin_init.c: New file.
4338         * sysdeps/x86_64/pthread_spin_lock.c: New file.
4339         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
4340         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
4342         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
4343         Add missing lock prefix.  Minute optimization.
4345         * tst-spin2.c (main): Also check successful trylock call.
4347         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
4348         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
4350         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
4351         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
4353         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
4354         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
4355         value in case of an error.  Add support for INTERNAL_SYSCALL.
4357         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
4358         value in case of an error.
4360         * sysdeps/x86_64/tls.h: New file.
4362 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
4364         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
4365         takes the array member name and the index as parameters.
4366         (THREAD_SETMEM_NC): Likewise.
4367         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
4368         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
4369         interfaces.
4371         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
4372         to decide which code to use.
4373         (THREAD_SETMEM_NC): Likewise.
4375         * allocatestack.c (queue_stack): Don't remove stack from list here.
4376         Do it in the caller.  Correct condition to prematurely terminate
4377         loop to free stacks.
4378         (__deallocate_stack): Remove stack from list here.
4380 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
4382         * Makefile (tests): Add tst-stack1.
4383         * tst-stack1.c: New file.
4385         * allocatestack.c (allocate_stack): Initialize the TCB on a user
4386         provided stack.
4388         * pthread_attr_getstack.c: Return bottom of the thread area.
4390 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
4392         * Makefile (libpthread-routines): Add pt-allocrtsig and
4393         pthread_kill_other_threads.
4394         * pt-allocrtsig.c: New file.
4395         * pthread_kill_other_threads.c: New file.
4396         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
4397         all three functions.
4398         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
4399         allocrtsig.
4400         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
4401         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
4402         and __libc_allocate_rtsig_private.
4403         * Versions (libpthread): Export pthread_kill_other_threads_np,
4404         __libc_current_sigrtmin, and __libc_current_sigrtmax.
4406 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
4408         * allocatestack.c (allocate_stack): stackaddr in attribute points to
4409         the end of the stack.  Adjust computations.
4410         When mprotect call fails dequeue stack and free it.
4411         * pthread_attr_setstack.c: Store top of the stack in stackaddr
4412         attribute.
4413         * pthread_getattr_np.c: Likewise.
4415         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
4416         surprises.
4418 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
4420         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
4421         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
4423 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
4425         * pthread_getspecific.c: Optimize access to first 2nd-level array.
4426         * pthread_setspecific.c: Likewise.
4428 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
4430         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
4431         definitions.  Get them from the official place.
4432         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
4434         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
4435         Use new CLONE_ flags in clone() calls.
4437         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
4438         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
4440         * Versions: Add pthread_* functions for libc.
4441         * forward.c: New file.
4443         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
4444         errno-loc.
4445         * herrno.c: New file.
4446         * res.c: New file.
4448         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
4449         sem_trywait, and sem_timedwait.  Add herrno and res.
4450         * sem_init.c: Don't initialize lock and waiters members.
4451         * sem_open.c: Likewise.
4452         * sem_post.c: Removed.
4453         * sem_wait.c: Removed.
4454         * sem_trywait.c: Removed.
4455         * sem_timedwait.c: Removed.
4456         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
4457         Includes full implementations of sem_post, sem_wait, sem_trywait,
4458         and sem_timedwait.
4459         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
4460         for new implementation.
4461         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
4462         and waiters fields.
4464         * tst-sem3.c: Improve error message.
4465         * tst-signal3.c: Likewise.
4467         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
4468         to tell the kernel about the termination futex and to initialize tid
4469         member.  Don't initialize main_thread.
4470         * descr.h (struct pthread): Remove main_thread member.
4471         * cancelllation.c (__do_cancel): Remove code handling main thread.
4472         The main thread is not special anymore.
4474         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
4475         size of the stacks to stack_cache_actsize.
4477         * pt-readv.c: Add missing "defined".
4478         * pt-sigwait.c: Likewise.
4479         * pt-writev.c: Likewise.
4481 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
4483         * Versions: Export __connect from libpthread.
4484         Patch by Luca Barbieri <ldb@ldb.ods.org>.
4486         * Makefile (libpthread-routines): Add pt-raise.
4487         * sysdeps/unix/sysv/linux/raise.c: New file.
4488         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
4489         * sysdeps/generic/pt-raise.c: New file.
4491         * pthread_cond_init.c: Initialize all data elements of the condvar
4492         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
4494         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
4495         * pthread_create.c: Likewise.
4497         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
4498         * tst-key1.c: New file.
4499         * tst-key2.c: New file.
4500         * tst-key3.c: New file.
4502         * Versions: Export pthread_detach for version GLIBC_2.0.
4503         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
4505 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
4507         * pthread_key_create.c: Terminate search after an unused key was found.
4508         Patch by Luca Barbieri <ldb@ldb.ods.org>.
4510         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
4511         Patch by Luca Barbieri <ldb@ldb.ods.org>.
4513 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
4515         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
4516         dynamic lookup for errno in PIC.
4518         * allocatestack.c (get_cached_stack): Rearrange code slightly to
4519         release the stack lock as soon as possible.
4520         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
4521         the static TLS block.
4522         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
4524         * cancellation.c: Renamed from cancelation.c.
4525         * Makefile: Adjust accordingly.
4526         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
4527         * cleanup_defer.c: Use CANCELLATION_P.
4528         * pthread_testcancel.c: Likewise.
4529         * descr.h: Fix spelling in comments.
4530         * init.c: Likewise.
4531         * pthread_getattr_np.c: Likewise.
4532         * pthread_getschedparam.c: Likewise.
4533         * pthread_setschedparam.c: Likewise.
4534         * Versions: Likewise.
4536         * pt-pselect.c: New file.
4537         * Makefile (libpthread-routines): Add pt-pselect.
4538         * Versions: Add pselect.
4540         * tst-cancel4.c: New file.
4541         * Makefile (tests): Add tst-cancel4.
4543 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
4545         * pthread_mutex_lock.c: Always record lock ownership.
4546         * pthread_mutex_timedlock.c: Likewise.
4547         * pthread_mutex_trylock.c: Likewise.
4549         * pt-readv.c: New file.
4550         * pt-writev.c: New file.
4551         * pt-creat.c: New file.
4552         * pt-msgrcv.c: New file.
4553         * pt-msgsnd.c: New file.
4554         * pt-poll.c: New file.
4555         * pt-select.c: New file.
4556         * pt-sigpause.c: New file.
4557         * pt-sigsuspend.c: New file.
4558         * pt-sigwait.c: New file.
4559         * pt-sigwaitinfo.c: New file.
4560         * pt-waitid.c: New file.
4561         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
4562         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
4563         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
4564         * Versions: Add all the new functions.
4566         * tst-exit1.c: New file.
4567         * Makefile (tests): Add tst-exit1.
4569         * sem_timedwait.c: Minor optimization for more optimal fastpath.
4571 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
4573         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
4575         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
4576         call.  pthread_join is an official cancellation point.
4577         * pthread_timedjoin.c: Likewise.
4579         * pthread_cond_wait.c: Revert order in which internal lock are dropped
4580         and the condvar's mutex are retrieved.
4581         * pthread_cond_timedwait.c: Likewise.
4582         Reported by dice@saros.East.Sun.COM.
4584 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
4586         * pthreadP.h: Cut out all type definitions and move them...
4587         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
4588         * pthreadP.h: Include <internaltypes.h>.
4590         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
4591         performance tweaks.
4593         * sem_trywait.c: Shuffle #includes around to get right order.
4594         * sem_timedwait.c: Likewise.
4595         * sem_post.c: Likewise.
4596         * sem_wait.c: Likewise.
4598         * nptl 0.3 released.
4600         * Makefile (tests): Add tst-signal3.
4601         * tst-signal3.c: New file.
4603 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
4605         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
4606         the asms modify the sem object.
4607         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
4609         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
4610         the actual members.
4611         * pthreadP.h (struct sem): New type.  Actual semaphore type.
4612         * semaphoreP.h: Include pthreadP.h.
4613         * sem_getvalue.c: Adjust to sem_t change.
4614         * sem_init.c: Likewise.
4615         * sem_open.c: Likewise.
4616         * sem_post.c: Likewise.
4617         * sem_timedwait.c: Likewise.
4618         * sem_trywait.c: Likewise.
4619         * sem_wait.c: Likewise.
4621 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
4623         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
4624         * tst-basic2.c: New file.
4625         * tst-exec1.c: New file.
4626         * tst-exec2.c: New file.
4627         * tst-exec3.c: New file.
4629         * tst-fork1.c: Remove extra */.
4631         * nptl 0.2 released.  The API for IA-32 is complete.