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