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