Update.
[kopensolaris-gnu/glibc.git] / nptl / ChangeLog
1 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
2
3         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
4         for failed cmpxchg.
5
6         * pthread_create.c (start_thread): Set EXITING_BIT early.
7
8         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
9         (THREAD_GETMEM_NC): Likewise.
10
11 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
12
13         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
14         off 3 more bytes by using offset-less instructions when possible.
15
16         * Makefile: Add dependency for $(objpfx)version.d.
17
18         * eintr.c (eintr_source): Add unnecessary return but the compiler
19         insists.
20
21         * tst-kill3.c: Include <unistd.h>.
22
23 2003-02-21  Roland McGrath  <roland@redhat.com>
24
25         * pthread_create.c (start_thread): Call __libc_thread_freeres.
26
27 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
28
29         * Makefile (tests): Add tst-eintr1.
30         (distribute): Add eintr.c.
31         * tst-eintr1.c: New file.
32         * eintr.c: New file.
33
34         * pthread_cancel.c (pthread_cancel): Use tkill directly.
35
36         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
37         Disallow sending SIGCANCEL.
38
39         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
40         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
41         * tst-kill1.c: New file.
42         * tst-kill2.c: New file.
43         * tst-kill3.c: New file.
44         * tst-kill5.c: New file.
45         * tst-kill6.c: New file.
46         * tst-basic7.c: Renamed to...
47         * tst-kill4.c: ...this.
48
49 2003-02-21  Roland McGrath  <roland@redhat.com>
50
51         * Makefile (install-lib-ldscripts): New variable.
52
53 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
54
55         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
56         * pthread_cancel.c: Use INVALID_TD_P.
57         * pthread_detach.c: Likewise.
58         * pthread_getschedparam.c: Likewise.
59         * pthread_setschedparam.c: Likewise.
60         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
61         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
62         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
63         * pthread_timedjoin.c: Likewise.
64
65         * tst-basic7.c: Include <signal.h>.
66
67         * pthread_join.c (pthread_join): Limited checking for invalid
68         descriptors.
69         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
70
71 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
72
73         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
74         beginning of the loop.  Clear the entire first block of TSD.
75         * Makefile (tests): Add tst-key4.
76         * tst-key4.c: New file.
77
78 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
79
80         * Makefile (tests): Add tst-basic7.
81         * tst-basic7.c: New file.
82
83         * pthread_create.c (deallocate_tsd): Mark as internal_function.
84         Add some more __builtin_expect.
85
86         * pthreadP.h: Define dummy version of DEBUGGING_P.
87
88 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
89
90         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
91         _POSIX_THREAD_PRIORITY_SCHEDULING.
92         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
93         _XOPEN_REALTIME_THREADS.
94         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
95
96         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
97         kernel returns EINVAL for PID <= 0, work around it.
98
99         * Makefile (tests): Add tst-signal5.
100         * tst-signal5.c: New file.
101
102         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
103         and LOGIN_NAME_MAX.
104
105         * tst-cancel1.c (tf): Block all signals.
106
107         * Makefile (tests): Add tst-basic6.
108         * tst-basic6.c: New file.
109
110         * tst-basic1.c: Add test for process ID.
111
112         * Makefile (tests): Add tst-cancel10.
113         * tst-cancel10.c: New file.
114
115         * Makefile (tests): Add tst-signal4.
116         * tst-signal4.c: New file.
117
118         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
119         __sigismember instead of sigismember.  Add __builtin_expect.
120
121 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
122
123         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
124         pthread_setcancelstate, and pthread_rwlock_setpshared.
125
126         * tst-cancel7.c (do_test): Make sure the pid file exists before
127         canceling the thread.
128
129         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
130         pthread_rwlock_timedrdlock tests.
131         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
132         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
133         Check for invalid tv_nsec field.
134         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
135         Likewise.
136
137         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
138         recursive mutex of overflow.
139
140         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
141
142         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
143         going into an endless loop.
144         * Makefile (tests): Add tst-cancel9.
145         * tst-cancel9.c: New file.
146
147         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
148
149 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
150
151         * tst-mutex5.c (do_test): Add more timedlock tests.
152
153         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
154         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
155
156         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
157         use INLINE_SYSCALL.  Error number is returned, not -1.
158
159         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
160         and __deallocate_stack with internal_function.
161         * pthread_create.c: Adjust definitions appropriately.
162         * allocatestack.c: Likewise.
163
164         * pthread_join.c: Add one more __builtin_expect.
165         * pthread_timedjoin.c: Likewise.
166
167         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
168         not data of sequence number does not match.
169         Add one __builtin_expect.
170
171         * Makefile (tests): Add tst-clock1.
172         * tst-clock1.c: New file.
173
174         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
175         negative arguments.
176         * Makefile (tests): Add tst-basic5.
177         * tst-basic5.c: New file.
178
179 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
180
181         * Makefile (tests): Add tst-basic4.
182         * tst-basic4.c: New file.
183
184         * pthreadP.h: Add declaraction for __nptl_nthreads.
185         * pthread_create.c: Define __nptl_nthreads
186         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
187         after thread is done.  If then zero, call exit(0).
188         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
189         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
190         * init.c (pthread_functions): Initialize ptr_nthreads.
191         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
192         (__reclaim_stacks): Decrement __nptl_nthreads.
193         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
194         Define.
195         * Makefile (tests): Add tst-basic3.
196         * tst-basic3.c: New file.
197
198         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
199         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
200         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
201         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
202         if asynchronous canceling is enabled.
203         * pthread_join.c (pthread_join): When recognizing circular joins,
204         take into account the other thread might be already canceled.
205         * Makefile (tests): Add tst-join5.
206         * tst-join5.c: New file.
207
208         * Makefile (tests): Add tst-join4.
209         * tst-join4.c: New file.
210
211 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
212
213         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
214
215 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
216
217         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
218         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
219         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
220         warning.
221         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
222         to avoid warning.
223         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
224         error if lll_futex_wake failed.
225
226 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
227
228         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
229         handling of cancellation and failung pthread_mutex_unlock call.
230         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
231         * Makefile (tests): Add tst-cond8 and tst-cond9.
232         * tst-cond8.c: New file.
233         * tst-cond9.c: New file.
234
235         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
236
237         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
238         non-standard initializers with __USE_GNU.
239
240         * Makefile (tests): Add tst-cleanup3.
241         * tst-cleanup3.c: New file.
242
243 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
244
245         * Makefile (tests): Add tst-attr1 and tst-attr2.
246         * tst-attr1.c: New file.
247         * tst-attr2.c: New file.
248
249         * Makefile: Add rules to build and run tst-atfork2 test.
250         * tst-atfork2.c: New file.
251         * tst-atfork2mod.c: New file.
252
253         * sysdeps/unix/sysv/linux/unregister-atfork.c
254         (__unregister_atfork): Free the memory allocated for the handlers
255         after removing them from the lists.
256
257         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
258         cleanup function.
259
260         * tst-atfork1.c (do_test): Wait for the child we forked.
261         Report error in child.
262
263         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
264
265         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
266
267 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
268
269         * Makefile (tests): Add tst-cancel8.
270         * tst-cancel8.c: New file.
271
272         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
273         clearing of control variable.
274         * Makefile (tests): Add tst-once3 and tst-once4.
275         * tst-once3.c: New file.
276         * tst-once4.c: New file.
277
278 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
279
280         * sysdeps/sh/Makefile: New file.
281         * sysdeps/sh/bits/atomic.h: New file.
282         * sysdeps/sh/pthread_spin_init.c: New file.
283         * sysdeps/sh/pthread_spin_lock.c: New file.
284         * sysdeps/sh/pthread_spin_trylock.S: New file.
285         * sysdeps/sh/pthread_spin_unlock.S: New file.
286         * sysdeps/sh/pthreaddef.h: New file.
287         * sysdeps/sh/tcb-offsets.sym: New file.
288         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
289         * sysdeps/sh/tls.h: New file.
290         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
291         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
292         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
293         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
294         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
295         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
296         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
297         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
298         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
299         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
300         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
301         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
302         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
303         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
304         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
305         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
306         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
307         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
308         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
309         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
310         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
311         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
312         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
313         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
314         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
315         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
316         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
317         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
318         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
319         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
320
321 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
322
323         * tst-cond2.c: Rearrange code to not rely on behavior undefined
324         according to POSIX.
325
326         * tst-basic2.c (do_test): Lock mutex before creating the thread.
327
328 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
329
330         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
331         (TLS_GET_FS): New #define.
332         (TLS_SET_FS): New #define.
333         Correct value of __NR_set_thread_area.
334
335         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
336
337 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
338
339         * Makefile (tests): Add tst-popen1.
340         * tst-popen1.c: New file.
341
342         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
343         but inactive generalization.
344         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
345         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
346         Minor optimization, remove one instruction.
347         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
348
349 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
350
351         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
352
353 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
354
355         * init.c (__NR_set_tid_address): Add #ifdef for s390.
356         * sysdeps/pthread/pthread_barrier_wait.c: New file.
357         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
358         * sysdeps/pthread/pthread_cond_signal.c: New file.
359         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
360         * sysdeps/pthread/pthread_cond_wait.c: New file.
361         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
362         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
363         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
364         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
365         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
366         * sysdeps/s390/Makefile: New file.
367         * sysdeps/s390/bits/atomic.h: New file.
368         * sysdeps/s390/pthread_spin_init.c: New file.
369         * sysdeps/s390/pthread_spin_lock.c: New file.
370         * sysdeps/s390/pthread_spin_trylock.c: New file.
371         * sysdeps/s390/pthread_spin_unlock.c: New file.
372         * sysdeps/s390/pthreaddef.h: New file.
373         * sysdeps/s390/tcb-offsets.sym: New file.
374         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
375         * sysdeps/s390/tls.h: New file.
376         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
377         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
378         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
379         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
380         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
381         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
382         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
383         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
384         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
385         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
386         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
387         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
388         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
389         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
390         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
391         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
392         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
393         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
394         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
395         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
396         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
397         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
398         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
399
400 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
401
402         * atomic.h: Add a couple more default implementations.
403         (atomic_compare_and_exchange_acq): Use
404         __arch_compare_and_exchange_32_acq in return value definition.  It
405         always exists.
406         (atomic_bit_set): Renamed from atomic_set_bit.
407         Add missing atomic_ prefixes.
408
409         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
410         thread library is available, use correct value to mark initialized
411         once variable.
412
413 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
414
415         * allocatestack.c (allocate_stack): Use __getpagesize instead of
416         __sysconf to determine pagesize.
417
418         * pthread_create.c: Include <atomic.h>.
419         * allocatestack.c (allocate_stack): Implement coloring of the
420         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
421         size minus one.  Adjust users.
422         * sysdeps/i386/i686/Makefile: New file.
423
424 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
425
426         * allocatestack.c: Improve comment throughout the file.
427
428         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
429         (__lll_lock_wait): Add branch prediction.
430         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
431         (__lll_lock_wait): Likewise.
432         (lll_unlock_wake_cb): Removed.
433
434 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
435
436         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
437         _POSIX_THREAD_PRIORITY_SCHEDULING.
438
439 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
440
441         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
442         Fix return type of ptr___pthread_getspecific.
443
444 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
445
446         * Makefile (tests): Add tst-umask1.
447         (tst-umask1-ARGS): Define.
448         * tst-umask1.c: New file.
449
450 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
451
452         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
453         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
454         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
455         pthread_rwlock_unlock.
456         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
457         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
458         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
459         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
460         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
461         New file.
462         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
463         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
464         New file.
465         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
466         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
467         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
468         New file.
469         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
470         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
471         New file.
472         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
473         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
474         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
475         New file.
476         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
477         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
478         New file.
479         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
480
481         * Makefile (libpthread-routines): Remove lowlevelcond and
482         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
483         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
484         and pthread_cond_broadcast.
485         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
486         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
487         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
488         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
489         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
490         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
491         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
492         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
493         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
494         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
495         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
496         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
497         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
498         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
499         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
500         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
501         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
502         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
503         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
504         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
505         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
506         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
507         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
508         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
509         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
510         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
511         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
512         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
513         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
514         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
515         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
516
517         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
518         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
519         of the code is moved to ...
520         * sysdeps/pthread/createthread.c: ...here.  New file.
521
522 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
523
524         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
525         (__new_sem_post): Clear %eax before returning.
526         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
527
528         * Makefile (tests): Add tst-cleanup2.
529         * tst-cleanup2.c: New file.
530
531         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
532         Interpret first parameter correctly.
533
534 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
535
536         * Makefile (headers): Add bits/semaphore.h.
537
538 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
539
540         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
541         if not SHARED.
542
543 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
544
545         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
546         must be used and mapping failed.
547         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
548
549         * Makefile (CFLAGS-pthread_self.os): Define this, not
550         CFLAGS-pthread_self.c.
551
552 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
553
554         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
555         lll_unlock_wake_cb.
556
557         * Makefile (libpthread-routines): Add version.  Add rules to build
558         version.os and banner.h.
559         * version.c: New file.
560
561 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
562
563         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
564         the alias unconditional.
565         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
566
567 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
568
569         * Makefile (CFLAGS-pthread_self.c): New definition.
570
571 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
572
573         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
574         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
575         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
576         * init.c (__pthread_initialize_minimal_internal): Likewise.
577
578 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
579
580         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
581
582         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
583         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
584         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
585         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
586         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
587         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
588
589 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
590
591         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
592         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
593         * tst-cancel-wrappers.sh: Remove all exceptions.
594
595 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
596
597         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
598         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
599
600         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
601         Use __libc_pthread_functions array if SHARED.
602
603         * pthreadP.h: Move pthread_cond_2_0_t definition to...
604         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
605
606         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
607         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
608         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
609         __libc_ptf_call instead of __libc_maybe_call.
610         (PTF): New #define.
611         (__libc_cleanup_region_start): Wrap function name with PTF call.
612         (__libc_cleanup_region_end): Likewise.
613         (__libc_cleanup_end): Likewise.
614
615         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
616         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
617         * pthread_key_create.c: Add __pthread_key_create_internal alias.
618         * pthreadP.h: Add prototypes.
619
620         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
621         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
622         __pthread_rwlock_unlock aliases.
623         * pthreadP.h: Add prototypes for new aliases.
624
625         * pthreadP.h (struct pthead_functions): Moved to...
626         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
627         * init.c (pthread_functions): Add initializers for new elements.
628
629         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
630         __pthread_cleanup_pop_restore aliases.
631         * pthreadP.h: Add prototypes.
632
633         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
634         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
635         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
636         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
637         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
638         * pthreadP.h: Adjust prototypes and callers.
639
640 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
641
642         * Makefile (tests): Add tst-cancel7.
643         (tst-cancel7-ARGS): New variable.
644         * tst-cancel7.c: New file.
645
646         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
647         around gcc defficiencies.
648         * old_pthread_cond_signal.c: Likewise.
649         * old_pthread_cond_timedwait.c: Likewise.
650         * old_pthread_cond_wait.c: Likewise.
651
652         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
653
654 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
655
656         * Makefile (tests): Add tst-cond7.
657         * tst-cond7.c: New file.
658
659         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
660         (condvar_cleanup): Get condvar address from the right place.
661
662         * atomic.h: Correct definitions of atomic_full_barrier,
663         atomic_read_barrier, atomic_write_barrier.
664
665         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
666         race-free.
667         * old_pthread_cond_signal.c: Likewise.
668         * old_pthread_cond_timedwait.c: Likewise.
669         * old_pthread_cond_wait.c: Likewise.
670
671 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
672
673         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
674
675 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
676
677         * pthreadP.h (pthread_cond_2_0_t): New type.
678         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
679         Use new type for the 2.0 condvar function prototypes.
680         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
681         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
682         parameter.
683         * old_pthread_cond_destroy.c: Likewise.
684         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
685         * old_pthread_cond_signal.c: Likewise.
686         * old_pthread_cond_timedwait.c: Likewise.
687         * old_pthread_cond_wait.c: Likewise.
688
689         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
690         (__pthread_cond_wait): Don't save cancellation mode and seq value
691         in same location.
692
693         * herrno.c (__h_errno_location): Don't define as weak.
694
695 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
696
697         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
698         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
699         and pthread_cond_wait.
700         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
701         Renamed to...
702         (__pthread_cond_broadcast_2_0): ... this.
703         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
704         Renamed to...
705         (__pthread_cond_destroy_2_0): ... this.
706         * old_pthread_cond_init.c (__old_pthread_cond_init):
707         Renamed to...
708         (__pthread_cond_init_2_0): ... this.
709         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
710         Renamed to...
711         (__pthread_cond_signal_2_0): ... this.
712         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
713         Renamed to...
714         (__pthread_cond_wait_2_0): ... this.
715         * pthread_cond_destroy.c: Include shlib-compat.h.
716         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
717         * pthread_cond_init.c: Include shlib-compat.h.
718         (pthread_cond_init): Change strong_alias into versioned_symbol.
719         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
720         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
721         fields.
722         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
723         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
724         __pthread_cond_wait_2_0): New prototypes.
725         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
726         __old_pthread_cond_init, __old_pthread_cond_signal,
727         __old_pthread_cond_wait): Removed.
728         * init.c: Include shlib-compat.h.
729         (pthread_functions): Guard ptr___pthread_attr_init_2_0
730         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
731         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
732         ptr___pthread_cond_*_2_0 fields.
733         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
734         pthread_cond_*@GLIBC_2.0 compatibility symbols.
735
736         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
737         LIBC_SIGACTION was not yet defined.
738         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
739         [!defined LIBC_SIGACTION] (__sigaction): New function and
740         libc_hidden_weak.
741         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
742         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
743
744 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
745
746         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
747
748 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
749
750         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
751         New, larger type definition.
752         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
753         implementation.
754         * Versions [libpthread]: Add definitions for new pthread_cond_*
755         interfaces for version GLIBC_2.3.2.
756         * pthread_cond_init.c: Update initialization for new type definition.
757         * Makefile (libpthread-routines): Remove pthread_cond_wait,
758         pthread_cond_timedwait, pthread_cond_signal, and
759         pthread_cond_broadcast.  Add old_pthread_cond_init,
760         old_pthread_cond_destroy, old_pthread_cond_wait,
761         old_pthread_cond_timedwait, old_pthread_cond_signal, and
762         old_pthread_cond_broadcast.
763         * old_pthread_cond_broadcast.c: New file.
764         * old_pthread_cond_destroy.c: New file.
765         * old_pthread_cond_init.c: New file.
766         * old_pthread_cond_signal.c: New file.
767         * old_pthread_cond_timedwait.c: New file.
768         * old_pthread_cond_wait.c: New file.
769         * pthreadP.h: Add prototypes for the compatibility interfaces.
770
771         * pthread_cond_destroy.c: Don't include <errno.h>.
772
773 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
774
775         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
776         unnecessary zero offset when addressing MUTEX.
777
778 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
779
780         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
781         __register_atfork.
782         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
783         for __register_atfork.
784
785 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
786
787         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
788         instead of ASSEMBLER test macro.
789
790         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
791         __libc_current_sigrtmax): Add libc_hidden_def.
792
793         * sysdeps/pthread/list.h: Remove assert.h include.
794
795 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
796
797         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
798         __pthread_initialize_minimal_internal not
799         __pthread_initialize_minimal.
800
801 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
802
803         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
804         __pthread_initialize_minimal as hidden.
805
806         * init.c (__pthread_initialize_minimal_internal): Don't mark as
807         constructor.
808
809 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
810
811         * Makefile ($(inst_libdir)/libpthread.so): Depend on
812         $(common-objpfx)format.lds, include that into the output script.
813         Fix comment.
814         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
815
816 2002-12-28  Andreas Jaeger  <aj@suse.de>
817
818         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
819         nsec resolution changes.
820         (xstat64_conv): Likewise.
821         (xstat32_conv): Likewise.
822         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
823         struct kernel_stat.
824         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
825         structs stat and stat64.
826         * time/time.h (__timespec_defined): Define for __USE_MISC.
827         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
828
829 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
830
831         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
832         argument.
833         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
834         (pthread_exit): Use strong_alias to avoid warnings.
835         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
836         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
837         ptr___pthread_attr_init_2_*.
838         * init.c (pthread_functions): Adjust.
839
840 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
841
842         * forward.c: Make all functions available by default again.  It
843         caused too much trouble.
844
845         * pt-siglongjmp.c: Removed.
846
847 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
848
849         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
850         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
851         * sysdeps/i386/Makefile: New file.
852         * sysdeps/i386/tcb-offsets.sym: New file.
853         * sysdeps/pthread/tcb-offsets.h: New file.
854         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
855         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
856
857         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
858         __register_atfork...
859         (GLIBC_2.3.2): ...here.
860
861 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
862
863         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
864         pthread_attr_setstackaddr with __attribute_deprecated__.
865
866 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
867
868         * pt-system.c (system): Remove cancellation handling.
869         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
870         cancellation routines.
871
872 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
873
874         * descr.h: Include <dl-sysdep.h>.
875         (struct pthread): Move header.data.list to the back of the struct.
876         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
877         (MULTIPLE_THREADS_OFFSET): Adjust offset.
878         (SYSINFO_OFFSEET): Likewise.
879
880 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
881
882         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
883         Define.
884         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
885         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
886         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
887         (USE_DL_SYSINFO): Undef.
888
889 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
890
891         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
892         $(common-objpfx)libc.so.
893         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
894         it is bigger than pipe buffer size even on arches with bigger
895         page size.
896         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
897
898 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
899
900         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
901         correct errno access for case that USE___THREAD is not defined.
902
903 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
904
905         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
906         Patch by Marijn Ros <marijn@mad.scientist.com>.
907
908 2002-12-22  Roland McGrath  <roland@redhat.com>
909
910         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
911
912 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
913
914         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
915
916 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
917
918         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
919         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
920         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
921
922         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
923         of int $0x80.
924         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
925         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
926         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
927         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
928         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
929         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
930         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
931         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
932
933         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
934         sysenter.
935         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
936
937         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
938
939         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
940         in new TCB.
941         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
942         that sysinfo is properly initialized.
943         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
944         to 1 only for ld.so.
945
946         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
947         RTLD_CORRECT_DYNAMIC_WEAK.
948
949 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
950
951         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
952         Use return 0 as 6th argument to FORWARD4.
953         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
954
955 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
956
957         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
958         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
959         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
960         (INIT_SYSINFO): New #define.
961         (TLS_TP_INIT): Use INIT_SYSINFO.
962         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
963         At test to make sure SYSINFO_OFFSET value is correct.
964         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
965
966 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
967
968         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
969         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
970         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
971         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
972         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
973         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
974         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
975
976 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
977
978         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
979         macro instead of using int $0x80 directly.
980
981         * sysdeps/pthread/bits/stdio-lock.h: New file.
982         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
983         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
984         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
985         * Makefile (routines): Add libc-lowlevelmutex.
986
987         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
988         __i686.get_pc_thunk.dx.
989
990 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
991
992         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
993         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
994         ($(objpfx)tst-cancel-wrappers.out): New rule.
995         * tst-cancel-wrappers.sh: New test.
996         * tst-locale1.c: Include signal.h.
997         (uselocale): Test static linking of __libc_current_sigrt*.
998
999 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
1000
1001         * Makefile (tests): Add tst-cancel6.
1002         * tst-cancel6.c: New file
1003
1004 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
1005
1006         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
1007         Define meaningfully for assembler as well.
1008         * pthreadP.h (struct pthread_functions): Remove
1009         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
1010         and ptr_pthread_attr_init_2_1 fields.
1011         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
1012         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
1013         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
1014         (FORWARD3): Define using FORWARD4.
1015         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
1016         versions.
1017         * pt-system.c: Remove duplicate stdlib.h include.
1018
1019 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
1020
1021         * sem_init.c: Define sem_init@GLIBC_2.0.
1022         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
1023         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
1024
1025         * flockfile.c: Moved to...
1026         * sysdeps/pthread/flockfile.c: ...here.  New file.
1027         * funlockfile.c: Moved to...
1028         * sysdeps/pthread/funlockfile.c: ...here.  New file.
1029         * ftrylockfile.c: Moved to...
1030         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
1031
1032 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
1033
1034         * libc-cancellation.c: Guard both function with
1035         #if !defined NOT_IN_libc.
1036         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
1037         automatically provided pthread wrappers.
1038         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
1039         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
1040         nor in libpthread.
1041         * pt-open.c: Removed.
1042         * pt-fcntl.c: Removed.
1043         * pt-fsync.c: Removed.
1044         * pt-lseek.c: Removed.
1045         * pt-msgrcv.c: Removed.
1046         * pt-msgsnd.c: Removed.
1047         * pt-msync.c: Removed.
1048         * pt-nanosleep.c: Removed.
1049         * pt-open64.c: Removed.
1050         * pt-pause.c: Removed.
1051         * pt-pread.c: Removed.
1052         * pt-pread64.c: Removed.
1053         * pt-pwrite.c: Removed.
1054         * pt-pwrite64.c: Removed.
1055         * pt-read.c: Removed.
1056         * pt-recv.c: Removed.
1057         * pt-recvfrom.c: Removed.
1058         * pt-recvmsg.c: Removed.
1059         * pt-send.c: Removed.
1060         * pt-sendto.c: Removed.
1061         * pt-sigtimedwait.c: Removed.
1062         * pt-sigwait.c: Removed.
1063         * pt-wait.c: Removed.
1064         * pt-waitpid.c: Removed.
1065         * pt-write.c: Removed.
1066         * pt-accept.c: Removed.
1067         * pt-close.c: Removed.
1068         * pt-connect.c: Removed.
1069         * pt-lseek64.c: Removed.
1070         * pt-sendmsg.c: Removed.
1071         * pt-tcdrain.c: Removed.
1072
1073 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
1074
1075         * init.c (__pthread_initialize_minimal_internal): Renamed from
1076         __pthread_initialize_minimal.  Make old name an alias.  This
1077         converts a normal relocation into a relative relocation.
1078
1079         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
1080
1081         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
1082         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
1083         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
1084         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
1085         pt-sigwaitinfo, pt-waitid, and pt-writev.
1086         * pt-creat.c: Removed.
1087         * pt-poll.c: Removed.
1088         * pt-pselect.c: Removed.
1089         * pt-readv.c: Removed.
1090         * pt-select.c: Removed.
1091         * pt-sigpause.c: Removed.
1092         * pt-sigsuspend.c: Removed.
1093         * pt-sigwaitinfo.c: Removed.
1094         * pt-waitid.c: Removed.
1095         * pt-writev.c: Removed.
1096
1097         * init.c (pthread_functions): New variable.
1098         (__pthread_initialize_minimal): Pass pointer to pthread_functions
1099         (or NULL) to __libc_pthread_init.
1100         * forward.c: Rewrite to use __libc:pthread_functions array to get
1101         function addresses.
1102         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
1103         prototype.
1104         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1105         Take new parameter.  Copy content of variable pointed to by it
1106         to __libc_pthread_init.
1107
1108         * pthreadP.h (struct pthread_functions): New type.
1109         (__libc_pthread_init): Declare.
1110
1111         * pthread_attr_destroy.c: Add namespace protected alias.
1112         * pthread_attr_getdetachstate.c: Likewise.
1113         * pthread_attr_getinheritsched.c: Likewise.
1114         * pthread_attr_getschedparam.c: Likewise.
1115         * pthread_attr_getschedpolicy.c: Likewise.
1116         * pthread_attr_getscope.c: Likewise.
1117         * pthread_attr_setdetachstate.c: Likewise.
1118         * pthread_attr_setinheritsched.c: Likewise.
1119         * pthread_attr_setschedparam.c: Likewise.
1120         * pthread_attr_setschedpolicy.c: Likewise.
1121         * pthread_attr_setscope.c: Likewise.
1122         * pthread_cond_broadcast.c: Likewise.
1123         * pthread_cond_destroy.c: Likewise.
1124         * pthread_cond_init.c: Likewise.
1125         * pthread_cond_signal.c: Likewise.
1126         * pthread_cond_wait.c: Likewise.
1127         * pthread_condattr_destroy.c: Likewise.
1128         * pthread_condattr_init.c: Likewise.
1129         * pthread_equal.c: Likewise.
1130         * pthread_exit.c: Likewise.
1131         * pthread_getschedparam.c: Likewise.
1132         * pthread_self.c: Likewise.
1133         * pthread_setcancelstate.c: Likewise.
1134         * pthread_setschedparam.c: Likewise.
1135         * pthread_mutex_destroy.c: Likewise.
1136         * pthread_mutex_init.c: Likewise.
1137         * pthreadP.h: Add prototypes for the aliases.
1138
1139         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
1140         multiple_threads member in correct TCB to 1.
1141
1142         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
1143         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
1144         member of thread decriptor, otherwise return unconditionally 1.
1145
1146 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
1147
1148         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
1149         regular Linux version.  Remove file.
1150         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
1151         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
1152         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
1153         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
1154         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
1155         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
1156         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
1157         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
1158         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
1159         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
1160         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
1161         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
1162         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
1163         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
1164         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
1165         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
1166         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
1167         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
1168         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
1169         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
1170         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
1171         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
1172         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
1173         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
1174         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
1175         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
1176         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
1177         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
1178         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
1179         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
1180
1181 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
1182
1183         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
1184         * sysdeps/unix/sysv/linux/open.c: Removed.
1185         * sysdeps/unix/sysv/linux/fsync.c: Removed.
1186         * sysdeps/unix/sysv/linux/lseek.c: Removed.
1187         * sysdeps/unix/sysv/linux/msync.c: Removed.
1188         * sysdeps/unix/sysv/linux/read.c: Removed.
1189         * sysdeps/unix/sysv/linux/close.c: Removed.
1190         * sysdeps/unix/sysv/linux/creat.c: Removed.
1191         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
1192         * sysdeps/unix/sysv/linux/pause.c: Removed.
1193         * sysdeps/unix/sysv/linux/select.c: Removed.
1194         * sysdeps/unix/sysv/linux/write.c: Removed.
1195
1196 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
1197
1198         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
1199         element in TCB to see whether locking is needed.
1200
1201         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
1202         MULTIPLE_THREADS_OFFSET value is correct.
1203
1204         * sysdeps/unix/sysv/linux/close.c: New file.
1205         * sysdeps/unix/sysv/linux/connect.S: New file.
1206         * sysdeps/unix/sysv/linux/creat.c: New file.
1207         * sysdeps/unix/sysv/linux/fsync.c: New file.
1208         * sysdeps/unix/sysv/linux/llseek.c: New file.
1209         * sysdeps/unix/sysv/linux/lseek.c: New file.
1210         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
1211         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
1212         * sysdeps/unix/sysv/linux/msync.c: New file.
1213         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
1214         * sysdeps/unix/sysv/linux/open.c: New file.
1215         * sysdeps/unix/sysv/linux/open64.c: New file.
1216         * sysdeps/unix/sysv/linux/pause.c: New file.
1217         * sysdeps/unix/sysv/linux/poll.c: New file.
1218         * sysdeps/unix/sysv/linux/pread.c: New file.
1219         * sysdeps/unix/sysv/linux/pread64.c: New file.
1220         * sysdeps/unix/sysv/linux/pselect.c: New file.
1221         * sysdeps/unix/sysv/linux/pwrite.c: New file.
1222         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
1223         * sysdeps/unix/sysv/linux/readv.c: New file.
1224         * sysdeps/unix/sysv/linux/recv.S: New file.
1225         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
1226         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
1227         * sysdeps/unix/sysv/linux/select.c: New file.
1228         * sysdeps/unix/sysv/linux/send.S: New file.
1229         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
1230         * sysdeps/unix/sysv/linux/sendto.S: New file.
1231         * sysdeps/unix/sysv/linux/sigpause.c: New file.
1232         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
1233         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
1234         * sysdeps/unix/sysv/linux/sigwait.c: New file.
1235         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
1236         * sysdeps/unix/sysv/linux/system.c: New file.
1237         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
1238         * sysdeps/unix/sysv/linux/wait.c: New file.
1239         * sysdeps/unix/sysv/linux/waitid.c: New file.
1240         * sysdeps/unix/sysv/linux/waitpid.c: New file.
1241         * sysdeps/unix/sysv/linux/writev.c: New file.
1242         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
1243
1244         * pt-readv.c: Fix comment.
1245
1246 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
1247
1248         * tst-cleanup1.c: Include stdlib.h.
1249
1250         * tst-cancel5.c: New test.
1251         * Makefile (tests): Add tst-cancel5.
1252         (tst-cancel5): Link against libc.so libpthread.so in that order.
1253
1254 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
1255
1256         * forward.c (test_loaded): Prevent recursive calls.
1257
1258         * Makefile (routines): Add libc-cancellation.
1259         * libc-cancellation.c: New file.
1260         * descr.h (struct pthread): Add multiple_threads field.
1261         * allocatestack.c (allocate_stack): Initialize multiple_header field of
1262         new thread descriptor to 1.
1263         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
1264         Initialize multiple_thread field after successful thread creation.
1265         * cancellation.c (__do_cancel): Move to pthreadP.h.
1266         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
1267         (__pthread_disable_asynccancel): Add internal_function attribute.
1268         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
1269         * pthread_setcancelstate.c: Likewise.
1270         * pthread_setcanceltype.c: Likewise.
1271         * pthread_exit.c: Likewise.
1272         * pthreadP.h (CANCELLATION_P): Likewise.
1273         (__do_cancel): Define as static inline.
1274         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
1275         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
1276         declarations.
1277         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
1278         fields.  Define MULTIPLE_THREADS_OFFSET.
1279         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
1280         declaration.
1281         * sysdeps/unix/sysv/linux/accept.S: New file.
1282         * sysdeps/unix/sysv/linux/read.c: New file.
1283         * sysdeps/unix/sysv/linux/write.c: New file.
1284         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
1285         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
1286         initialization of __libc_locking_needed.
1287         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
1288         __libc_locking_needed, use multiple_threads field in TCB.
1289         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
1290
1291 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
1292
1293         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
1294         version.
1295         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
1296
1297         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
1298         access to __libc_locking_needed for PIC.
1299
1300 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
1301
1302         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
1303         declare for libc.so.
1304         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
1305         expression.
1306         (__libc_lock_lock): Put into statement expression.
1307         (__libc_lock_unlock): Remove trailing semicolon.
1308         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
1309
1310 2002-12-12  Roland McGrath  <roland@redhat.com>
1311
1312         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
1313         "m" constraint to refer to __libc_locking_needed.  Declare it here.
1314
1315 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
1316
1317         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
1318         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
1319         Initialize __libc_locking_needed.
1320         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
1321         instead of __register_pthread_fork_handler.
1322         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
1323         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
1324         fork-gen with libc_pthread_init.
1325         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
1326         of __register_pthread_fork_handler.
1327         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
1328         of __register_pthread_fork_handler.
1329         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
1330         __libc_locking_needed to determine whether lock prefix can be avoided.
1331         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
1332
1333 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
1334
1335         * Makefile (tests): Add tst-cleanup1.
1336         * tst-cleanup1.c: New file.
1337         * cancellation.c (__cleanup_thread): Removed.
1338         (__do_cancel): Remove call to __cleanup_thread.
1339         * pthreadP.h: Remove __cleanup_thread prorotype.
1340
1341         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
1342         Remember function and argument even if cancellation handler
1343         function is not available.
1344         (__libc_cleanup_region_end): Execute registered function directly if
1345         pthread functions are not available.
1346         (__libc_cleanup_end): Likewise.
1347
1348         * init.c (__pthread_initialize_minimal): Fix initialization in
1349         static lib by preventing gcc from being too clever.
1350
1351 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
1352
1353         * init.c (__pthread_initialize_minimal): Remove unneccesary
1354         sigaddset call.
1355
1356         * Makefile (tests): We can run tst-locale2 now.
1357
1358 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
1359
1360         * Versions: Remove duplicated sigwait entry.
1361
1362 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
1363
1364         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
1365         inside libpthread.
1366
1367         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
1368
1369         * pthreadP.h: Declare __pthread_enable_asynccancel and
1370         __pthread_disable_asynccancel.
1371         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
1372         (CANCEL_RESET): Use __pthread_disable_asynccancel.
1373         * cancellation.c (__pthread_enable_asynccancel): New function.
1374         (__pthread_disable_asynccancel): New function.
1375         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
1376         * pt-close.c: Likewise.
1377         * pt-connect.c: Likewise.
1378         * pt-creat.c: Likewise.
1379         * pt-fcntl.c: Likewise.
1380         * pt-fsync.c: Likewise.
1381         * pt-lseek.c: Likewise.
1382         * pt-lseek64.c: Likewise.
1383         * pt-msgrcv.c: Likewise.
1384         * pt-msgsnd.c: Likewise.
1385         * pt-msync.c: Likewise.
1386         * pt-nanosleep.c: Likewise.
1387         * pt-open.c: Likewise.
1388         * pt-open64.c: Likewise.
1389         * pt-pause.c: Likewise.
1390         * pt-poll.c: Likewise.
1391         * pt-pread.c: Likewise.
1392         * pt-pread64.c: Likewise.
1393         * pt-pselect.c: Likewise.
1394         * pt-pwrite.c: Likewise.
1395         * pt-pwrite64.c: Likewise.
1396         * pt-read.c: Likewise.
1397         * pt-readv.c: Likewise.
1398         * pt-recv.c: Likewise.
1399         * pt-recvfrom.c: Likewise.
1400         * pt-recvmsg.c: Likewise.
1401         * pt-select.c: Likewise.
1402         * pt-send.c: Likewise.
1403         * pt-sendmsg.c: Likewise.
1404         * pt-sendto.c: Likewise.
1405         * pt-sigpause.c: Likewise.
1406         * pt-sigsuspend.c: Likewise.
1407         * pt-sigtimedwait.c: Likewise.
1408         * pt-sigwait.c: Likewise.
1409         * pt-sigwaitinfo.c: Likewise.
1410         * pt-system.c: Likewise.
1411         * pt-tcdrain.c: Likewise.
1412         * pt-wait.c: Likewise.
1413         * pt-waitid.c: Likewise.
1414         * pt-waitpid.c: Likewise.
1415         * pt-write.c: Likewise.
1416         * pt-writev.c: Likewise.
1417         * pthread_join.c: Likewise.
1418         * pthread_timedjoin.c: Likewise.
1419
1420         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
1421         (__xpg_sigpause): New function.
1422         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
1423
1424 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
1425
1426         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
1427
1428         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
1429         _GI_pthread_cleanup_pop to pthreadP.h.
1430
1431         * ftrylockfile.c: Use _IO_lock_trylock instead of
1432         pthread_mutex_trylock.
1433
1434         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
1435         (CANCEL_RESET): Likewise.
1436         (__pthread_setcanceltype_): Declare.
1437         (__pthread_mutex_lock_internal): Declare.
1438         (__pthread_mutex_unlock_internal): Declare.
1439         (__pthread_once_internal): Declare.
1440         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
1441         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
1442
1443         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
1444         and pthread_mutex_unlock.
1445         * pthread_cond_wait.c: Likewise.
1446         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
1447         * pthread_mutex_unlock.c: Likewise.
1448
1449         * pthread_setcanceltype.c: Add additional alias
1450         __pthread_setcanceltype.
1451
1452         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
1453         * sem_open.c (sem_open): Likewise.
1454         Use __libc_open, __libc_write, and __libc_close instead of
1455         open, write, and close respectively.
1456
1457         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
1458         Rewrite as statement expression since it must return a value.
1459
1460         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
1461         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
1462         __pthread_kill.
1463
1464         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
1465         alias __pthread_once_internal.
1466
1467         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
1468
1469 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
1470
1471         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
1472         * tst-stdio1.c: New file.
1473         * tst-stdio2.c: New file.
1474
1475         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
1476
1477         * Makefile (tests): Comment out tst-locale2 for now.
1478         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
1479
1480         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
1481         -D_IO_MTSAFE_IO.
1482         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
1483         Use _IO_lock_init instead of explicit assignment.
1484
1485         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
1486         Define __libc_lock_* and __libc_lock_recursive macros with
1487         lowlevellock macros, not pthread mutexes.
1488
1489         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
1490         of pthread_mutex_lock.
1491         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
1492         instead of pthread_mutex_unlock.
1493
1494 2002-12-06  Roland McGrath  <roland@redhat.com>
1495
1496         * allocatestack.c (__stack_user): Use uninitialized defn.
1497         * init.c (__pthread_initialize_minimal): Initialize it here.
1498
1499 2002-12-05  Roland McGrath  <roland@redhat.com>
1500
1501         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
1502         string.
1503         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
1504
1505         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
1506         missing & here too.
1507
1508 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
1509
1510         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
1511         lowlevellock.
1512         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
1513         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
1514         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
1515         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
1516         for __libc_lock_* macros.
1517         * Makefile (routines): Add libc-lowlevellock.
1518
1519 2002-10-09  Roland McGrath  <roland@redhat.com>
1520
1521         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
1522         Under [__PIC__], call the function via the pointer fetched for
1523         comparison rather than a call by name that uses the PLT.
1524         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
1525         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
1526         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
1527         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
1528         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
1529
1530 2002-12-04  Roland McGrath  <roland@redhat.com>
1531
1532         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
1533
1534         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
1535         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
1536
1537         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
1538
1539 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
1540
1541         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
1542         a completely opaque, non-integer type.
1543         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1544
1545 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
1546
1547         * sysdeps/i386/tls.h: Include stdlib.h.
1548         * sysdeps/x86_64/tls.h: Likewise.
1549
1550 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
1551
1552         * Makefile (tests): Add tst-locale2.
1553         (tests-static): Likewise.
1554         * tst-locale2.c: New file.
1555
1556         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
1557         volatile and add memory clobbers to lock operations.
1558
1559 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
1560
1561         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
1562         * sysdeps/i386/i486/bits/atomic.h: New file.
1563         * sysdeps/i386/i586/bits/atomic.h: New file.
1564         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
1565         include i486 version.
1566         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
1567         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
1568         Patch by Marijn Ros <marijn@mad.scientist.com>.
1569
1570         * allocatestack.c (get_cached_stack): Don't crash if we first
1571         found a stack with a larger size then needed.
1572         Reported by Hui Huang <hui.huang@sun.com>.
1573
1574         * Makefile (tests): Add tst-sysconf.
1575         * tst-sysconf.c: New file.
1576
1577         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
1578         PTHREAD_THREADS_MAX.
1579
1580 2002-12-02  Roland McGrath  <roland@redhat.com>
1581
1582         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
1583         Declare using hidden_proto instead of attribute_hidden, so there are
1584         non-.hidden static symbols for gdb to find.
1585         (__pthread_keys): Likewise.
1586         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
1587         * allocatestack.c (__stack_user): Likewise.
1588         * pthread_create.c (__pthread_keys): Likewise.
1589         (__nptl_threads_events, __nptl_last_event): Make these static instead
1590         of hidden.
1591         * pthread_key_create.c (__pthread_pthread_keys_max,
1592         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
1593
1594 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
1595
1596         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
1597         statically.
1598         * tst-locale1.c: New file.
1599
1600         * pthread_cond_timedwait.c: Include <stdlib.h>.
1601
1602         * Makefile (tests): Add tst-fork2 and tst-fork3.
1603         * tst-fork2.c: New file.
1604         * tst-fork3.c: New file.
1605
1606 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
1607
1608         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
1609
1610         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
1611         require it to 200112L.
1612
1613         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
1614         instruction only if HAVE_CMOV is defined.
1615         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
1616
1617         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
1618
1619         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
1620
1621         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
1622
1623         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
1624
1625 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
1626
1627         * sysdeps/x86_64/bits/atomic.h: New file.
1628
1629         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
1630         16-bit operations.
1631
1632         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
1633         possible since gettid cannot fail.
1634
1635         * sysdeps/x86_64/pthreaddef.h: New file.
1636
1637         * sysdeps/i386/pthreaddef.h (gettid): Removed.
1638
1639         * sysdeps/x86_64/pthread_spin_init.c: New file.
1640         * sysdeps/x86_64/pthread_spin_lock.c: New file.
1641         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
1642         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
1643
1644         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
1645         Add missing lock prefix.  Minute optimization.
1646
1647         * tst-spin2.c (main): Also check successful trylock call.
1648
1649         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
1650         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
1651
1652         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
1653         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
1654
1655         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
1656         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
1657         value in case of an error.  Add support for INTERNAL_SYSCALL.
1658
1659         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
1660         value in case of an error.
1661
1662         * sysdeps/x86_64/tls.h: New file.
1663
1664 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
1665
1666         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
1667         takes the array member name and the index as parameters.
1668         (THREAD_SETMEM_NC): Likewise.
1669         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
1670         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
1671         interfaces.
1672
1673         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
1674         to decide which code to use.
1675         (THREAD_SETMEM_NC): Likewise.
1676
1677         * allocatestack.c (queue_stack): Don't remove stack from list here.
1678         Do it in the caller.  Correct condition to prematurely terminate
1679         loop to free stacks.
1680         (__deallocate_stack): Remove stack from list here.
1681
1682 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
1683
1684         * Makefile (tests): Add tst-stack1.
1685         * tst-stack1.c: New file.
1686
1687         * allocatestack.c (allocate_stack): Initialize the TCB on a user
1688         provided stack.
1689
1690         * pthread_attr_getstack.c: Return bottom of the thread area.
1691
1692 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
1693
1694         * Makefile (libpthread-routines): Add pt-allocrtsig and
1695         pthread_kill_other_threads.
1696         * pt-allocrtsig.c: New file.
1697         * pthread_kill_other_threads.c: New file.
1698         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
1699         all three functions.
1700         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
1701         allocrtsig.
1702         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
1703         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
1704         and __libc_allocate_rtsig_private.
1705         * Versions (libpthread): Export pthread_kill_other_threads_np,
1706         __libc_current_sigrtmin, and __libc_current_sigrtmax.
1707
1708 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
1709
1710         * allocatestack.c (allocate_stack): stackaddr in attribute points to
1711         the end of the stack.  Adjust computations.
1712         When mprotect call fails dequeue stack and free it.
1713         * pthread_attr_setstack.c: Store top of the stack in stackaddr
1714         attribute.
1715         * pthread_getattr_np.c: Likewise.
1716
1717         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
1718         surprises.
1719
1720 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
1721
1722         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
1723         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
1724
1725 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
1726
1727         * pthread_getspecific.c: Optimize access to first 2nd-level array.
1728         * pthread_setspecific.c: Likewise.
1729
1730 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
1731
1732         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
1733         definitions.  Get them from the official place.
1734         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
1735
1736         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
1737         Use new CLONE_ flags in clone() calls.
1738
1739         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
1740         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
1741
1742         * Versions: Add pthread_* functions for libc.
1743         * forward.c: New file.
1744
1745         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
1746         errno-loc.
1747         * herrno.c: New file.
1748         * res.c: New file.
1749
1750         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
1751         sem_trywait, and sem_timedwait.  Add herrno and res.
1752         * sem_init.c: Don't initialize lock and waiters members.
1753         * sem_open.c: Likewise.
1754         * sem_post.c: Removed.
1755         * sem_wait.c: Removed.
1756         * sem_trywait.c: Removed.
1757         * sem_timedwait.c: Removed.
1758         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
1759         Includes full implementations of sem_post, sem_wait, sem_trywait,
1760         and sem_timedwait.
1761         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
1762         for new implementation.
1763         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
1764         and waiters fields.
1765
1766         * tst-sem3.c: Improve error message.
1767         * tst-signal3.c: Likewise.
1768
1769         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
1770         to tell the kernel about the termination futex and to initialize tid
1771         member.  Don't initialize main_thread.
1772         * descr.h (struct pthread): Remove main_thread member.
1773         * cancelllation.c (__do_cancel): Remove code handling main thread.
1774         The main thread is not special anymore.
1775
1776         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
1777         size of the stacks to stack_cache_actsize.
1778
1779         * pt-readv.c: Add missing "defined".
1780         * pt-sigwait.c: Likewise.
1781         * pt-writev.c: Likewise.
1782
1783 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
1784
1785         * Versions: Export __connect from libpthread.
1786         Patch by Luca Barbieri <ldb@ldb.ods.org>.
1787
1788         * Makefile (libpthread-routines): Add pt-raise.
1789         * sysdeps/unix/sysv/linux/raise.c: New file.
1790         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
1791         * sysdeps/generic/pt-raise.c: New file.
1792
1793         * pthread_cond_init.c: Initialize all data elements of the condvar
1794         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
1795
1796         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
1797         * pthread_create.c: Likewise.
1798
1799         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
1800         * tst-key1.c: New file.
1801         * tst-key2.c: New file.
1802         * tst-key3.c: New file.
1803
1804         * Versions: Export pthread_detach for version GLIBC_2.0.
1805         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
1806
1807 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
1808
1809         * pthread_key_create.c: Terminate search after an unused key was found.
1810         Patch by Luca Barbieri <ldb@ldb.ods.org>.
1811
1812         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
1813         Patch by Luca Barbieri <ldb@ldb.ods.org>.
1814
1815 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
1816
1817         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
1818         dynamic lookup for errno in PIC.
1819
1820         * allocatestack.c (get_cached_stack): Rearrange code slightly to
1821         release the stack lock as soon as possible.
1822         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
1823         the static TLS block.
1824         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
1825
1826         * cancellation.c: Renamed from cancelation.c.
1827         * Makefile: Adjust accordingly.
1828         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
1829         * cleanup_defer.c: Use CANCELLATION_P.
1830         * pthread_testcancel.c: Likewise.
1831         * descr.h: Fix spelling in comments.
1832         * init.c: Likewise.
1833         * pthread_getattr_np.c: Likewise.
1834         * pthread_getschedparam.c: Likewise.
1835         * pthread_setschedparam.c: Likewise.
1836         * Versions: Likewise.
1837
1838         * pt-pselect.c: New file.
1839         * Makefile (libpthread-routines): Add pt-pselect.
1840         * Versions: Add pselect.
1841
1842         * tst-cancel4.c: New file.
1843         * Makefile (tests): Add tst-cancel4.
1844
1845 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
1846
1847         * pthread_mutex_lock.c: Always record lock ownership.
1848         * pthread_mutex_timedlock.c: Likewise.
1849         * pthread_mutex_trylock.c: Likewise.
1850
1851         * pt-readv.c: New file.
1852         * pt-writev.c: New file.
1853         * pt-creat.c: New file.
1854         * pt-msgrcv.c: New file.
1855         * pt-msgsnd.c: New file.
1856         * pt-poll.c: New file.
1857         * pt-select.c: New file.
1858         * pt-sigpause.c: New file.
1859         * pt-sigsuspend.c: New file.
1860         * pt-sigwait.c: New file.
1861         * pt-sigwaitinfo.c: New file.
1862         * pt-waitid.c: New file.
1863         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
1864         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
1865         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
1866         * Versions: Add all the new functions.
1867
1868         * tst-exit1.c: New file.
1869         * Makefile (tests): Add tst-exit1.
1870
1871         * sem_timedwait.c: Minor optimization for more optimal fastpath.
1872
1873 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
1874
1875         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
1876
1877         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
1878         call.  pthread_join is an official cancellation point.
1879         * pthread_timedjoin.c: Likewise.
1880
1881         * pthread_cond_wait.c: Revert order in which internal lock are dropped
1882         and the condvar's mutex are retrieved.
1883         * pthread_cond_timedwait.c: Likewise.
1884         Reported by dice@saros.East.Sun.COM.
1885
1886 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
1887
1888         * pthreadP.h: Cut out all type definitions and move them...
1889         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
1890         * pthreadP.h: Include <internaltypes.h>.
1891
1892         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
1893         performance tweaks.
1894
1895         * sem_trywait.c: Shuffle #includes around to get right order.
1896         * sem_timedwait.c: Likewise.
1897         * sem_post.c: Likewise.
1898         * sem_wait.c: Likewise.
1899
1900         * nptl 0.3 released.
1901
1902         * Makefile (tests): Add tst-signal3.
1903         * tst-signal3.c: New file.
1904
1905 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
1906
1907         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
1908         the asms modify the sem object.
1909         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
1910
1911         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
1912         the actual members.
1913         * pthreadP.h (struct sem): New type.  Actual semaphore type.
1914         * semaphoreP.h: Include pthreadP.h.
1915         * sem_getvalue.c: Adjust to sem_t change.
1916         * sem_init.c: Likewise.
1917         * sem_open.c: Likewise.
1918         * sem_post.c: Likewise.
1919         * sem_timedwait.c: Likewise.
1920         * sem_trywait.c: Likewise.
1921         * sem_wait.c: Likewise.
1922
1923 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
1924
1925         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
1926         * tst-basic2.c: New file.
1927         * tst-exec1.c: New file.
1928         * tst-exec2.c: New file.
1929         * tst-exec3.c: New file.
1930
1931         * tst-fork1.c: Remove extra */.
1932
1933         * nptl 0.2 released.  The API for IA-32 is complete.