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