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