* tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
[glibc.git] / nptl / ChangeLog
blobd38913303a22e87485e9cf3d5589d799b23dc60e
1 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
3         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
5 2003-04-15  Roland McGrath  <roland@redhat.com>
7         * forward.c (__pthread_unwind): Tweak to avoid warning.
9 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
11         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
13 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
15         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
16         overflow CFA advance instructions.
17         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
19 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
21         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
22         * sysdeps/i386/pthread_spin_lock.c: Likewise.
23         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
24         defined.
26         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
27         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
28         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
29         DW_CFA_advance_loc for .Laddl-.Lsubl.
31 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
33         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
34         position-independent unwind data for static libraries.
35         Add missing unwind info.  Add comments.
37         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
38         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
39         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
40         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
42 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
44         * Makefile: Make sure all cancellation points are compiled with
45         exception and asynchronous unwind tables.
47         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
48         which mishandles loading of global object addresses in PIC.
49         (THREAD_SETMEM_NC): Likewise.
51 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
53         * pthread.h: Define new data structure for cleanup buffer.  Declare
54         new cleanup handler interfaces.
55         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
56         (struct pthread): Add cleanup_jmp_buf pointer.  Define
57         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
58         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
59         it.  Declare old cleanup handler installation functions.
60         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
61         handling.
62         * cleanup_defer.c: Likewise.
63         * cleanup_compat.c: New file.  Old cleanup code.
64         * cleanup_def_compat.c: New file.  Old cleanup code.
65         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
66         if own thread descriptor.
67         * unwind.c: New file.
68         * forward.c: Add __pthread_unwind.
69         * init.c (pthread_functions): Add __pthread_unwind.
70         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
71         Add ptr___pthread_unwind.
72         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
73         and unwind function.
74         * Makefile (libpthread-routines): Add cleanup_compat,
75         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
76         table generation if necessary.
77         * version.c: Record whether unwind support is compiled in.
78         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
79         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
80         handler interfaces.
81         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
82         complication to generate unwind information for syscall wrappers.
83         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
84         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
85         __cleanup_fct_attribute.
87         * Makefile: Add rules to build and run tst-cleanup0.
88         * tst-cleanup0.c: New file.
89         * tst-cleanup0.expect: New file.
91         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
92         caller.  Optimize to avoid often unecessary local variable.
94 2003-04-11  Roland McGrath  <roland@redhat.com>
96         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
97         sets variable `multidir'; include that.
98         (generated): Add it.
99         ($(objpfx)$(multidir)/crti.o): New target.
100         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
102 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
104         * tst-attr2.c (do_test): Add cast to avoid warning.
105         * tst-mutex4.c (do_test): Likewise.
107 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
109         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
110         in child.
112 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
114         * Makefile (tests): Add tst-detach1.
115         * tst-detach1.c: New file.
117 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
119         * sysdeps/pthread/pthread.h: Remove duplicate
120         pthread_cleanup_{push,pop} definitions.
122         * tst-barrier2.c: Eliminate warnings.
123         * tst-cancel4.c: Likewise.
124         * tst-cond4.c: Likewise.
125         * tst-cond6.c: Likewise.
126         * tst-detach1.c: Likewise.
127         * tst-rwlock4.c: Likewise.
128         * tst-rwlock6.c: Likewise.
129         * tst-rwlock7.c: Likewise.
130         * tst-sem3.c: Likewise.
131         * tst-spin2.c: Likewise.
132         * tst-umask1.c: Likewise.
134 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
136         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
138 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
140         * descr.h (struct pthread): Move cancelhandling member to the front.
142 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
144         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
145         malloc_parent, and malloc_child statically.
146         (__register_atfork_malloc): New function.
147         (free_mem): Don't free any of the malloc_* variables on the list.
148         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
149         Define HAVE_register_atfork_malloc.
151 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
153         * sysdeps/pthread/createthread.c (create_thread): Add some more
154         comments explaining when to set multiple_threads and when not.
156         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
157         THREAD_ATOMIC_BIT_SET if not already defined.
158         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
159         THREAD_ATOMIC_BIT_SET:
160         * sysdeps/x86_64/tls.h: Likewise.
161         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
162         THREAD_ATOMIC_CMPXCHG_VAL.
163         (_pthread_cleanup_pop_restore): Likewise.
164         * cancellation.c (__pthread_enable_asynccancel): Likewise.
165         (__pthread_enable_asynccancel_2): Likewise.
166         (__pthread_disable_asynccancel): Likewise.
167         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
168         (__libc_disable_asynccancel): Likewise.
169         * init.c (sigcancel_handler): Likewise.
170         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
171         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
173 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
175         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
176         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
177         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
178         * Makefile (tests): Add tst-cancel11.
179         * tst-cancel11.c: New file.
181 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
183         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
184         round, not the first.  Use specific_used flag instead of local
185         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
186         (__free_tcb): Don't call deallocate_tsd here.
187         (start_thread): Call deallocate_tsd here.
188         * pthread_setspecific.c: Set specific_used flag really only when
189         needed.
190         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
191         * tst-tsd3.c: New file.
192         * tst-tsd4.c: New file.
194 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
196         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
197         Use atomic_exchange_and_add instead of __lll_add.
198         (__lll_mutex_timedlock): Likewise.
199         Patch by Ian Wienand.
201 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
203         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
204         (SINGLE_THREAD_P): Fix typo.
205         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
207 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
209         * Makefile (tests): Add tst-align.
210         * tst-align.c: New file.
211         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
213         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
214         function correctly.
216         * tst-tsd2.c: Add casts to avoid warnings.
218 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
220         * descr.h (struct pthread): Move most often used elements to the front.
222 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
224         * Makefile (libpthread-routines): Add pthread_atfork.
225         (libpthread-static-only-routines): Add pthread_atfork.
227 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
229         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
230         of TLS_DTV_AT_TP.
231         (INSTALL_DTV): Add parens.
232         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
233         Use passed descr instead of THREAD_SELF.
234         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
235         (__lll_mutex_timedlock_wait): Correct expected value after
236         spurious wakeup.
237         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
238         Release lock before waking up the waiters.
239         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
240         criteria.  Reorderstruct passed to cleanup handler.  Fix
241         handling of cancellation and failung pthread_mutex_unlock call.
242         Use __pthread_enable_asynccancel_2 instead of
243         __pthread_enable_asynccancel.
244         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
245         Return result of lock re-get if it fails.
246         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
247         for __pthread_cleanup_push.
248         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
249         completely broken rwlock implementation.
250         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
251         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
252         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
253         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
254         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
255         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
256         versioned_symbol macro.
257         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
258         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
260 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
262         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
263         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
264         and __helper_tid.
265         (struct timer): Remove th and bar field.
266         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
267         debugging code.  Create only one helper thread.
268         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
269         helper thread.
270         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
271         Renamed.  Define statically.  Use thread info from siginfo.
272         (__helper_once): New variable.
273         (__helper_tid): New variable.
274         (__reset_helper_control): New function.
275         (__start_helper_thread): New function.
277         * pthread_create.c (start_thread): Don't use setjmp inside
278         __builtin_expect to work around gcc bug.
280         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
281         timer_delete syscall fails, but not with ENOSYS, set
282         __no_posix_timers.
284         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
285         (timer_settime): Fix typo.
286         * sysdeps/unix/sysv/linux/timer_getoverr.c
287         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
289 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
291         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
292         offset of cleanupbuf.__prev.
294 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
296         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
297         of included file.
299 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
301         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
302         NULL provide default definition to syscall.
304 2003-03-25  Roland McGrath  <roland@redhat.com>
306         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
307         (timer_id2ptr): Fix typo.
309 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
311         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
312         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
313         * sysdeps/ia64/pthreaddef.h: Likewise.
314         * sysdeps/powerpc/pthreaddef.h: Likewise.
315         * sysdeps/s390/pthreaddef.h: Likewise.
316         * sysdeps/sh/pthreaddef.h: Likewise.
317         * sysdeps/x86_64/pthreaddef.h: Likewise.
318         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
319         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
320         being changed.
321         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
322         SIGTIMER is not unblocked.
323         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
324         RT signal taken.
325         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
326         be send.
327         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
328         pass pointer through as ID.
329         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
330         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
331         * sysdeps/unix/sysv/linux/timer_create.c: New file.
332         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
333         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
334         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
335         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
336         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
337         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
338         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
339         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
340         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
341         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
342         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
343         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
344         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
345         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
346         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
347         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
348         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
349         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
350         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
351         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
352         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
353         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
354         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
355         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
356         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
357         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
358         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
359         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
360         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
361         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
363         * pthreadP.h: Remove FRAME_LEFT definition.
364         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
365         already left frame.  Programs which have this problem are not POSIX
366         compliant.
367         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
369 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
371         * sysdeps/pthread/tst-timer.c: Check return values of the
372         functions we test.
374 2003-03-23  Roland McGrath  <roland@redhat.com>
376         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
377         * tst-tls3mod.c: Likewise.
378         * tst-tls1.c: Likewise.
379         * tst-tls2.c: Likewise.
381         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
382         undefined behavior.
384         * tst-join5.c (tf1, tf2): Add a cast.
386         * Makeconfig (includes): Append -I$(..)nptl to this variable.
388         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
389         Don't test anything.
390         * tst-cond4.c: Likewise.
391         * tst-cond6.c: Likewise.
392         * tst-flock2.c: Likewise.
393         * tst-mutex4.c: Likewise.
394         * tst-rwlock4.c: Likewise.
395         * tst-signal1.c: Likewise.
396         * tst-spin2.c: Likewise.
397         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
399         * tst-mutex4.c: Use test-skeleton.c.
400         * tst-spin2.c: Likewise.
401         * tst-sysconf.c: Likewise.
402         * tst-barrier2.c: Likewise.
403         * tst-cond4.c: Likewise.
404         * tst-cond6.c: Likewise.
405         * tst-rwlock4.c: Likewise.
406         * tst-unload.c: Likewise.
407         * tst-flock2.c (do_test): Use return instead of exit.
409 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
411         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
413 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
415         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
416         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
417         instead of __lll_compare_and_swap.
418         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
419         Likewise.
420         Removed definition if __lll_compare_and_swap.
422         * cancellation.c: Adjust for new form of compare&exchange macros.
423         * cleanup_defer.c: Likewise.
424         * init.c: Likewise.
425         * libc-cancellation.c: Likewise.
426         * old_pthread_cond_broadcast.c: Likewise.
427         * old_pthread_cond_signal.c: Likewise.
428         * old_pthread_cond_timedwait.c: Likewise.
429         * old_pthread_cond_wait.c: Likewise.
430         * pthread_cancel.c: Likewise.
431         * pthread_create.c: Likewise.
432         * pthread_detach.c: Likewise.
433         * pthread_join.c: Likewise.
434         * pthread_key_delete.c: Likewise.
435         * pthread_setcancelstate.c: Likewise.
436         * pthread_setcanceltype.c: Likewise.
437         * pthread_timedjoin.c: Likewise.
438         * pthread_tryjoin.c: Likewise.
439         * sysdeps/pthread/createthread.c: Likewise.
441 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
443         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
444         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
445         definitions.  Replace uses with calls to atomic_* functions.
446         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
447         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
448         __lll_test_and_set calls with atomic_exchange_and_add and
449         atomic_exchange calls respectively.
450         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
451         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
452         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
453         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
454         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
455         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
456         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
458         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
459         returns the old value.
461 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
463         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
464         int for variable OLDVAL and correct inline assembler contraint.
465         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
466         type int for variable OLD.
468         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
469         only for s390-32.
470         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
471         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
472         instead of multiple_threads field in the TCB.
474 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
476         * sysdeps/i386/i686/bits/atomic.h: Removed.
477         * sysdeps/i386/i586/bits/atomic.h: Removed.
478         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
479         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
480         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
481         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
482         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
483         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
484         * atomic.h: Removed.  Moved to glibc.
486         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
487         support for clock selection.
489         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
490         signalling waiters.
492 2003-03-18  Roland McGrath  <roland@redhat.com>
494         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
495         Add __lll_rel_instr first.  Add memory clobber.
496         (lll_mutex_unlock): Use __lll_test_and_set.
497         From Paul Mackerras <paulus@samba.org>.
499         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
500         unconditionally.
501         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
502         (SINGLE_THREAD_P):  Add `header.' prefix.
503         From Paul Mackerras <paulus@samba.org>.
505         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
506         pthread_timedjoin_np to ...
507         (libpthread: GLIBC_2.3.3): ... here.
508         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
510         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
511         Avoid shadowing VAL variable.
513         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
514         New macro.
516 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
518         * Makefile (tests): Add tst-cond11.
519         * tst-cond11.c: New file.
521         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
522         struct passed to cleanup handler to eliminate one more
523         instruction.
524         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
526         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
527         (pthrad_cond_t): Replace __unused field with __clock.
529         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
530         waken all waiters in cleanup handler.
531         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
532         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
534         * pthread_condattr_getclock.c: New file.
535         * pthread_condattr_setclock.c: New file.
536         * sysdeps/pthread/pthread.h: Declare these new functions.
537         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
538         * Makefile (libpthread-routines): Add the new functions.
539         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
540         Renamed field to value.  Document use of the bits.
541         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
542         change.
543         * pthread_condattr_setpshared.c: Likewise.
544         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
545         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
546         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
547         Add __clock field.
548         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
549         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
550         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
551         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
552         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
553         Implement clock selection.
554         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
555         * pthread-errnos.sym: Add ENOSYS.
556         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
557         _POSIX_CLOCK_SELECTION.
558         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
560         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
561         invalid .size directive.
563 2003-03-17  Roland McGrath  <roland@redhat.com>
565         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
566         Formatting tweaks.
568 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
570         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
571         Use __lll_add instead of spelling it out.  Use protected symbol names.
572         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
573         Use __lll_add.
574         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
575         Renamed from lll_compare_and_swap.  Use new name where necessary.
576         (__lll_add): Defined.
577         (__lll_dec_if_positive): Defined.
578         (__lll_test_and_set): Defined.
579         * sysdeps/ia64/pthread_spin_init.c: Removed.
580         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
581         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
582         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
583         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
584         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
585         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
586         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
587         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
588         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
589         __sync_lock_release_si.
590         Patch by Jakub Jelinek.
592         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
593         Fix timeout handling.
594         (__lll_timedwait_tid): Likewise.
595         (lll_unlock_wake_cb): Wake up other waiters if necessary.
596         Patch by Jakub Jelinek.
598         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
600 2003-03-17  Roland McGrath  <roland@redhat.com>
602         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
603         * sysdeps/pthread/pthread_spin_init.c: New file.
604         * sysdeps/pthread/pthread_spin_unlock.c: New file.
605         * sysdeps/powerpc/Makefile: New file.
606         * sysdeps/powerpc/pthread_spin_lock.c: New file.
607         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
608         * sysdeps/powerpc/pthreaddef.h: New file.
609         * sysdeps/powerpc/tcb-offsets.sym: New file.
610         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
611         * sysdeps/powerpc/tls.h: New file.
612         * sysdeps/powerpc/bits/atomic.h: New file.
613         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
614         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
615         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
617         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
618         * sysdeps/unix/sysv/linux/sem_post.c: New file.
619         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
620         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
621         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
622         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
623         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
624         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
625         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
626         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
627         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
628         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
629         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
630         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
631         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
633         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
634         not gettimeofday.
635         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
636         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
637         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
638         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
639         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
641 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
643         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
644         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
645         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
646         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
647         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
649 2003-03-16  Roland McGrath  <roland@redhat.com>
651         * tst-fork4.c: Include <string.h>.
652         * tst-signal2.c: Likewise.
653         * tst-mutex5.c (do_test): exit -> return.
654         * tst-mutex2.c: Include <stdlib.h>.
656 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
658         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
659         (__lll_mutex_timedlock_wait): Correct expected value after
660         spurious wakeup.  Otherwise we would never wait again.
662         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
663         zone versus inline asm stupidity.  Use correct instructions.
665         * tst-rwlock6.c: Add some more status output.
667 2003-03-15  Roland McGrath  <roland@redhat.com>
669         * sysdeps/pthread/configure.in: New file.
670         * sysdeps/pthread/configure: New file (generated).
672 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
674         * allocatestack.c (allocate_stack): Store the exact stack size of
675         user allocated stacks.
677 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
679         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
680         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
681         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
682         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
683         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
684         Use `header.' prefix.
685         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
687 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
689         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
690         __builtin_frame_address, use stack pointer.
692         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
693         instead of __builtin_frame_pointer.
695 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
697         * tst-basic1.c (do_test): Add cast to avoid warning.
698         * tst-basic2.c (do_test): Likewise.
700         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
701         amount of stack correction.
703         * tst-fork4.c: Use test-skeleton.c.
705 2003-03-14  Roland McGrath  <roland@redhat.com>
707         * init.c: Fix typo "#eli" for "#else".
709 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
711         * allocatestack.c (__stack_user): Use hidden_data_def.
712         * pthread_create.c (__pthread_keys): Likewise.
714         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
716 2003-03-14  Roland McGrath  <roland@redhat.com>
718         * tst-fork4.c: New file.
719         * Makefile (tests): Add it.
721         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
722         we always define the padding space.
723         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
724         stopped supporting its own extensions fully.
725         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
726         struct also called `header', so `header.multiple_threads' is the field
727         name to use on all machines.
728         * allocatestack.c (allocate_stack): Use `header.' prefix.
729         * sysdeps/pthread/createthread.c (create_thread): Likewise.
730         * pthread_create.c (__pthread_create_2_1): Likewise.
731         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
732         (THREAD_SELF): Likewise.
733         * sysdeps/x86_64/tls.h: Likewise.
734         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
735         (SINGLE_THREAD_P): Likewise.
736         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
737         (SINGLE_THREAD_P): Likewise.
738         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
739         (SINGLE_THREAD_P): Likewise.
741         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
742         value directly.
744 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
746         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
747         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
749         * pthread_create.c (start_thread): setjmp is expected to return 0.
751         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
752         (THREAD_GETMEM_NC): Likewise.
754 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
756         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
757         and the size of the stack which must be allocated is a multiple,
758         allocate one more page.
759         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
760         MULTI_PAGE_ALIASING.
762 2003-03-13  Roland McGrath  <roland@redhat.com>
764         * pthread_create.c (start_thread): Set EXITING_BIT after the
765         event-reporting (and destructors), not before.
767 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
769         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
770         lll_futex_wake): Declare register variables as long int instead of
771         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
772         Make syscall arguments clobbered by the syscall.
773         (lll_futex_wait): Define using lll_futex_timed_wait.
775         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
776         to void *.
778         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
779         PPID if [! NDEBUG].
781         * allocatestack.c (nptl_ncreated): Only declare if
782         COLORING_INCREMENT != 0.
784         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
785         (__libc_enable_asynccancel_2): Remove prototype.
787         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
788         ctid to match kernel.
790 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
792         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
793         libc_multiple_threads.
794         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
795         __libc_multiple_threads to...
796         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
798         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
799         versioning.
800         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
801         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
803         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
804         (__pthread_once_internal): Define.
806         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
807         macros instead of .symver directly.
808         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
809         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
811         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
812         * sysdeps/x86_64/tcb-offsets.sym: New file.
813         * sysdeps/x86_64/Makefile: New file.
815         * sysdeps/i386/tcb-offsets.sym: Add SELF.
816         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
817         to access own pthread_t in TCB.
818         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
819         Likewise.
820         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
821         Likewise.
822         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
824 2003-03-12  Roland McGrath  <roland@redhat.com>
826         * pthread-errnos.sym: New file.
827         * Makefile (gen-as-const-headers): New variable, list that file.
828         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
829         header <pthread-errnos.h> instead of defining errno values here.
830         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
831         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
832         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
833         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
834         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
835         Likewise.
836         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
837         Likewise.
838         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
839         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
840         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
841         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
842         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
843         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
844         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
845         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
846         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
847         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
848         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
849         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
850         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
851         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
852         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
853         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
854         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
855         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
856         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
857         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
858         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
859         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
860         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
861         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
862         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
863         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
864         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
866         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
867         CLONE_CHILD_SETTID worked.
869 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
871         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
872         file.
873         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
874         file.
876         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
877         (pthread_cond_t): Add padding.
879         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
880         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
881         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
883         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
884         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
885         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
886         (__pthread_rwlock_timedrdlock): Likewise.
887         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
888         (__pthread_rwlock_wrlock): Likewise.
889         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
890         (__pthread_rwlock_rdlock): Likewise.
892         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
894         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
895         result of lock re-get if it fails.
897 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
899         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
900         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
901         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
902         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
903         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
904         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
905         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
906         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
907         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
908         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
910         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
911         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
913         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
914         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
915         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
916         (create_thread): Likewise.
917         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
918         * init.c (__pthread_initialize_minimal_internal): Initialize
919         __libc_multiple_threads_ptr if necessary.
920         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
921         __pthread_multiple_threads and __libc_multiple_threads_ptr.
922         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
923         __libc_multiple_threads.
924         (__libc_pthread_init): Return pointer to __libc_pthread_init if
925         necessary.
927         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
928         (THREAD_SETMEM_NC): Likewise.
930         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
931         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
932         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
933         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
935         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
936         Eliminate one entire instruction.
938         * cancellation.c (__pthread_enable_asynccancel_2): New function.
939         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
940         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
941         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
942         instead of __pthread_enable_asynccancel.
943         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
944         (__pthread_cond_wait): Likewise.
945         * sysdeps/pthread/pthread_cond_timedwait.c
946         (__pthread_cond_timedwait): Likewise.
947         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
949         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
950         (__condvar_cleanup): Wake up all waiters in case we got signaled
951         after being woken up but before disabling asynchronous
952         cancellation.
953         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
954         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
955         (__condvar_cleanup): Likewise.
957         * init.c (__NR_set_tid_address): If already defined, don't redefine.
958         Make it an error if architecture has no #if case.  Add x86-64.
960         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
961         pt-initfini.s generation.
963         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
964         (TLS_INIT_TP): Fix typo.
966 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
968         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
969         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
971         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
972         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
973         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
974         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
975         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
976         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
977         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
978         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
980 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
982         * sysdeps/pthread/pthread_cond_timedwait.c
983         (__pthread_cond_timedwait): Return the result of the final
984         locking.  If it succeeds, the regular function return value.
986         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
987         Return result of the final locking.
988         * version.c (__nptl_main): Work around problems with the strange
989         INTERNAL_SYSCALL macro on ppc32.
990         * init.c (__pthread_initialize_minimal_internal): Unblock
991         SIGCANCEL in case the parent blocked it.
992         Reported by Paul Mackerras <paulus@samba.org>.
994         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
995         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
996         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
998 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
1000         * sysdeps/pthread/pthread_cond_timedwait.c
1001         (__pthread_cond_timedwait): Unlock and fail if
1002         __pthread_mutex_unlock_internal failed.
1004         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
1005         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
1006         Use ARCH_CLONE.
1007         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
1008         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
1009         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
1010         ALLOCATE_STACK): New macros.
1011         (TLS_TPADJ): New macro.
1012         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
1013         (allocate_stack): Handle TLS_DTV_AT_TP and
1014         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
1015         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
1016         Don't set PD->self.
1017         * init.c [__ia64__] (__NR_set_tid_address): Define.
1019         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
1020         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
1021         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
1022         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
1023         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
1024         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
1025         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
1026         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
1027         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
1028         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
1029         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
1030         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
1031         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
1032         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
1033         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
1034         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
1035         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
1036         * sysdeps/ia64/bits/atomic.h: New file.
1037         * sysdeps/ia64/Makefile: New file.
1038         * sysdeps/ia64/pthread_spin_init.c: New file.
1039         * sysdeps/ia64/pthread_spin_lock.c: New file.
1040         * sysdeps/ia64/pthread_spin_trylock.c: New file.
1041         * sysdeps/ia64/pthread_spin_unlock.c: New file.
1042         * sysdeps/ia64/pthreaddef.h: New file.
1043         * sysdeps/ia64/tcb-offsets.sym: New file.
1044         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
1045         * sysdeps/ia64/tls.h: New file.
1047         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
1048         to syscall instead of no arguments.
1050 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
1052         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
1053         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
1054         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
1055         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
1057         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
1058         unused code.
1060         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
1062         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
1063         lowlevelbarrier.sym.
1064         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
1065         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
1066         Include lowlevelbarrier.h and don't define offsets locally.
1067         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
1069         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1070         (__lll_mutex_lock_wait): Reverse order of first two parameters.
1071         (__lll_mutex_timedlock_wait): Likewise.
1072         (lll_mutex_lock): Adjust asm for that.
1073         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
1074         (lll_lock): Adjust asm for operand order change.
1075         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
1076         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
1078         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
1079         Reverse order of parameters.
1080         (__lll_timedwait_tid): Remove regparms attribute.
1081         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
1082         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
1084         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1085         (__lll_timedwait_tid): Remove one unnecessary instruction.
1087         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
1088         __lll_mutex_timedlock_wait only for NOT_IN_libc.
1089         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
1090         lowlevelmutex.S.
1092         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
1093         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
1094         for NOT_IN_libc.
1095         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
1096         lowlevellock.S.
1098         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
1099         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
1100         for libc.so.
1101         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
1102         define LOCK here (if UP is not defined).  The actual code is in
1103         lowlevelmutex.S.
1105         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
1106         LOCK is already defined.  Don't define lll_unlock_wake_cb and
1107         __lll_timedwait_tid for libc.so.
1108         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
1109         define LOCK here (if UP is not defined).  The actual code is in
1110         lowlevellock.S.
1112         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
1113         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
1114         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
1115         instead of lowlevelsem.h.
1116         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
1117         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
1118         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
1120         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
1121         lowlevelrwlock.sym.
1122         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
1123         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
1124         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
1126         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
1127         register loading.
1128         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
1129         last changed.  D'oh.
1131         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
1133         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
1134         of __libc_locking_needed.
1135         (lll_trylock): Initialize %eax to zero.
1137         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
1138         pthread_cond_t definition.
1140 2003-03-10  Roland McGrath  <roland@redhat.com>
1142         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
1143         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
1144         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
1145         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
1146         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
1148         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
1149         Instead of setting PD->multiple_threads, set globals
1150         __pthread_multiple_threads and __libc_multiple_threads.
1151         * sysdeps/pthread/createthread.c (create_thread): Likewise.
1152         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
1153         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
1155         * descr.h (struct pthread): Conditionalize first member on
1156         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
1157         containing an anonymous tcbhead_t.  Move `list' member out.
1158         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
1159         * allocatestack.c: Remove use of `header.data.' prefix.
1160         * pthread_create.c: Likewise.
1161         * init.c (__pthread_initialize_minimal_internal): Likewise.
1162         * sysdeps/pthread/createthread.c (create_thread): Likewise.
1163         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
1164         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
1165         * sysdeps/x86_64/tls.h: Likewise.
1166         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
1167         (SINGLE_THREAD_P): Likewise.
1168         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
1169         (SINGLE_THREAD_P): Likewise.
1170         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
1171         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
1173 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
1175         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
1177         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
1178         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
1180         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
1181         leftovers from the ia32 code.
1183         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
1184         memory load.
1185         (clear_once_control): Don't load %esi.
1187         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
1188         handling.
1190         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
1192         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
1193         * sysdeps/unix/sysv/linux/createthread.c: ...here.
1195         * Makefile (tests): Add tst-cond10.
1196         * tst-cond10.c: New file.
1198 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
1200         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
1201         * tst-signal3.c (do_test): Likewise.
1202         * tst-sem5.c (do_test): Likewise.
1203         * tst-kill6.c (do_test): Likewise.
1204         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
1206         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
1207         of inc/dec.
1208         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
1209         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
1210         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1211         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1212         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1213         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1214         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1215         Likewise.
1216         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1217         Likewise.
1218         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1219         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1220         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1221         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1222         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1223         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
1224         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
1225         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1227         * allocatestack.c (allocate_stack): If mprotect() fails free the
1228         TLS memory.
1230 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
1232         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
1234         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
1235         lll_wake_tid.  This was used only to work around kernel limits in
1236         the early days.
1237         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1238         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
1239         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1240         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1242         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
1243         (__pthread_initialize_minimal_internal): Change initialization of
1244         __static_tls_align_m1 appropriately.
1245         * pthreadP.h (__static_tls_align_m1): Renamed from
1246         __static_tls_align.
1247         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
1248         instead of __static_tls_align-1.
1250 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
1252         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
1254         * pthread_create.c: Define __pthread_keys using nocommon
1255         attribute, not by placing it explicitly in bss.
1256         Remove DEFINE_DEALLOC definition.  Not needed anymore.
1258         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
1259         Use it in mmap call to allocate stacks.
1261         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
1263         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
1264         result of the thread function.
1266 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
1268         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
1269         version is just fine.
1271         * sysdeps/unix/sysv/linux/libc_pthread_init.c
1272         (__pthread_child_handler): Renamed from pthread_child_handler,
1273         exported, and marked hidden.  Change all users.
1274         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
1275         free __pthread_child_handler from child list.
1277 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1279         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
1281         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1282         Fix handling of cancellation and failing pthread_mutex_unlock call.
1283         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
1284         (__pthread_cond_wait): Likewise.
1286         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
1287         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
1288         lll_futex_timed_wait call.
1289         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1290         (pthread_rwlock_timedwrlock): Likewise.
1292         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
1293         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
1294         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
1296         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
1297         check of lll_futex_wake return value.
1299 2003-03-03  Roland McGrath  <roland@redhat.com>
1301         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
1303         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1304         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
1305         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1307 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
1309         * sysdeps/pthread/timer_create.c (timer_create): Return correct
1310         error for CPU clocks.
1312         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1313         _POSIX_MONOTONIC_CLOCK.
1314         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1316         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
1317         recent kernels.
1319 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
1321         * descr.h (struct pthread): Move cleanup field to the front.
1323 2003-03-01  Roland McGrath  <roland@redhat.com>
1325         * sem_open.c (sem_open): Braino fix.
1327 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
1329         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
1330         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
1331         __pthread_cleanup_pop functionality.
1332         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1334         * descr.h (struct pthread): Move tid field to the front now that
1335         it is often used.
1337         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
1338         (__lll_mutex_timedlock_wait): Remove.
1339         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
1340         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
1341         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
1342         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1343         (lll_unlock_wake_cb): Don't save and restore %esi.
1344         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
1345         %esi.
1346         (__lll_timedwait_tid): Add alignment.
1347         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
1348         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
1349         %esi.
1350         (__lll_timedwait_tid): Removed.
1351         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1352         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
1353         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
1354         (pthread_barrier_wait): Don't save, load, and restore %esi for
1355         last thread.
1356         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1357         (__pthread_cond_signal): Don't save, load, and restore %esi.
1358         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1359         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
1360         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
1361         Don't save, load, and restore %esi.
1363 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
1365         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1366         Release lock before waking up the waiters.
1368         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
1370         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
1371         (reader_thread): Likewise.
1373         * sysdeps/pthread/pthread_rwlock_unlock.c
1374         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
1375         to wake up readers if there are none.
1377         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1378         Release internal lock before wake threads.
1380 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
1382         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
1383         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
1384         predefined.
1385         * tst-rwlock9.c: Likewise.
1386         * tst-rwlock10.c: New file.
1387         * tst-rwlock11.c: New file.
1389         * Makefile (tests): Add tst-dlsym1.
1390         * tst-dlsym1.c: New file.
1392         * init.c (__pthread_initialize_minimal_internal): Set
1393         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
1394         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
1396 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
1398         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
1400         * tst-cond2.c: Fix sychronization with child.
1402         * tst-rwlock8.c (reader_thread): Remove unused variable.
1404         * Makefile: Add rules to build and run tst-tls3.
1405         * tst-tls3.c: New file.
1406         * tst-tls3mod.c: New file.
1408         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
1409         * tst-rwlock8.c: New file.
1410         * tst-rwlock9.c: New file.
1411         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
1412         complete broken rwlock implementation.
1413         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1414         Likewise.
1415         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1416         Likewise.
1417         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1418         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1419         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
1420         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
1421         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1422         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
1423         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
1425 2003-02-23  Roland McGrath  <roland@redhat.com>
1427         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
1429 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
1431         * Makefile (tests): Add tst-context1.
1432         * tst-context1.c: New file.
1434         * Makefile (tests): Add tst-tls1 and tst-tls2.
1435         * tst-tls1.c: New file.
1436         * tst-tls2.c: New file.
1438         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
1439         for failed cmpxchg.
1441         * pthread_create.c (start_thread): Set EXITING_BIT early.
1443         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
1444         (THREAD_GETMEM_NC): Likewise.
1446 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
1448         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
1449         off 3 more bytes by using offset-less instructions when possible.
1451         * Makefile: Add dependency for $(objpfx)version.d.
1453         * eintr.c (eintr_source): Add unnecessary return but the compiler
1454         insists.
1456         * tst-kill3.c: Include <unistd.h>.
1458 2003-02-21  Roland McGrath  <roland@redhat.com>
1460         * pthread_create.c (start_thread): Call __libc_thread_freeres.
1462 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
1464         * Makefile (tests): Add tst-eintr1.
1465         (distribute): Add eintr.c.
1466         * tst-eintr1.c: New file.
1467         * eintr.c: New file.
1469         * pthread_cancel.c (pthread_cancel): Use tkill directly.
1471         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
1472         Disallow sending SIGCANCEL.
1474         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
1475         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
1476         * tst-kill1.c: New file.
1477         * tst-kill2.c: New file.
1478         * tst-kill3.c: New file.
1479         * tst-kill5.c: New file.
1480         * tst-kill6.c: New file.
1481         * tst-basic7.c: Renamed to...
1482         * tst-kill4.c: ...this.
1484 2003-02-21  Roland McGrath  <roland@redhat.com>
1486         * Makefile (install-lib-ldscripts): New variable.
1488 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
1490         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
1491         * pthread_cancel.c: Use INVALID_TD_P.
1492         * pthread_detach.c: Likewise.
1493         * pthread_getschedparam.c: Likewise.
1494         * pthread_setschedparam.c: Likewise.
1495         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
1496         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1497         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
1498         * pthread_timedjoin.c: Likewise.
1500         * tst-basic7.c: Include <signal.h>.
1502         * pthread_join.c (pthread_join): Limited checking for invalid
1503         descriptors.
1504         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
1506 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
1508         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
1509         beginning of the loop.  Clear the entire first block of TSD.
1510         * Makefile (tests): Add tst-key4.
1511         * tst-key4.c: New file.
1513 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
1515         * Makefile (tests): Add tst-basic7.
1516         * tst-basic7.c: New file.
1518         * pthread_create.c (deallocate_tsd): Mark as internal_function.
1519         Add some more __builtin_expect.
1521         * pthreadP.h: Define dummy version of DEBUGGING_P.
1523 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
1525         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
1526         _POSIX_THREAD_PRIORITY_SCHEDULING.
1527         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
1528         _XOPEN_REALTIME_THREADS.
1529         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
1531         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
1532         kernel returns EINVAL for PID <= 0, work around it.
1534         * Makefile (tests): Add tst-signal5.
1535         * tst-signal5.c: New file.
1537         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
1538         and LOGIN_NAME_MAX.
1540         * tst-cancel1.c (tf): Block all signals.
1542         * Makefile (tests): Add tst-basic6.
1543         * tst-basic6.c: New file.
1545         * tst-basic1.c: Add test for process ID.
1547         * Makefile (tests): Add tst-cancel10.
1548         * tst-cancel10.c: New file.
1550         * Makefile (tests): Add tst-signal4.
1551         * tst-signal4.c: New file.
1553         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
1554         __sigismember instead of sigismember.  Add __builtin_expect.
1556 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
1558         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
1559         pthread_setcancelstate, and pthread_rwlock_setpshared.
1561         * tst-cancel7.c (do_test): Make sure the pid file exists before
1562         canceling the thread.
1564         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
1565         pthread_rwlock_timedrdlock tests.
1566         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
1567         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1568         Check for invalid tv_nsec field.
1569         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1570         Likewise.
1572         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
1573         recursive mutex of overflow.
1575         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
1577         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
1578         going into an endless loop.
1579         * Makefile (tests): Add tst-cancel9.
1580         * tst-cancel9.c: New file.
1582         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
1584 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
1586         * tst-mutex5.c (do_test): Add more timedlock tests.
1588         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
1589         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
1591         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
1592         use INLINE_SYSCALL.  Error number is returned, not -1.
1594         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
1595         and __deallocate_stack with internal_function.
1596         * pthread_create.c: Adjust definitions appropriately.
1597         * allocatestack.c: Likewise.
1599         * pthread_join.c: Add one more __builtin_expect.
1600         * pthread_timedjoin.c: Likewise.
1602         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
1603         not data of sequence number does not match.
1604         Add one __builtin_expect.
1606         * Makefile (tests): Add tst-clock1.
1607         * tst-clock1.c: New file.
1609         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
1610         negative arguments.
1611         * Makefile (tests): Add tst-basic5.
1612         * tst-basic5.c: New file.
1614 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
1616         * Makefile (tests): Add tst-basic4.
1617         * tst-basic4.c: New file.
1619         * pthreadP.h: Add declaraction for __nptl_nthreads.
1620         * pthread_create.c: Define __nptl_nthreads
1621         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
1622         after thread is done.  If then zero, call exit(0).
1623         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1624         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
1625         * init.c (pthread_functions): Initialize ptr_nthreads.
1626         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
1627         (__reclaim_stacks): Decrement __nptl_nthreads.
1628         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
1629         Define.
1630         * Makefile (tests): Add tst-basic3.
1631         * tst-basic3.c: New file.
1633         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
1634         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
1635         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
1636         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
1637         if asynchronous canceling is enabled.
1638         * pthread_join.c (pthread_join): When recognizing circular joins,
1639         take into account the other thread might be already canceled.
1640         * Makefile (tests): Add tst-join5.
1641         * tst-join5.c: New file.
1643         * Makefile (tests): Add tst-join4.
1644         * tst-join4.c: New file.
1646 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
1648         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
1650 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1652         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
1653         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
1654         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
1655         warning.
1656         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
1657         to avoid warning.
1658         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
1659         error if lll_futex_wake failed.
1661 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
1663         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
1664         handling of cancellation and failung pthread_mutex_unlock call.
1665         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1666         * Makefile (tests): Add tst-cond8 and tst-cond9.
1667         * tst-cond8.c: New file.
1668         * tst-cond9.c: New file.
1670         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
1672         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
1673         non-standard initializers with __USE_GNU.
1675         * Makefile (tests): Add tst-cleanup3.
1676         * tst-cleanup3.c: New file.
1678 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
1680         * Makefile (tests): Add tst-attr1 and tst-attr2.
1681         * tst-attr1.c: New file.
1682         * tst-attr2.c: New file.
1684         * Makefile: Add rules to build and run tst-atfork2 test.
1685         * tst-atfork2.c: New file.
1686         * tst-atfork2mod.c: New file.
1688         * sysdeps/unix/sysv/linux/unregister-atfork.c
1689         (__unregister_atfork): Free the memory allocated for the handlers
1690         after removing them from the lists.
1692         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
1693         cleanup function.
1695         * tst-atfork1.c (do_test): Wait for the child we forked.
1696         Report error in child.
1698         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
1700         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
1702 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
1704         * Makefile (tests): Add tst-cancel8.
1705         * tst-cancel8.c: New file.
1707         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
1708         clearing of control variable.
1709         * Makefile (tests): Add tst-once3 and tst-once4.
1710         * tst-once3.c: New file.
1711         * tst-once4.c: New file.
1713 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
1715         * sysdeps/sh/Makefile: New file.
1716         * sysdeps/sh/bits/atomic.h: New file.
1717         * sysdeps/sh/pthread_spin_init.c: New file.
1718         * sysdeps/sh/pthread_spin_lock.c: New file.
1719         * sysdeps/sh/pthread_spin_trylock.S: New file.
1720         * sysdeps/sh/pthread_spin_unlock.S: New file.
1721         * sysdeps/sh/pthreaddef.h: New file.
1722         * sysdeps/sh/tcb-offsets.sym: New file.
1723         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
1724         * sysdeps/sh/tls.h: New file.
1725         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
1726         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
1727         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
1728         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
1729         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
1730         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
1731         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
1732         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
1733         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
1734         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
1735         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
1736         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
1737         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
1738         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
1739         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
1740         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
1741         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
1742         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
1743         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
1744         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
1745         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
1746         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
1747         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
1748         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
1749         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
1750         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
1751         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
1752         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
1753         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
1754         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
1756 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
1758         * tst-cond2.c: Rearrange code to not rely on behavior undefined
1759         according to POSIX.
1761         * tst-basic2.c (do_test): Lock mutex before creating the thread.
1763 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
1765         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
1766         (TLS_GET_FS): New #define.
1767         (TLS_SET_FS): New #define.
1768         Correct value of __NR_set_thread_area.
1770         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
1772 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
1774         * Makefile (tests): Add tst-popen1.
1775         * tst-popen1.c: New file.
1777         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
1778         but inactive generalization.
1779         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1780         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1781         Minor optimization, remove one instruction.
1782         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1784 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1786         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
1788 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1790         * init.c (__NR_set_tid_address): Add #ifdef for s390.
1791         * sysdeps/pthread/pthread_barrier_wait.c: New file.
1792         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
1793         * sysdeps/pthread/pthread_cond_signal.c: New file.
1794         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
1795         * sysdeps/pthread/pthread_cond_wait.c: New file.
1796         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
1797         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
1798         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
1799         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
1800         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
1801         * sysdeps/s390/Makefile: New file.
1802         * sysdeps/s390/bits/atomic.h: New file.
1803         * sysdeps/s390/pthread_spin_init.c: New file.
1804         * sysdeps/s390/pthread_spin_lock.c: New file.
1805         * sysdeps/s390/pthread_spin_trylock.c: New file.
1806         * sysdeps/s390/pthread_spin_unlock.c: New file.
1807         * sysdeps/s390/pthreaddef.h: New file.
1808         * sysdeps/s390/tcb-offsets.sym: New file.
1809         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
1810         * sysdeps/s390/tls.h: New file.
1811         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
1812         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
1813         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
1814         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
1815         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
1816         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
1817         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
1818         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
1819         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
1820         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
1821         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
1822         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
1823         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
1824         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
1825         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
1826         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
1827         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
1828         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
1829         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
1830         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
1831         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
1832         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
1833         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
1835 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
1837         * atomic.h: Add a couple more default implementations.
1838         (atomic_compare_and_exchange_acq): Use
1839         __arch_compare_and_exchange_32_acq in return value definition.  It
1840         always exists.
1841         (atomic_bit_set): Renamed from atomic_set_bit.
1842         Add missing atomic_ prefixes.
1844         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
1845         thread library is available, use correct value to mark initialized
1846         once variable.
1848 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
1850         * allocatestack.c (allocate_stack): Use __getpagesize instead of
1851         __sysconf to determine pagesize.
1853         * pthread_create.c: Include <atomic.h>.
1854         * allocatestack.c (allocate_stack): Implement coloring of the
1855         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
1856         size minus one.  Adjust users.
1857         * sysdeps/i386/i686/Makefile: New file.
1859 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
1861         * allocatestack.c: Improve comment throughout the file.
1863         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1864         (__lll_lock_wait): Add branch prediction.
1865         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
1866         (__lll_lock_wait): Likewise.
1867         (lll_unlock_wake_cb): Removed.
1869 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
1871         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
1872         _POSIX_THREAD_PRIORITY_SCHEDULING.
1874 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
1876         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1877         Fix return type of ptr___pthread_getspecific.
1879 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
1881         * Makefile (tests): Add tst-umask1.
1882         (tst-umask1-ARGS): Define.
1883         * tst-umask1.c: New file.
1885 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
1887         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
1888         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
1889         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
1890         pthread_rwlock_unlock.
1891         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
1892         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
1893         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
1894         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
1895         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1896         New file.
1897         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
1898         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1899         New file.
1900         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
1901         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
1902         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
1903         New file.
1904         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
1905         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
1906         New file.
1907         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
1908         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
1909         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
1910         New file.
1911         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
1912         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
1913         New file.
1914         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
1916         * Makefile (libpthread-routines): Remove lowlevelcond and
1917         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
1918         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
1919         and pthread_cond_broadcast.
1920         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
1921         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
1922         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
1923         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
1924         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
1925         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
1926         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
1927         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
1928         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
1929         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
1930         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
1931         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
1932         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
1933         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
1934         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
1935         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
1936         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
1937         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
1938         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
1939         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
1940         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
1941         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
1942         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
1943         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
1944         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
1945         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
1946         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
1947         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
1948         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
1949         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
1950         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
1952         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
1953         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
1954         of the code is moved to ...
1955         * sysdeps/pthread/createthread.c: ...here.  New file.
1957 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
1959         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
1960         (__new_sem_post): Clear %eax before returning.
1961         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
1963         * Makefile (tests): Add tst-cleanup2.
1964         * tst-cleanup2.c: New file.
1966         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
1967         Interpret first parameter correctly.
1969 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
1971         * Makefile (headers): Add bits/semaphore.h.
1973 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
1975         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
1976         if not SHARED.
1978 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
1980         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
1981         must be used and mapping failed.
1982         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
1984         * Makefile (CFLAGS-pthread_self.os): Define this, not
1985         CFLAGS-pthread_self.c.
1987 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
1989         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
1990         lll_unlock_wake_cb.
1992         * Makefile (libpthread-routines): Add version.  Add rules to build
1993         version.os and banner.h.
1994         * version.c: New file.
1996 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
1998         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
1999         the alias unconditional.
2000         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
2002 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
2004         * Makefile (CFLAGS-pthread_self.c): New definition.
2006 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
2008         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
2009         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
2010         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
2011         * init.c (__pthread_initialize_minimal_internal): Likewise.
2013 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
2015         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
2017         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2018         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
2019         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
2020         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
2021         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
2022         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
2024 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
2026         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
2027         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
2028         * tst-cancel-wrappers.sh: Remove all exceptions.
2030 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
2032         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
2033         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
2035         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
2036         Use __libc_pthread_functions array if SHARED.
2038         * pthreadP.h: Move pthread_cond_2_0_t definition to...
2039         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
2041         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
2042         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
2043         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
2044         __libc_ptf_call instead of __libc_maybe_call.
2045         (PTF): New #define.
2046         (__libc_cleanup_region_start): Wrap function name with PTF call.
2047         (__libc_cleanup_region_end): Likewise.
2048         (__libc_cleanup_end): Likewise.
2050         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
2051         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
2052         * pthread_key_create.c: Add __pthread_key_create_internal alias.
2053         * pthreadP.h: Add prototypes.
2055         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
2056         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
2057         __pthread_rwlock_unlock aliases.
2058         * pthreadP.h: Add prototypes for new aliases.
2060         * pthreadP.h (struct pthead_functions): Moved to...
2061         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
2062         * init.c (pthread_functions): Add initializers for new elements.
2064         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
2065         __pthread_cleanup_pop_restore aliases.
2066         * pthreadP.h: Add prototypes.
2068         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
2069         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
2070         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
2071         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2072         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
2073         * pthreadP.h: Adjust prototypes and callers.
2075 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
2077         * Makefile (tests): Add tst-cancel7.
2078         (tst-cancel7-ARGS): New variable.
2079         * tst-cancel7.c: New file.
2081         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
2082         around gcc defficiencies.
2083         * old_pthread_cond_signal.c: Likewise.
2084         * old_pthread_cond_timedwait.c: Likewise.
2085         * old_pthread_cond_wait.c: Likewise.
2087         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
2089 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
2091         * Makefile (tests): Add tst-cond7.
2092         * tst-cond7.c: New file.
2094         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
2095         (condvar_cleanup): Get condvar address from the right place.
2097         * atomic.h: Correct definitions of atomic_full_barrier,
2098         atomic_read_barrier, atomic_write_barrier.
2100         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
2101         race-free.
2102         * old_pthread_cond_signal.c: Likewise.
2103         * old_pthread_cond_timedwait.c: Likewise.
2104         * old_pthread_cond_wait.c: Likewise.
2106 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
2108         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
2110 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
2112         * pthreadP.h (pthread_cond_2_0_t): New type.
2113         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
2114         Use new type for the 2.0 condvar function prototypes.
2115         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
2116         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
2117         parameter.
2118         * old_pthread_cond_destroy.c: Likewise.
2119         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
2120         * old_pthread_cond_signal.c: Likewise.
2121         * old_pthread_cond_timedwait.c: Likewise.
2122         * old_pthread_cond_wait.c: Likewise.
2124         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
2125         (__pthread_cond_wait): Don't save cancellation mode and seq value
2126         in same location.
2128         * herrno.c (__h_errno_location): Don't define as weak.
2130 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
2132         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
2133         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
2134         and pthread_cond_wait.
2135         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
2136         Renamed to...
2137         (__pthread_cond_broadcast_2_0): ... this.
2138         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
2139         Renamed to...
2140         (__pthread_cond_destroy_2_0): ... this.
2141         * old_pthread_cond_init.c (__old_pthread_cond_init):
2142         Renamed to...
2143         (__pthread_cond_init_2_0): ... this.
2144         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
2145         Renamed to...
2146         (__pthread_cond_signal_2_0): ... this.
2147         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
2148         Renamed to...
2149         (__pthread_cond_wait_2_0): ... this.
2150         * pthread_cond_destroy.c: Include shlib-compat.h.
2151         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
2152         * pthread_cond_init.c: Include shlib-compat.h.
2153         (pthread_cond_init): Change strong_alias into versioned_symbol.
2154         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
2155         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
2156         fields.
2157         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
2158         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
2159         __pthread_cond_wait_2_0): New prototypes.
2160         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
2161         __old_pthread_cond_init, __old_pthread_cond_signal,
2162         __old_pthread_cond_wait): Removed.
2163         * init.c: Include shlib-compat.h.
2164         (pthread_functions): Guard ptr___pthread_attr_init_2_0
2165         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
2166         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
2167         ptr___pthread_cond_*_2_0 fields.
2168         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
2169         pthread_cond_*@GLIBC_2.0 compatibility symbols.
2171         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
2172         LIBC_SIGACTION was not yet defined.
2173         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
2174         [!defined LIBC_SIGACTION] (__sigaction): New function and
2175         libc_hidden_weak.
2176         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
2177         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
2179 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
2181         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
2183 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
2185         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2186         New, larger type definition.
2187         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
2188         implementation.
2189         * Versions [libpthread]: Add definitions for new pthread_cond_*
2190         interfaces for version GLIBC_2.3.2.
2191         * pthread_cond_init.c: Update initialization for new type definition.
2192         * Makefile (libpthread-routines): Remove pthread_cond_wait,
2193         pthread_cond_timedwait, pthread_cond_signal, and
2194         pthread_cond_broadcast.  Add old_pthread_cond_init,
2195         old_pthread_cond_destroy, old_pthread_cond_wait,
2196         old_pthread_cond_timedwait, old_pthread_cond_signal, and
2197         old_pthread_cond_broadcast.
2198         * old_pthread_cond_broadcast.c: New file.
2199         * old_pthread_cond_destroy.c: New file.
2200         * old_pthread_cond_init.c: New file.
2201         * old_pthread_cond_signal.c: New file.
2202         * old_pthread_cond_timedwait.c: New file.
2203         * old_pthread_cond_wait.c: New file.
2204         * pthreadP.h: Add prototypes for the compatibility interfaces.
2206         * pthread_cond_destroy.c: Don't include <errno.h>.
2208 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
2210         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
2211         unnecessary zero offset when addressing MUTEX.
2213 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
2215         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
2216         __register_atfork.
2217         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
2218         for __register_atfork.
2220 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
2222         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
2223         instead of ASSEMBLER test macro.
2225         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
2226         __libc_current_sigrtmax): Add libc_hidden_def.
2228         * sysdeps/pthread/list.h: Remove assert.h include.
2230 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
2232         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
2233         __pthread_initialize_minimal_internal not
2234         __pthread_initialize_minimal.
2236 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
2238         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
2239         __pthread_initialize_minimal as hidden.
2241         * init.c (__pthread_initialize_minimal_internal): Don't mark as
2242         constructor.
2244 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
2246         * Makefile ($(inst_libdir)/libpthread.so): Depend on
2247         $(common-objpfx)format.lds, include that into the output script.
2248         Fix comment.
2249         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
2251 2002-12-28  Andreas Jaeger  <aj@suse.de>
2253         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
2254         nsec resolution changes.
2255         (xstat64_conv): Likewise.
2256         (xstat32_conv): Likewise.
2257         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
2258         struct kernel_stat.
2259         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
2260         structs stat and stat64.
2261         * time/time.h (__timespec_defined): Define for __USE_MISC.
2262         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
2264 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
2266         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
2267         argument.
2268         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
2269         (pthread_exit): Use strong_alias to avoid warnings.
2270         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
2271         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
2272         ptr___pthread_attr_init_2_*.
2273         * init.c (pthread_functions): Adjust.
2275 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
2277         * forward.c: Make all functions available by default again.  It
2278         caused too much trouble.
2280         * pt-siglongjmp.c: Removed.
2282 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
2284         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
2285         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
2286         * sysdeps/i386/Makefile: New file.
2287         * sysdeps/i386/tcb-offsets.sym: New file.
2288         * sysdeps/pthread/tcb-offsets.h: New file.
2289         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2290         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
2292         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
2293         __register_atfork...
2294         (GLIBC_2.3.2): ...here.
2296 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
2298         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
2299         pthread_attr_setstackaddr with __attribute_deprecated__.
2301 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
2303         * pt-system.c (system): Remove cancellation handling.
2304         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
2305         cancellation routines.
2307 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
2309         * descr.h: Include <dl-sysdep.h>.
2310         (struct pthread): Move header.data.list to the back of the struct.
2311         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
2312         (MULTIPLE_THREADS_OFFSET): Adjust offset.
2313         (SYSINFO_OFFSEET): Likewise.
2315 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
2317         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
2318         Define.
2319         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
2320         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
2321         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
2322         (USE_DL_SYSINFO): Undef.
2324 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
2326         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
2327         $(common-objpfx)libc.so.
2328         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
2329         it is bigger than pipe buffer size even on arches with bigger
2330         page size.
2331         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
2333 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
2335         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
2336         correct errno access for case that USE___THREAD is not defined.
2338 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
2340         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
2341         Patch by Marijn Ros <marijn@mad.scientist.com>.
2343 2002-12-22  Roland McGrath  <roland@redhat.com>
2345         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
2347 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
2349         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
2351 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
2353         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
2354         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
2355         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
2357         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
2358         of int $0x80.
2359         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2360         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
2361         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
2362         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2363         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
2364         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
2365         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
2366         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2368         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
2369         sysenter.
2370         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
2372         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
2374         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
2375         in new TCB.
2376         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
2377         that sysinfo is properly initialized.
2378         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
2379         to 1 only for ld.so.
2381         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
2382         RTLD_CORRECT_DYNAMIC_WEAK.
2384 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
2386         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
2387         Use return 0 as 6th argument to FORWARD4.
2388         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
2390 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
2392         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
2393         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
2394         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
2395         (INIT_SYSINFO): New #define.
2396         (TLS_TP_INIT): Use INIT_SYSINFO.
2397         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2398         At test to make sure SYSINFO_OFFSET value is correct.
2399         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
2401 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
2403         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
2404         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
2405         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
2406         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
2407         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
2408         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
2409         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
2411 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
2413         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
2414         macro instead of using int $0x80 directly.
2416         * sysdeps/pthread/bits/stdio-lock.h: New file.
2417         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
2418         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
2419         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
2420         * Makefile (routines): Add libc-lowlevelmutex.
2422         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
2423         __i686.get_pc_thunk.dx.
2425 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
2427         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
2428         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
2429         ($(objpfx)tst-cancel-wrappers.out): New rule.
2430         * tst-cancel-wrappers.sh: New test.
2431         * tst-locale1.c: Include signal.h.
2432         (uselocale): Test static linking of __libc_current_sigrt*.
2434 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
2436         * Makefile (tests): Add tst-cancel6.
2437         * tst-cancel6.c: New file
2439 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
2441         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2442         Define meaningfully for assembler as well.
2443         * pthreadP.h (struct pthread_functions): Remove
2444         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
2445         and ptr_pthread_attr_init_2_1 fields.
2446         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
2447         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
2448         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
2449         (FORWARD3): Define using FORWARD4.
2450         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
2451         versions.
2452         * pt-system.c: Remove duplicate stdlib.h include.
2454 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
2456         * sem_init.c: Define sem_init@GLIBC_2.0.
2457         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
2458         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
2460         * flockfile.c: Moved to...
2461         * sysdeps/pthread/flockfile.c: ...here.  New file.
2462         * funlockfile.c: Moved to...
2463         * sysdeps/pthread/funlockfile.c: ...here.  New file.
2464         * ftrylockfile.c: Moved to...
2465         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
2467 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
2469         * libc-cancellation.c: Guard both function with
2470         #if !defined NOT_IN_libc.
2471         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
2472         automatically provided pthread wrappers.
2473         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
2474         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
2475         nor in libpthread.
2476         * pt-open.c: Removed.
2477         * pt-fcntl.c: Removed.
2478         * pt-fsync.c: Removed.
2479         * pt-lseek.c: Removed.
2480         * pt-msgrcv.c: Removed.
2481         * pt-msgsnd.c: Removed.
2482         * pt-msync.c: Removed.
2483         * pt-nanosleep.c: Removed.
2484         * pt-open64.c: Removed.
2485         * pt-pause.c: Removed.
2486         * pt-pread.c: Removed.
2487         * pt-pread64.c: Removed.
2488         * pt-pwrite.c: Removed.
2489         * pt-pwrite64.c: Removed.
2490         * pt-read.c: Removed.
2491         * pt-recv.c: Removed.
2492         * pt-recvfrom.c: Removed.
2493         * pt-recvmsg.c: Removed.
2494         * pt-send.c: Removed.
2495         * pt-sendto.c: Removed.
2496         * pt-sigtimedwait.c: Removed.
2497         * pt-sigwait.c: Removed.
2498         * pt-wait.c: Removed.
2499         * pt-waitpid.c: Removed.
2500         * pt-write.c: Removed.
2501         * pt-accept.c: Removed.
2502         * pt-close.c: Removed.
2503         * pt-connect.c: Removed.
2504         * pt-lseek64.c: Removed.
2505         * pt-sendmsg.c: Removed.
2506         * pt-tcdrain.c: Removed.
2508 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
2510         * init.c (__pthread_initialize_minimal_internal): Renamed from
2511         __pthread_initialize_minimal.  Make old name an alias.  This
2512         converts a normal relocation into a relative relocation.
2514         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
2516         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
2517         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
2518         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
2519         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
2520         pt-sigwaitinfo, pt-waitid, and pt-writev.
2521         * pt-creat.c: Removed.
2522         * pt-poll.c: Removed.
2523         * pt-pselect.c: Removed.
2524         * pt-readv.c: Removed.
2525         * pt-select.c: Removed.
2526         * pt-sigpause.c: Removed.
2527         * pt-sigsuspend.c: Removed.
2528         * pt-sigwaitinfo.c: Removed.
2529         * pt-waitid.c: Removed.
2530         * pt-writev.c: Removed.
2532         * init.c (pthread_functions): New variable.
2533         (__pthread_initialize_minimal): Pass pointer to pthread_functions
2534         (or NULL) to __libc_pthread_init.
2535         * forward.c: Rewrite to use __libc:pthread_functions array to get
2536         function addresses.
2537         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
2538         prototype.
2539         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2540         Take new parameter.  Copy content of variable pointed to by it
2541         to __libc_pthread_init.
2543         * pthreadP.h (struct pthread_functions): New type.
2544         (__libc_pthread_init): Declare.
2546         * pthread_attr_destroy.c: Add namespace protected alias.
2547         * pthread_attr_getdetachstate.c: Likewise.
2548         * pthread_attr_getinheritsched.c: Likewise.
2549         * pthread_attr_getschedparam.c: Likewise.
2550         * pthread_attr_getschedpolicy.c: Likewise.
2551         * pthread_attr_getscope.c: Likewise.
2552         * pthread_attr_setdetachstate.c: Likewise.
2553         * pthread_attr_setinheritsched.c: Likewise.
2554         * pthread_attr_setschedparam.c: Likewise.
2555         * pthread_attr_setschedpolicy.c: Likewise.
2556         * pthread_attr_setscope.c: Likewise.
2557         * pthread_cond_broadcast.c: Likewise.
2558         * pthread_cond_destroy.c: Likewise.
2559         * pthread_cond_init.c: Likewise.
2560         * pthread_cond_signal.c: Likewise.
2561         * pthread_cond_wait.c: Likewise.
2562         * pthread_condattr_destroy.c: Likewise.
2563         * pthread_condattr_init.c: Likewise.
2564         * pthread_equal.c: Likewise.
2565         * pthread_exit.c: Likewise.
2566         * pthread_getschedparam.c: Likewise.
2567         * pthread_self.c: Likewise.
2568         * pthread_setcancelstate.c: Likewise.
2569         * pthread_setschedparam.c: Likewise.
2570         * pthread_mutex_destroy.c: Likewise.
2571         * pthread_mutex_init.c: Likewise.
2572         * pthreadP.h: Add prototypes for the aliases.
2574         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
2575         multiple_threads member in correct TCB to 1.
2577         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
2578         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
2579         member of thread decriptor, otherwise return unconditionally 1.
2581 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
2583         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
2584         regular Linux version.  Remove file.
2585         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
2586         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
2587         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
2588         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
2589         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
2590         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
2591         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
2592         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
2593         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
2594         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
2595         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
2596         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
2597         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
2598         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
2599         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
2600         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
2601         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
2602         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
2603         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
2604         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
2605         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
2606         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
2607         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
2608         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
2609         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
2610         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
2611         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
2612         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
2613         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
2614         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
2616 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
2618         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
2619         * sysdeps/unix/sysv/linux/open.c: Removed.
2620         * sysdeps/unix/sysv/linux/fsync.c: Removed.
2621         * sysdeps/unix/sysv/linux/lseek.c: Removed.
2622         * sysdeps/unix/sysv/linux/msync.c: Removed.
2623         * sysdeps/unix/sysv/linux/read.c: Removed.
2624         * sysdeps/unix/sysv/linux/close.c: Removed.
2625         * sysdeps/unix/sysv/linux/creat.c: Removed.
2626         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
2627         * sysdeps/unix/sysv/linux/pause.c: Removed.
2628         * sysdeps/unix/sysv/linux/select.c: Removed.
2629         * sysdeps/unix/sysv/linux/write.c: Removed.
2631 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
2633         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
2634         element in TCB to see whether locking is needed.
2636         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
2637         MULTIPLE_THREADS_OFFSET value is correct.
2639         * sysdeps/unix/sysv/linux/close.c: New file.
2640         * sysdeps/unix/sysv/linux/connect.S: New file.
2641         * sysdeps/unix/sysv/linux/creat.c: New file.
2642         * sysdeps/unix/sysv/linux/fsync.c: New file.
2643         * sysdeps/unix/sysv/linux/llseek.c: New file.
2644         * sysdeps/unix/sysv/linux/lseek.c: New file.
2645         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
2646         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
2647         * sysdeps/unix/sysv/linux/msync.c: New file.
2648         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
2649         * sysdeps/unix/sysv/linux/open.c: New file.
2650         * sysdeps/unix/sysv/linux/open64.c: New file.
2651         * sysdeps/unix/sysv/linux/pause.c: New file.
2652         * sysdeps/unix/sysv/linux/poll.c: New file.
2653         * sysdeps/unix/sysv/linux/pread.c: New file.
2654         * sysdeps/unix/sysv/linux/pread64.c: New file.
2655         * sysdeps/unix/sysv/linux/pselect.c: New file.
2656         * sysdeps/unix/sysv/linux/pwrite.c: New file.
2657         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
2658         * sysdeps/unix/sysv/linux/readv.c: New file.
2659         * sysdeps/unix/sysv/linux/recv.S: New file.
2660         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
2661         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
2662         * sysdeps/unix/sysv/linux/select.c: New file.
2663         * sysdeps/unix/sysv/linux/send.S: New file.
2664         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
2665         * sysdeps/unix/sysv/linux/sendto.S: New file.
2666         * sysdeps/unix/sysv/linux/sigpause.c: New file.
2667         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
2668         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
2669         * sysdeps/unix/sysv/linux/sigwait.c: New file.
2670         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
2671         * sysdeps/unix/sysv/linux/system.c: New file.
2672         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
2673         * sysdeps/unix/sysv/linux/wait.c: New file.
2674         * sysdeps/unix/sysv/linux/waitid.c: New file.
2675         * sysdeps/unix/sysv/linux/waitpid.c: New file.
2676         * sysdeps/unix/sysv/linux/writev.c: New file.
2677         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
2679         * pt-readv.c: Fix comment.
2681 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
2683         * tst-cleanup1.c: Include stdlib.h.
2685         * tst-cancel5.c: New test.
2686         * Makefile (tests): Add tst-cancel5.
2687         (tst-cancel5): Link against libc.so libpthread.so in that order.
2689 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
2691         * forward.c (test_loaded): Prevent recursive calls.
2693         * Makefile (routines): Add libc-cancellation.
2694         * libc-cancellation.c: New file.
2695         * descr.h (struct pthread): Add multiple_threads field.
2696         * allocatestack.c (allocate_stack): Initialize multiple_header field of
2697         new thread descriptor to 1.
2698         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
2699         Initialize multiple_thread field after successful thread creation.
2700         * cancellation.c (__do_cancel): Move to pthreadP.h.
2701         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
2702         (__pthread_disable_asynccancel): Add internal_function attribute.
2703         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
2704         * pthread_setcancelstate.c: Likewise.
2705         * pthread_setcanceltype.c: Likewise.
2706         * pthread_exit.c: Likewise.
2707         * pthreadP.h (CANCELLATION_P): Likewise.
2708         (__do_cancel): Define as static inline.
2709         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
2710         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
2711         declarations.
2712         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
2713         fields.  Define MULTIPLE_THREADS_OFFSET.
2714         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
2715         declaration.
2716         * sysdeps/unix/sysv/linux/accept.S: New file.
2717         * sysdeps/unix/sysv/linux/read.c: New file.
2718         * sysdeps/unix/sysv/linux/write.c: New file.
2719         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
2720         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
2721         initialization of __libc_locking_needed.
2722         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
2723         __libc_locking_needed, use multiple_threads field in TCB.
2724         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2726 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
2728         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
2729         version.
2730         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
2732         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
2733         access to __libc_locking_needed for PIC.
2735 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
2737         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
2738         declare for libc.so.
2739         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
2740         expression.
2741         (__libc_lock_lock): Put into statement expression.
2742         (__libc_lock_unlock): Remove trailing semicolon.
2743         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
2745 2002-12-12  Roland McGrath  <roland@redhat.com>
2747         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
2748         "m" constraint to refer to __libc_locking_needed.  Declare it here.
2750 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
2752         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
2753         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
2754         Initialize __libc_locking_needed.
2755         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
2756         instead of __register_pthread_fork_handler.
2757         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
2758         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
2759         fork-gen with libc_pthread_init.
2760         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
2761         of __register_pthread_fork_handler.
2762         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
2763         of __register_pthread_fork_handler.
2764         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
2765         __libc_locking_needed to determine whether lock prefix can be avoided.
2766         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2768 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
2770         * Makefile (tests): Add tst-cleanup1.
2771         * tst-cleanup1.c: New file.
2772         * cancellation.c (__cleanup_thread): Removed.
2773         (__do_cancel): Remove call to __cleanup_thread.
2774         * pthreadP.h: Remove __cleanup_thread prorotype.
2776         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
2777         Remember function and argument even if cancellation handler
2778         function is not available.
2779         (__libc_cleanup_region_end): Execute registered function directly if
2780         pthread functions are not available.
2781         (__libc_cleanup_end): Likewise.
2783         * init.c (__pthread_initialize_minimal): Fix initialization in
2784         static lib by preventing gcc from being too clever.
2786 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
2788         * init.c (__pthread_initialize_minimal): Remove unneccesary
2789         sigaddset call.
2791         * Makefile (tests): We can run tst-locale2 now.
2793 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
2795         * Versions: Remove duplicated sigwait entry.
2797 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
2799         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
2800         inside libpthread.
2802         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
2804         * pthreadP.h: Declare __pthread_enable_asynccancel and
2805         __pthread_disable_asynccancel.
2806         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
2807         (CANCEL_RESET): Use __pthread_disable_asynccancel.
2808         * cancellation.c (__pthread_enable_asynccancel): New function.
2809         (__pthread_disable_asynccancel): New function.
2810         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
2811         * pt-close.c: Likewise.
2812         * pt-connect.c: Likewise.
2813         * pt-creat.c: Likewise.
2814         * pt-fcntl.c: Likewise.
2815         * pt-fsync.c: Likewise.
2816         * pt-lseek.c: Likewise.
2817         * pt-lseek64.c: Likewise.
2818         * pt-msgrcv.c: Likewise.
2819         * pt-msgsnd.c: Likewise.
2820         * pt-msync.c: Likewise.
2821         * pt-nanosleep.c: Likewise.
2822         * pt-open.c: Likewise.
2823         * pt-open64.c: Likewise.
2824         * pt-pause.c: Likewise.
2825         * pt-poll.c: Likewise.
2826         * pt-pread.c: Likewise.
2827         * pt-pread64.c: Likewise.
2828         * pt-pselect.c: Likewise.
2829         * pt-pwrite.c: Likewise.
2830         * pt-pwrite64.c: Likewise.
2831         * pt-read.c: Likewise.
2832         * pt-readv.c: Likewise.
2833         * pt-recv.c: Likewise.
2834         * pt-recvfrom.c: Likewise.
2835         * pt-recvmsg.c: Likewise.
2836         * pt-select.c: Likewise.
2837         * pt-send.c: Likewise.
2838         * pt-sendmsg.c: Likewise.
2839         * pt-sendto.c: Likewise.
2840         * pt-sigpause.c: Likewise.
2841         * pt-sigsuspend.c: Likewise.
2842         * pt-sigtimedwait.c: Likewise.
2843         * pt-sigwait.c: Likewise.
2844         * pt-sigwaitinfo.c: Likewise.
2845         * pt-system.c: Likewise.
2846         * pt-tcdrain.c: Likewise.
2847         * pt-wait.c: Likewise.
2848         * pt-waitid.c: Likewise.
2849         * pt-waitpid.c: Likewise.
2850         * pt-write.c: Likewise.
2851         * pt-writev.c: Likewise.
2852         * pthread_join.c: Likewise.
2853         * pthread_timedjoin.c: Likewise.
2855         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
2856         (__xpg_sigpause): New function.
2857         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
2859 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
2861         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
2863         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
2864         _GI_pthread_cleanup_pop to pthreadP.h.
2866         * ftrylockfile.c: Use _IO_lock_trylock instead of
2867         pthread_mutex_trylock.
2869         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
2870         (CANCEL_RESET): Likewise.
2871         (__pthread_setcanceltype_): Declare.
2872         (__pthread_mutex_lock_internal): Declare.
2873         (__pthread_mutex_unlock_internal): Declare.
2874         (__pthread_once_internal): Declare.
2875         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
2876         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
2878         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
2879         and pthread_mutex_unlock.
2880         * pthread_cond_wait.c: Likewise.
2881         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
2882         * pthread_mutex_unlock.c: Likewise.
2884         * pthread_setcanceltype.c: Add additional alias
2885         __pthread_setcanceltype.
2887         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
2888         * sem_open.c (sem_open): Likewise.
2889         Use __libc_open, __libc_write, and __libc_close instead of
2890         open, write, and close respectively.
2892         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
2893         Rewrite as statement expression since it must return a value.
2895         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
2896         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
2897         __pthread_kill.
2899         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
2900         alias __pthread_once_internal.
2902         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
2904 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
2906         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
2907         * tst-stdio1.c: New file.
2908         * tst-stdio2.c: New file.
2910         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
2912         * Makefile (tests): Comment out tst-locale2 for now.
2913         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
2915         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
2916         -D_IO_MTSAFE_IO.
2917         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
2918         Use _IO_lock_init instead of explicit assignment.
2920         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
2921         Define __libc_lock_* and __libc_lock_recursive macros with
2922         lowlevellock macros, not pthread mutexes.
2924         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
2925         of pthread_mutex_lock.
2926         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
2927         instead of pthread_mutex_unlock.
2929 2002-12-06  Roland McGrath  <roland@redhat.com>
2931         * allocatestack.c (__stack_user): Use uninitialized defn.
2932         * init.c (__pthread_initialize_minimal): Initialize it here.
2934 2002-12-05  Roland McGrath  <roland@redhat.com>
2936         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
2937         string.
2938         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
2940         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
2941         missing & here too.
2943 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
2945         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
2946         lowlevellock.
2947         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
2948         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
2949         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
2950         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
2951         for __libc_lock_* macros.
2952         * Makefile (routines): Add libc-lowlevellock.
2954 2002-10-09  Roland McGrath  <roland@redhat.com>
2956         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
2957         Under [__PIC__], call the function via the pointer fetched for
2958         comparison rather than a call by name that uses the PLT.
2959         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
2960         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
2961         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
2962         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
2963         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
2965 2002-12-04  Roland McGrath  <roland@redhat.com>
2967         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
2969         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
2970         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
2972         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
2974 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
2976         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
2977         a completely opaque, non-integer type.
2978         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2980 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
2982         * sysdeps/i386/tls.h: Include stdlib.h.
2983         * sysdeps/x86_64/tls.h: Likewise.
2985 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
2987         * Makefile (tests): Add tst-locale2.
2988         (tests-static): Likewise.
2989         * tst-locale2.c: New file.
2991         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
2992         volatile and add memory clobbers to lock operations.
2994 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
2996         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
2997         * sysdeps/i386/i486/bits/atomic.h: New file.
2998         * sysdeps/i386/i586/bits/atomic.h: New file.
2999         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
3000         include i486 version.
3001         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
3002         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
3003         Patch by Marijn Ros <marijn@mad.scientist.com>.
3005         * allocatestack.c (get_cached_stack): Don't crash if we first
3006         found a stack with a larger size then needed.
3007         Reported by Hui Huang <hui.huang@sun.com>.
3009         * Makefile (tests): Add tst-sysconf.
3010         * tst-sysconf.c: New file.
3012         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
3013         PTHREAD_THREADS_MAX.
3015 2002-12-02  Roland McGrath  <roland@redhat.com>
3017         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
3018         Declare using hidden_proto instead of attribute_hidden, so there are
3019         non-.hidden static symbols for gdb to find.
3020         (__pthread_keys): Likewise.
3021         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
3022         * allocatestack.c (__stack_user): Likewise.
3023         * pthread_create.c (__pthread_keys): Likewise.
3024         (__nptl_threads_events, __nptl_last_event): Make these static instead
3025         of hidden.
3026         * pthread_key_create.c (__pthread_pthread_keys_max,
3027         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
3029 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
3031         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
3032         statically.
3033         * tst-locale1.c: New file.
3035         * pthread_cond_timedwait.c: Include <stdlib.h>.
3037         * Makefile (tests): Add tst-fork2 and tst-fork3.
3038         * tst-fork2.c: New file.
3039         * tst-fork3.c: New file.
3041 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
3043         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
3045         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
3046         require it to 200112L.
3048         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
3049         instruction only if HAVE_CMOV is defined.
3050         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
3052         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
3054         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
3056         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
3058         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
3060 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
3062         * sysdeps/x86_64/bits/atomic.h: New file.
3064         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
3065         16-bit operations.
3067         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
3068         possible since gettid cannot fail.
3070         * sysdeps/x86_64/pthreaddef.h: New file.
3072         * sysdeps/i386/pthreaddef.h (gettid): Removed.
3074         * sysdeps/x86_64/pthread_spin_init.c: New file.
3075         * sysdeps/x86_64/pthread_spin_lock.c: New file.
3076         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
3077         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
3079         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
3080         Add missing lock prefix.  Minute optimization.
3082         * tst-spin2.c (main): Also check successful trylock call.
3084         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
3085         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
3087         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
3088         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
3090         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
3091         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
3092         value in case of an error.  Add support for INTERNAL_SYSCALL.
3094         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
3095         value in case of an error.
3097         * sysdeps/x86_64/tls.h: New file.
3099 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
3101         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
3102         takes the array member name and the index as parameters.
3103         (THREAD_SETMEM_NC): Likewise.
3104         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
3105         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
3106         interfaces.
3108         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
3109         to decide which code to use.
3110         (THREAD_SETMEM_NC): Likewise.
3112         * allocatestack.c (queue_stack): Don't remove stack from list here.
3113         Do it in the caller.  Correct condition to prematurely terminate
3114         loop to free stacks.
3115         (__deallocate_stack): Remove stack from list here.
3117 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
3119         * Makefile (tests): Add tst-stack1.
3120         * tst-stack1.c: New file.
3122         * allocatestack.c (allocate_stack): Initialize the TCB on a user
3123         provided stack.
3125         * pthread_attr_getstack.c: Return bottom of the thread area.
3127 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
3129         * Makefile (libpthread-routines): Add pt-allocrtsig and
3130         pthread_kill_other_threads.
3131         * pt-allocrtsig.c: New file.
3132         * pthread_kill_other_threads.c: New file.
3133         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
3134         all three functions.
3135         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
3136         allocrtsig.
3137         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
3138         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
3139         and __libc_allocate_rtsig_private.
3140         * Versions (libpthread): Export pthread_kill_other_threads_np,
3141         __libc_current_sigrtmin, and __libc_current_sigrtmax.
3143 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
3145         * allocatestack.c (allocate_stack): stackaddr in attribute points to
3146         the end of the stack.  Adjust computations.
3147         When mprotect call fails dequeue stack and free it.
3148         * pthread_attr_setstack.c: Store top of the stack in stackaddr
3149         attribute.
3150         * pthread_getattr_np.c: Likewise.
3152         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
3153         surprises.
3155 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
3157         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
3158         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
3160 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
3162         * pthread_getspecific.c: Optimize access to first 2nd-level array.
3163         * pthread_setspecific.c: Likewise.
3165 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
3167         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
3168         definitions.  Get them from the official place.
3169         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
3171         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
3172         Use new CLONE_ flags in clone() calls.
3174         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
3175         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
3177         * Versions: Add pthread_* functions for libc.
3178         * forward.c: New file.
3180         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
3181         errno-loc.
3182         * herrno.c: New file.
3183         * res.c: New file.
3185         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
3186         sem_trywait, and sem_timedwait.  Add herrno and res.
3187         * sem_init.c: Don't initialize lock and waiters members.
3188         * sem_open.c: Likewise.
3189         * sem_post.c: Removed.
3190         * sem_wait.c: Removed.
3191         * sem_trywait.c: Removed.
3192         * sem_timedwait.c: Removed.
3193         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
3194         Includes full implementations of sem_post, sem_wait, sem_trywait,
3195         and sem_timedwait.
3196         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
3197         for new implementation.
3198         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
3199         and waiters fields.
3201         * tst-sem3.c: Improve error message.
3202         * tst-signal3.c: Likewise.
3204         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
3205         to tell the kernel about the termination futex and to initialize tid
3206         member.  Don't initialize main_thread.
3207         * descr.h (struct pthread): Remove main_thread member.
3208         * cancelllation.c (__do_cancel): Remove code handling main thread.
3209         The main thread is not special anymore.
3211         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
3212         size of the stacks to stack_cache_actsize.
3214         * pt-readv.c: Add missing "defined".
3215         * pt-sigwait.c: Likewise.
3216         * pt-writev.c: Likewise.
3218 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
3220         * Versions: Export __connect from libpthread.
3221         Patch by Luca Barbieri <ldb@ldb.ods.org>.
3223         * Makefile (libpthread-routines): Add pt-raise.
3224         * sysdeps/unix/sysv/linux/raise.c: New file.
3225         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
3226         * sysdeps/generic/pt-raise.c: New file.
3228         * pthread_cond_init.c: Initialize all data elements of the condvar
3229         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
3231         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
3232         * pthread_create.c: Likewise.
3234         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
3235         * tst-key1.c: New file.
3236         * tst-key2.c: New file.
3237         * tst-key3.c: New file.
3239         * Versions: Export pthread_detach for version GLIBC_2.0.
3240         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
3242 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
3244         * pthread_key_create.c: Terminate search after an unused key was found.
3245         Patch by Luca Barbieri <ldb@ldb.ods.org>.
3247         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
3248         Patch by Luca Barbieri <ldb@ldb.ods.org>.
3250 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
3252         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
3253         dynamic lookup for errno in PIC.
3255         * allocatestack.c (get_cached_stack): Rearrange code slightly to
3256         release the stack lock as soon as possible.
3257         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
3258         the static TLS block.
3259         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
3261         * cancellation.c: Renamed from cancelation.c.
3262         * Makefile: Adjust accordingly.
3263         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
3264         * cleanup_defer.c: Use CANCELLATION_P.
3265         * pthread_testcancel.c: Likewise.
3266         * descr.h: Fix spelling in comments.
3267         * init.c: Likewise.
3268         * pthread_getattr_np.c: Likewise.
3269         * pthread_getschedparam.c: Likewise.
3270         * pthread_setschedparam.c: Likewise.
3271         * Versions: Likewise.
3273         * pt-pselect.c: New file.
3274         * Makefile (libpthread-routines): Add pt-pselect.
3275         * Versions: Add pselect.
3277         * tst-cancel4.c: New file.
3278         * Makefile (tests): Add tst-cancel4.
3280 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
3282         * pthread_mutex_lock.c: Always record lock ownership.
3283         * pthread_mutex_timedlock.c: Likewise.
3284         * pthread_mutex_trylock.c: Likewise.
3286         * pt-readv.c: New file.
3287         * pt-writev.c: New file.
3288         * pt-creat.c: New file.
3289         * pt-msgrcv.c: New file.
3290         * pt-msgsnd.c: New file.
3291         * pt-poll.c: New file.
3292         * pt-select.c: New file.
3293         * pt-sigpause.c: New file.
3294         * pt-sigsuspend.c: New file.
3295         * pt-sigwait.c: New file.
3296         * pt-sigwaitinfo.c: New file.
3297         * pt-waitid.c: New file.
3298         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
3299         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
3300         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
3301         * Versions: Add all the new functions.
3303         * tst-exit1.c: New file.
3304         * Makefile (tests): Add tst-exit1.
3306         * sem_timedwait.c: Minor optimization for more optimal fastpath.
3308 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
3310         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
3312         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
3313         call.  pthread_join is an official cancellation point.
3314         * pthread_timedjoin.c: Likewise.
3316         * pthread_cond_wait.c: Revert order in which internal lock are dropped
3317         and the condvar's mutex are retrieved.
3318         * pthread_cond_timedwait.c: Likewise.
3319         Reported by dice@saros.East.Sun.COM.
3321 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
3323         * pthreadP.h: Cut out all type definitions and move them...
3324         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
3325         * pthreadP.h: Include <internaltypes.h>.
3327         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
3328         performance tweaks.
3330         * sem_trywait.c: Shuffle #includes around to get right order.
3331         * sem_timedwait.c: Likewise.
3332         * sem_post.c: Likewise.
3333         * sem_wait.c: Likewise.
3335         * nptl 0.3 released.
3337         * Makefile (tests): Add tst-signal3.
3338         * tst-signal3.c: New file.
3340 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
3342         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
3343         the asms modify the sem object.
3344         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
3346         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
3347         the actual members.
3348         * pthreadP.h (struct sem): New type.  Actual semaphore type.
3349         * semaphoreP.h: Include pthreadP.h.
3350         * sem_getvalue.c: Adjust to sem_t change.
3351         * sem_init.c: Likewise.
3352         * sem_open.c: Likewise.
3353         * sem_post.c: Likewise.
3354         * sem_timedwait.c: Likewise.
3355         * sem_trywait.c: Likewise.
3356         * sem_wait.c: Likewise.
3358 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
3360         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
3361         * tst-basic2.c: New file.
3362         * tst-exec1.c: New file.
3363         * tst-exec2.c: New file.
3364         * tst-exec3.c: New file.
3366         * tst-fork1.c: Remove extra */.
3368         * nptl 0.2 released.  The API for IA-32 is complete.