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