.
[kopensolaris-gnu/glibc.git] / nptl / ChangeLog
1 2004-03-24  Roland McGrath  <roland@redhat.com>
2
3         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4         constraint instead of "0".
5
6 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
7
8         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
9         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
10
11         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
12         code to avoid warning.
13
14 2004-03-24  Andreas Jaeger  <aj@suse.de>
15
16         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
17         (__pthread_attr_setaffinity_old): Remove const.
18
19 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
20
21         * sysdeps/unix/sysv/linux/smp.h: New file.
22         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
23         * init.c: Define __is_smp.
24         (__pthread_initialize_minimal_internal): Call is_smp_system to
25         initialize __is_smp.
26         * pthreadP.h: Declare __is_smp.
27         Define MAX_ADAPTIVE_COUNT is necessary.
28         * pthread_mutex_init.c: Add comment regarding __spins field.
29         * pthread_mutex_lock.c: Implement adaptive mutex type.
30         * pthread_mutex_timedlock.c: Likewise.
31         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
32         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
33         Add __spins field.
34         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
35         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
36         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
37         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
38         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
39         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
40         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
41         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
42         lll_mutex_cond_trylock.
43         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
44         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
45         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
46         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
47         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
48         Define BUSY_WAIT_NOP.
49         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
50         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
51
52         * tst-mutex5.c: Add support for testing adaptive mutexes.
53         * tst-mutex7.c: Likewise.
54         * tst-mutex5a.c: New file.
55         * tst-mutex7a.c: New file.
56         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
57
58         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
59         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
60         vgettimeofday call might destroy the content.
61
62         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
63         @pause in the loop.
64
65         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
66         No need to restrict type of ret.  Make it int.  Add comment.
67
68         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
69         Remove unnecessary setne instruction.
70
71 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
72
73         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
74         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
75         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
76         If realloc fails, break out of the loop.
77
78 2004-03-20  Andreas Jaeger  <aj@suse.de>
79
80         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
81         (__pthread_setaffinity_old): Fix interface.
82         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
83         (__pthread_getaffinity_old): Likewise.
84
85         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
86         (__pthread_setaffinity_new): Remove duplicate declaration.
87
88 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
89
90         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
91         the return value to a safe register.
92         (CDISABLE): Set the function argument correctly.
93
94 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
95
96         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
97         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
98         Rewrite so that only one locked memory operation per round is needed.
99         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
100         (pthread_barrier_wait): After wakeup, release lock only when the
101         last thread stopped using the barrier object.
102         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
103         (__pthread_cond_wait): Don't store mutex address if the current
104         value is ~0l.  Add correct cleanup support and unwind info.
105         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
106         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
107         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
108         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
109         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
110         Add correct cleanup support and unwind info.
111         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
112         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
113         information for syscall wrappers.
114
115 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
116
117         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
118         cpusetsize field, remove next.
119         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
120         parameter for size of the CPU set.
121         (pthread_setaffinity_np): Likewise.
122         (pthread_attr_getaffinity_np): Likewise.
123         (pthread_attr_setaffinity_np): Likewise.
124         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
125         interface change, keep compatibility code.
126         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
127         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
128         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
129         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
130         __pthread_getaffinity_np.
131         * Versions: Add version for changed interfaces.
132         * tst-attr3.c: Adjust test for interface change.
133         * pthread_getattr_np.c: Query the kernel about the affinity mask with
134         increasing buffer sizes.
135         * pthread_attr_destroy.c: Remove unused list handling.
136         * pthread_attr_init.c: Likewise.
137
138 2004-03-17  Roland McGrath  <roland@redhat.com>
139
140         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
141         first argument to clock_getres so we ever enable kernel timers.
142
143 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
144
145         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
146
147 2004-03-12  Richard Henderson  <rth@redhat.com>
148
149         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
150         oldvalue from CENABLE to CDISABLE.
151
152 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
153
154         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
155         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
156         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
157         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
158
159 2004-03-11  Richard Henderson  <rth@redhat.com>
160
161         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
162         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
163         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
164
165 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
166
167         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
168         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
169         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
170
171 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
172
173         * forward.c (__pthread_cond_broadcast_2_0,
174         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
175         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
176         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
177
178 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
179
180         * sysdeps/sh/tcb-offsets.sym: Add PID.
181         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
182         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
183
184 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
185
186         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
187         include <sysdep-cancel.h>, vfork is no cancellation point.
188         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
189         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
190         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
191
192 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
193
194         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
195         libc_hidden_def.
196         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
197         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
198         Likewise.
199         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
200         Likewise.
201         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
202         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
203         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
204         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
205         of DO_CALL_VIA_BREAK.  Work around a gas problem.
206
207         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
208         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
209         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
210         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
211         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
212         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
213
214         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
215         a local register for saving old PID.  Negate PID in parent upon exit.
216
217         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
218         tcb-offsets.h.
219         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
220         before syscall, set to the old value in the parent afterwards.
221         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
222         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
223         tcb-offsets.h.
224         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
225         before syscall, set to the old value in the parent afterwards.
226         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
227         * sysdeps/s390/tcb-offsets.sym: Add PID.
228
229         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
230         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
231         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
232         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
233         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
234         * sysdeps/sparc/tcb-offsets.sym: Add PID.
235
236 2004-03-10  Andreas Schwab  <schwab@suse.de>
237
238         * sysdeps/ia64/tcb-offsets.sym: Add PID.
239         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
240         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
241
242 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
243
244         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
245         * tst-cancel21.c (do_one_test): Likewise.
246         Reported by Gordon Jin <gordon.jin@intel.com>.
247
248 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
249
250         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
251         if non-zero and set to INT_MIN if zero.
252         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
253         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
254         (SAVE_PID, RESTORE_PID): Define.
255         (__vfork): Use it.
256         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
257         Use relative path to avoid including NPTL i386/vfork.S.
258         (SAVE_PID, RESTORE_PID): Define.
259         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
260         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
261         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
262         tst-vfork2x.
263         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
264         * tst-vfork1.c: New test.
265         * tst-vfork2.c: New test.
266         * tst-vfork1x.c: New test.
267         * tst-vfork2x.c: New test.
268
269 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
270
271         * sysdeps/i386/tcb-offsets.sym: Add PID.
272         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
273         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
274         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
275
276 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
277
278         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
279
280 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
281
282         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
283         _rtld_global_ro.
284
285 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
286
287         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
288         _rtld_global_ro.
289
290         * tst-once4.c: Remove unnecessary macro definition.
291
292         * tst-mutex7.c (do_test): Limit thread stack size.
293         * tst-once2.c (do_test): Likewise.
294         * tst-tls3.c (do_test): Likewise.
295         * tst-tls1.c (do_test): Likewise.
296         * tst-signal3.c (do_test): Likewise.
297         * tst-kill6.c (do_test): Likewise.
298         * tst-key4.c (do_test): Likewise.
299         * tst-join4.c (do_test): Likewise.
300         * tst-fork1.c (do_test): Likewise.
301         * tst-context1.c (do_test): Likewise.
302         * tst-cond2.c (do_test): Likewise.
303         * tst-cond10.c (do_test): Likewise.
304         * tst-clock2.c (do_test): Likewise.
305         * tst-cancel10.c (do_test): Likewise.
306         * tst-basic2.c (do_test): Likewise.
307         * tst-barrier4.c (do_test): Likewise.
308
309 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
310
311         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
312
313 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
314
315         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
316         (__pthread_cond_timedwait): Optimize wakeup test.
317         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
318         (__pthread_cond_wait): Likewise.
319         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
320         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
321         Likewise.
322
323 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
324
325         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
326         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
327         the atomic instruction needed.
328         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
329         (__lll_mutex_lock_wait): Likewise.
330
331 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
332
333         * Makefile (tests): Add tst-cond14 and tst-cond15.
334         * tst-cond14.c: New file.
335         * tst-cond15.c: New file.
336
337 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
338
339         * sysdeps/pthread/createthread.c (create_thread): Remove use of
340         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
341         needs to be implemented differently to be useful.
342
343 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
344
345         * pthread_attr_setschedparam.c: Don't test priority against limits
346         here.  Set ATTR_FLAG_SCHED_SET flag.
347         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
348         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
349         from parent thread to child.  If attribute is used and scheduling
350         parameters are not inherited, copy parameters from attribute or
351         compute them.  Check priority value.
352         * pthread_getschedparam.c: If the parameters aren't known yet get
353         them from the kernel.
354         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
355         ATTR_FLAG_POLICY_SET flag for thread.
356         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
357         and ATTR_FLAG_POLICY_SET.
358
359         * sysdeps/pthread/createthread.c: Use tgkill if possible.
360
361         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
362         fail if stack address hasn't been set.  Just return 0.
363
364 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
365
366         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
367         libpthread for the files in this list.
368         (CFLAGS-tst-unload): Removed.
369         * tst-unload.c (do_test): Don't use complete path for
370         LIBPHREAD_SO.
371
372         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
373         tst-_res1mod2.
374
375 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
376
377         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
378         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
379         operation per round is needed.
380         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
381         (__lll_mutex_lock_wait): Likewise.
382
383 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
384
385         * tst-cancel9.c (cleanup): Don't print to stderr.
386
387 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
388
389         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
390
391 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
392
393         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
394         (__syscall_error_handler2): Call CDISABLE.
395         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
396         (__syscall_error_handler2): Call CDISABLE.
397
398         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
399         Release lock before the loop, don't reacquire it.
400
401         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
402
403 2004-02-19  Andreas Schwab  <schwab@suse.de>
404
405         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
406         Fix last change.
407
408 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
409
410         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
411         (pthread_barrier_wait): After wakeup, release lock only when the
412         last thread stopped using the barrier object.
413         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
414         (pthread_barrier_wait): Likewise.
415         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
416         Likewise.
417         * Makefile (tests): Add tst-barrier4.
418         * tst-barrier4.c: New file.
419
420         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
421         (__pthread_cond_timedwait): Perform timeout test while holding
422         internal lock to prevent wakeup race.
423         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
424         * sysdeps/pthread/pthread_cond_timedwait.c
425         (__pthread_cond_timedwait): Likewise.
426         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
427         (__pthread_cond_timedwait): Likewise.
428
429 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
430
431         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
432         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
433         * Makefile (tests): Add tst-rwlock13.
434         * tst-rwlock13.c: New test.
435
436 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
437
438         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
439         (__condvar_tw_cleanup): Little optimization.
440         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
441
442 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
443
444         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
445         libpthread as "lib" parameter to SHLIB_COMPAT.
446         (__novmx_siglongjmp): Fix typo in function name.
447         (__novmx_longjmp): Fix typo in function name.
448
449 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
450
451         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
452         __builtin_expect.
453
454         * sysdeps/generic/pt-longjmp.c: Moved to...
455         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
456
457 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
458
459         * Makefile (libpthread-routines): Add pt-cleanup.
460         * pt-longjmp.c: Removed.
461         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
462         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
463         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
464         Version longjmp, siglongjmp for GLIBC_2.3.4.
465         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
466
467 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
468
469         * sysdeps/pthread/pthread_cond_timedwait.c
470         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
471         Reuse code.  Add __builtin_expects.
472
473         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
474         (__pthread_cond_timedwait): Get internal lock in case timeout has
475         passed before the futex syscall.
476         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
477
478 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
479
480         * allocatestack.c: Pretty printing.
481
482         * sysdeps/pthread/createthread.c (create_thread): Don't add
483         CLONE_DETACHED bit if it is not necessary.
484
485 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
486
487         * pthread_getattr_np.c: Include ldsodefs.h.
488
489 2004-01-16  Richard Henderson  <rth@redhat.com>
490
491         * allocatestack.c: Don't declare __libc_stack_end.
492         * init.c (__pthread_initialize_minimal_internal): Likewise.
493         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
494
495 2004-01-15  Richard Henderson  <rth@redhat.com>
496
497         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
498         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
499         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
500         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
501         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
502         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
503         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
504         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
505
506 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
507
508         * init.c (pthread_functions): Make array const.
509
510 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
511
512         * allocatestack.c (__make_stacks_executable): Change interface.
513         Check parameters.  Pass parameter on to libc counterpart.
514         * pthreadP.h: Change declaration.
515
516 2004-01-13  Richard Henderson  <rth@redhat.com>
517
518         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
519         prototype form.
520         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
521         Likewise.
522
523         * sysdeps/alpha/Makefile: New file.
524         * sysdeps/alpha/tcb-offsets.sym: New file.
525         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
526         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
527
528         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
529         on powerpc version.
530
531 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
532
533         * Makefile (tests): Add tst-backtrace1.
534         * tst-backtrace1.c: New test.
535
536 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
537
538         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
539         register as second parameter to the REGISTER macro.
540         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
541         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
542         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
543         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
544         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
545         of thread register as second parameter to REGISTER macro in 64 case.
546
547 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
548
549         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
550         (CFLAGS-getpid.o): Defined.
551         (CFLAGS-getpid.os): Defined.
552
553 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
554
555         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
556         returned for main thread does not overlap with any other VMA.
557         Patch by Jakub Jelinek.
558
559 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
560
561         * tst-raise1.c: Include stdio.h.
562
563 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
564
565         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
566         setting with __ASSUME_TGKILL || defined __NR_tgkill.
567         If pid is 0, set it to selftid.
568         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
569         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
570         != 0, return self->tid without doing a syscall.
571         * descr.h (struct pthread): Move pid field after tid.
572
573         * Makefile (tests): Add tst-raise1.
574         * tst-raise1.c: New file.
575
576 2003-12-23  Roland McGrath  <roland@redhat.com>
577
578         * tst-oddstacklimit.c: New file.
579         * Makefile (tests): Add it.
580         (tst-oddstacklimit-ENV): New variable.
581
582         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
583         value up to page size for __default_stacksize.
584
585 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
586
587         * Makefile (tests): Add tst-eintr5.
588         * tst-eintr5.c: New file.
589
590         * eintr.c (eintr_source): Prevent sending signal to self.
591
592         * tst-eintr2.c (tf1): Improve error message.
593
594 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
595
596         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
597         * sysdeps/unix/sysv/linux/getpid.c: New file.
598         * pthread_cancel.c: Add comment explaining use of PID field.
599         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
600         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
601         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
602         temporarily to signal the field must not be relied on and updated
603         by getpid().
604         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
605         temporarily negative.
606         * sysdeps/unix/sysv/linux/raise.c: Likewise.
607
608 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
609
610         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
611         (eintr_source): If ARG != NULL, use pthread_kill.
612         * tst-eintr1.c: Adjust for this change.
613         * tst-eintr2.c: Likewise.
614         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
615         * tst-eintr3.c: New file.
616         * tst-eintr4.c: New file.
617
618 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
619
620         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
621         if CANCELSTATE_BITMASK is set.
622         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
623         Likewise.
624
625         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
626         (tests-reverse): Add tst-cancel23.
627         * tst-cancel22.c: New test.
628         * tst-cancel23.c: New test.
629
630 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
631
632         * tst-eintr1.c: Better error messages.
633
634         * Makefile (tests): Add tst-eintr2.
635         * tst-eintr2.c: New file.
636
637 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
638
639         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
640         (CFLAGS-tst-cancelx21.c): Set.
641         * tst-cancel21.c: New test.
642         * tst-cancelx21.c: New test.
643
644         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
645         comparison operand.
646         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
647         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
648         * pt-longjmp.c: Include jmpbuf-unwind.h.
649         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
650         _JMPBUF_UNWINDS.  Adjust compared pointers.
651         * init.c (__pthread_initialize_minimal_internal): Initialize
652         pd->stackblock_size.
653         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
654         * sysdeps/alpha/jmpbuf-unwind.h: New file.
655         * sysdeps/i386/jmpbuf-unwind.h: New file.
656         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
657         * sysdeps/s390/jmpbuf-unwind.h: New file.
658         * sysdeps/sh/jmpbuf-unwind.h: New file.
659         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
660         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
661         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
662         (_JMPBUF_CFA_UNWINDS): Remove.
663         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
664
665 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
666
667         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
668         (CFLAGS-tst-cancelx20.c): Set.
669         * tst-cancel20.c: New test.
670         * tst-cancelx20.c: New test.
671
672 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
673
674         * init.c (__pthread_initialize_minimal_internal): Don't treat
675         architectures with separate register stack special here when
676         computing default stack size.
677
678 2003-12-17  Roland McGrath  <roland@redhat.com>
679
680         * Makefile (tst-cancelx7-ARGS): New variable.
681         Reportd by Greg Schafer <gschafer@zip.com.au>.
682
683 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
684
685         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
686         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
687         (tst-stack3-ENV): Set.
688         ($(objpfx)tst-stack3-mem): New.
689         * tst-stack3.c: New test.
690
691 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
692
693         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
694         Add unwind directives.  Drop unused .regstk directive.
695         (_fini_EPILOG_BEGINS): Add unwind directives.
696
697 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
698
699         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
700         Assume parameter is a pointer.
701         (lll_futex_wake): Likewise.
702         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
703         Likewise.
704         (lll_futex_wake): Likewise.
705         Reported by Boris Hu.
706         * sysdeps/unix/sysv/linux/unregister-atfork.c
707         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
708
709         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
710
711 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
712
713         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
714         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
715         __rtld_lock_initialize for ld.so lock.
716         Patch in part by Adam Li <adam.li@intel.com>.
717
718 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
719
720         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
721         in $(gnulib).  Also, remove stale comment.
722
723 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
724
725         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
726         advantage of new syscall stub and optimize accordingly.
727
728         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
729         from SYS_futex, to match expectations of
730         sysdep.h:DO_INLINE_SYSCALL.
731         (lll_futex_clobbers): Remove.
732         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
733         (lll_futex_wake): Likewise.
734         (lll_futex_requeue): Likewise.
735         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
736         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
737         Jelinek).
738         (__lll_mutex_lock): Likewise.
739         (__lll_mutex_cond_lock): Likewise.
740         (__lll_mutex_timed_lock): Likewise.
741         (__lll_mutex_unlock): Likewise.
742         (__lll_mutex_unlock_force): Likewise.
743
744         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
745         comes before the include of <sysdep.h>.
746         (THREAD_SELF_SYSINFO): New macro.
747         (THREAD_SYSINFO): Likewise.
748         (INIT_SYSINFO): New macro.
749         (TLS_INIT_TP): Call INIT_SYSINFO.
750
751         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
752
753         * sysdeps/pthread/createthread.c (create_thread): Use
754         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
755         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
756         THREAD_SELF_SYSINFO instead of open code.
757         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
758         (THREAD_SYSINFO): Likewise.
759
760         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
761
762         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
763
764 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
765
766         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
767         instead of .init.  Patch by David Mosberger.
768
769 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
770
771         * sysdeps/pthread/configure.in: Remove broken declaration in C
772         cleanup handling check.
773
774 2003-11-30  Andreas Jaeger  <aj@suse.de>
775
776         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
777         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
778         Likewise.
779
780 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
781
782         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
783         * pthread_attr_destroy.c: Include shlib-compat.h.
784         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
785         is set in iattr->flags.
786         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
787
788 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
789
790         * Makefile (distribute): Add tst-cleanup4aux.c.
791
792         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
793         include.
794
795 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
796
797         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
798         pthread_cond_signal.
799
800         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
801         store mutex address if the current value is ~0l.
802         * sysdeps/pthread/pthread_cond_timedwait.c
803         (__pthread_cond_timedwait): Likewise.
804         * sysdeps/pthread/pthread_cond_broadcast.c
805         (__pthread_cond_broadcast): Don't use requeue for pshared
806         condvars.
807
808         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
809         (__pthread_cond_wait): Don't store mutex address if the current
810         value is ~0l.
811         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
812         (__pthread_cond_timedwait): Likewise.
813         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
814         (__pthread_cond_broadcast): Don't use requeue for pshared
815         condvars.
816
817         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
818         element with ~0l for pshared condvars, with NULL otherwise.
819
820         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
821         (__pthread_cond_wait): Don't store mutex address if the current
822         value is ~0l.
823         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
824         (__pthread_cond_timedwait): Likewise.
825         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
826         (__pthread_cond_broadcast): Don't use requeue for pshared
827         condvars.
828
829         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
830         * tst-cond12.c: New file.
831         * tst-cond13.c: New file.
832
833 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
834
835         * sysdeps/pthread/configure.in: Make missing forced unwind support
836         fatal.
837
838 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
839
840         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
841
842 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
843
844         * Makefile: Add magic to clean up correctly.
845
846 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
847
848         * unwind.c (FRAME_LEFT): Define.
849         (unwind_stop): Handle old style cleanups here.
850         (__pthread_unwind): Handle old style cleanups only if
851         !HAVE_FORCED_UNWIND.
852         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
853         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
854         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
855         ($(objpfx)tst-cleanupx4): Likewise.
856         * tst-cleanup4.c: New test.
857         * tst-cleanup4aux.c: New.
858         * tst-cleanupx4.c: New test.
859
860 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
861
862         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
863         lll_mutex_*lock macros to skip atomic operations on some archs.
864
865 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
866
867         * sysdeps/pthread/tst-timer.c (main): Initialize
868         sigev2.sigev_value as well.
869
870 2003-10-15  Roland McGrath  <roland@redhat.com>
871
872         * sysdeps/pthread/configure.in: Barf if visibility attribute support
873         is missing.
874         * sysdeps/pthread/configure: Regenerated.
875
876 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
877
878         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
879         locking macros.  No distinction between normal and mutex locking
880         anymore.
881         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
882         Merge bits from lowlevelmutex.S we still need.
883         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
884         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
885         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
886         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
887         new mutex implementation.
888         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
889         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
890         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
891         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
892         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
893         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
894         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
895         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
896         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
897         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
898         symbol for entry point to avoid cancellation.
899
900 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
901
902         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
903         changes.
904         (SAVE_OLDTYPE_0): Fix a typo.
905
906 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
907
908         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
909         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
910
911 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
912
913         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
914         correct offset.
915
916 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
917
918         * Makefile (tests): Add tst-cancel19.
919         * tst-cancel19.c: New test.
920
921 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
922
923         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
924         restoring of the old cancellation type.
925
926 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
927
928         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
929
930 2003-09-27  Wolfram Gloger  <wg@malloc.de>
931
932         * sysdeps/pthread/malloc-machine.h: New file
933
934 2003-09-24  Roland McGrath  <roland@redhat.com>
935
936         * allocatestack.c (__make_stacks_executable): Don't ignore return
937         value from _dl_make_stack_executable.
938
939 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
940
941         * allocatestack.c (__make_stacks_executable): Also change
942         permission of the currently unused stacks.
943
944         * allocatestack.c (change_stack_perm): Split out from
945         __make_stacks_executable.
946         (allocate_stack): If the required permission changed between the time
947         we started preparing the stack and queueing it, change the permission.
948         (__make_stacks_executable): Call change_stack_perm.
949
950         * Makefile: Build tst-execstack-mod locally.
951         * tst-execstack-mod.c: New file.
952
953 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
954
955         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
956
957 2003-09-23  Roland McGrath  <roland@redhat.com>
958
959         * tst-execstack.c: New file.
960         * Makefile (tests): Add it.
961         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
962         (LDFLAGS-tst-execstack): New variable.
963
964         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
965         whether to use PROT_EXEC for stack mmap.
966         (__make_stacks_executable): New function.
967         * pthreadP.h: Declare it.
968         * init.c (__pthread_initialize_minimal_internal): Set
969         GL(dl_make_stack_executable_hook) to that.
970
971 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
972
973         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
974         recommendation from AMD re avoidance of lock prefix.
975
976 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
977
978         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
979         lll_futex_timed_wait instead of lll_futex_wait.
980         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
981         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
982         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
983         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
984         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
985         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
986         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
987         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
988         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
989         Completely revamp the locking macros.  No distinction between
990         normal and mutex locking anymore.
991         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
992         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
993         __lll_lock_timedwait): Fix prototypes.
994         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
995         __lll_lock_timedwait): Likewise.
996         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
997         macros, add __builtin_expect.
998         (lll_mutex_timedlock): Likewise.  Fix return value.
999         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
1000         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
1001         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
1002         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
1003         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
1004         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
1005         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
1006         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
1007
1008 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1009
1010         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1011         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
1012         operation if possible.
1013
1014         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
1015         like jumping over the lock prefix.
1016
1017 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
1018
1019         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
1020         locking macros.  No distinction between normal and mutex locking
1021         anymore.
1022         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1023         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1024         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1025         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
1026         locking.  Merge bits from lowlevelmutex.S we still need.
1027         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1028         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1029         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
1030         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
1031         * Makefile (routines): Remove libc-lowlevelmutex.
1032         (libpthread-rountines): Remove lowlevelmutex.
1033         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
1034         for new mutex implementation.
1035         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1036         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1037         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1038         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1039         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1040         Likewise.
1041         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1042         Likewise.
1043         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1044         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1045         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
1046         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1047         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1048         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1049         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1050         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1051         Likewise.
1052         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1053         Likewise.
1054         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1055         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1056         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1057         Don't use requeue.
1058         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1059         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
1060
1061 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
1062
1063         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
1064         in parameters of asm with output parameters.
1065
1066         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
1067         type of DECR parameter to int.
1068         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
1069
1070 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
1071
1072         * tst-attr3.c (tf, do_test): Print stack start/end/size and
1073         guardsize for each thread.
1074
1075 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1076
1077         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
1078         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1079         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
1080
1081         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1082         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
1083         NULL.
1084         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
1085         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
1086         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1087         (pthread_getaffinity_np): Add hidden_def.
1088
1089         * Makefile (tests): Add tst-attr3.
1090         * tst-attr3.c: New test.
1091
1092         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
1093
1094 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1095
1096         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
1097         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
1098
1099 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1100
1101         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
1102         * tst-align.c: Include tst-stack-align.h.
1103         (tf, do_test): Use TEST_STACK_ALIGN macro.
1104
1105 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
1106
1107         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
1108         variable.
1109
1110 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
1111
1112         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
1113         stack-related values for the initial thread.
1114
1115 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1116
1117         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
1118
1119 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
1120
1121         * pthread_mutex_lock.c: Minor code rearrangements.
1122
1123 2003-09-05  Roland McGrath  <roland@redhat.com>
1124
1125         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
1126         Instead, include ../nptl_db/db_info.c to do its magic.
1127         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
1128         (__pthread_pthread_key_2ndlevel_size): Likewise.
1129         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
1130         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
1131         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
1132         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
1133         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
1134         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
1135         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
1136         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
1137         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
1138         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
1139         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
1140         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
1141         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
1142         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
1143         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
1144         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
1145         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
1146
1147 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
1148
1149         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
1150         of pthread_t to be compatible with LT.
1151         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1152         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1153         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1154         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1155         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1156         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1157         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1158
1159 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
1160
1161         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
1162
1163 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
1164
1165         * unwind-forcedunwind.c: Move to...
1166         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
1167         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
1168         * sysdeps/pthread/jmpbuf-unwind.h: New file.
1169         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
1170         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
1171         * unwind.c: Include jmpbuf-unwind.h.
1172         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
1173
1174 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
1175
1176         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
1177         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
1178         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
1179         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
1180         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
1181         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
1182         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
1183         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
1184         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
1185         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
1186         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
1187         function.
1188         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
1189         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
1190         * Makefile (tests): Add tst-stack2.
1191         * tst-stack2.c: New test.
1192         * tst-stack1.c: Include limits.h and sys/param.h.
1193         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
1194
1195         * pthread_condattr_setpshared.c: Include errno.h.
1196         (pthread_condattr_setpshared): Return EINVAL if pshared
1197         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
1198
1199         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
1200         defined symbol for entry point to avoid cancellation.
1201         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
1202         Likewise.
1203         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1204         Likewise.
1205         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
1206         Likewise.
1207         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
1208         Likewise.
1209         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
1210         Likewise.
1211         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
1212         __close_nocancel, __read_nocancel, __write_nocancel,
1213         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
1214         libpthread.so or librt.so, define to corresponding function
1215         without _nocancel suffix.
1216         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
1217         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
1218         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
1219
1220         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
1221
1222 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
1223
1224         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
1225         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
1226
1227         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
1228         in subsections has a symbol associated with it.
1229
1230         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
1231         defined symbol for entry point to avoid cancellation.
1232         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
1233
1234 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1235
1236         * Makefile (tests): Add tst-tls5.
1237         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
1238         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
1239         ($(objpfx)tst-tls5): New.
1240         ($(objpfx)tst-tls6.out): Likewise.
1241         (tests): Depend on $(objpfx)tst-tls6.out.
1242         * tst-tls3.c: Include stdint.h and pthreaddef.h.
1243         (do_test): Check pthread_self () return value alignment.
1244         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
1245         (tf): Check pthread_self () return value alignment.
1246         * tst-tls5.c: New test.
1247         * tst-tls5.h: New.
1248         * tst-tls5mod.c: New.
1249         * tst-tls5moda.c: New.
1250         * tst-tls5modb.c: New.
1251         * tst-tls5modc.c: New.
1252         * tst-tls5modd.c: New.
1253         * tst-tls5mode.c: New.
1254         * tst-tls5modf.c: New.
1255         * tst-tls6.sh: New test.
1256
1257         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
1258         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
1259         * init.c (pthread_functions): Initialize them.
1260         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
1261         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
1262         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
1263         pthread_cond_timedwait@@GLIBC_2.3.2.
1264
1265 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1266
1267         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
1268         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
1269         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
1270         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
1271         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
1272         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
1273
1274         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
1275
1276         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
1277         _POSIX_THREAD_PRIORITY_SCHEDULING.
1278         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1279
1280 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
1281
1282         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
1283         nested function, use static inline function from libio.h.
1284         Code by Richard Henderson.
1285
1286         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
1287         weak.
1288
1289 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
1290
1291         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
1292         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
1293         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
1294         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
1295         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
1296         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
1297         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
1298         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
1299         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
1300         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
1301         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
1302         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
1303         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
1304         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
1305         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
1306         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
1307         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
1308         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
1309         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
1310         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
1311         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
1312         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
1313         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
1314         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
1315         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
1316         * sysdeps/sparc/tls.h: New file.
1317         * sysdeps/sparc/tcb-offsets.sym: New file.
1318         * sysdeps/sparc/Makefile: New file.
1319         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
1320         * init.c [__sparc__] (__NR_set_tid_address): Define.
1321
1322 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
1323
1324         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
1325         _IO_release_lock): Define.
1326
1327 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
1328
1329         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
1330         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
1331
1332 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
1333
1334         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
1335         (__pthread_cleanup_class): Add missing return types of member
1336         functions.
1337
1338 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
1339
1340         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1341         (lll_mutex_unlock_force): Add memory barrier between store and futex
1342         syscall.
1343
1344 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
1345
1346         * tst-cancel4.c (do_test): Also unlink tempfname and remove
1347         tempmsg in first loop.
1348
1349 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
1350
1351         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1352         _POSIX_THREAD_PRIORITY_SCHEDULING.
1353         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1354
1355 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
1356
1357         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
1358         (__rtld_lock_default_lock_recursive,
1359         __rtld_lock_default_unlock_recursive): Define.
1360         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
1361         __rtld_lock_unlock_recursive): Define using
1362         GL(_dl_rtld_*lock_recursive).
1363         * init.c (__pthread_initialize_minimal_internal): Initialize
1364         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
1365         Lock GL(_dl_load_lock) the same number of times as
1366         GL(_dl_load_lock) using non-mt implementation was nested.
1367
1368         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
1369         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
1370
1371 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
1372
1373         * tst-cancel17.c (do_test): Make len2 maximum of page size and
1374         PIPE_BUF.
1375
1376 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
1377
1378         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
1379
1380 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
1381
1382         * sysdeps/pthread/createthread.c (do_clone): Move error handling
1383         to first syscall error check.  Move syscall error check for tkill
1384         into __ASSUME_CLONE_STOPPED #ifdef.
1385
1386 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
1387
1388         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
1389         is not defined, do explicit synchronization.
1390         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
1391         is not defined also unlock pd->lock for non-debugging case in case
1392         it is necessary.
1393         * pthread_create.c (start_thread): Always get and release pd->lock
1394         if __ASSUME_CLONE_STOPPED is not defined.
1395         (start_thread_debug): Removed.  Adjust users.
1396         * allocatestack.c (allocate_stack): Always initialize lock if
1397         __ASSUME_CLONE_STOPPED is not defined.
1398         * Makefile (tests): Add tst-sched1.
1399         * tst-sched1.c: New file.
1400
1401         * sysdeps/pthread/createthread.c (do_clone): Only use
1402         sched_setschduler and pass correct parameters.
1403
1404 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
1405
1406         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
1407         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
1408         PTHREAD_STACK_MIN in comments.
1409
1410 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
1411
1412         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1413         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
1414         argument.
1415         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
1416         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
1417         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
1418         (__pthread_cleanup_upto): Fix prototype.
1419         (_longjmp_unwind): Adjust caller.
1420         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
1421         Change second argument to const struct pointer.
1422         * tst-sem8.c (main): Remove unused s2 and s3 variables.
1423         * tst-sem9.c (main): Likewise.
1424         * unwind.c: Include string.h for strlen prototype.
1425
1426 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
1427
1428         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1429         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
1430         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
1431         Define HAVE_CMOV.
1432         Patch by Nicholas Miell <nmiell@attbi.com>.
1433
1434 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
1435
1436         * init.c (__pthread_initialize_minimal_internal): Initialize
1437         GL(dl_init_static_tls).
1438         * pthreadP.h (__pthread_init_static_tls): New prototype.
1439         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
1440         New functions.
1441         * Makefile (tests): Add tst-tls4.
1442         (modules-names): Add tst-tls4moda and tst-tls4modb.
1443         ($(objpfx)tst-tls4): Link against libdl and libpthread.
1444         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
1445         tst-tls4modb.so.
1446         * tst-tls4.c: New file.
1447         * tst-tls4moda.c: New file.
1448         * tst-tls4modb.c: New file.
1449
1450 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
1451
1452         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
1453         before __timer_dealloc.
1454         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
1455         Don't call list_unlink.
1456
1457 2003-07-29  Roland McGrath  <roland@redhat.com>
1458
1459         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
1460
1461 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
1462
1463         * tst-cancel17.c (do_test): Check if aio_cancel failed.
1464         Don't reuse struct aiocb A if it failed.
1465         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
1466         not just one byte, as that does not block.
1467
1468 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
1469
1470         * sysdeps/pthread/unwind-resume.c: New file.
1471         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
1472         unwind-resume in csu subdir.
1473         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
1474         exceptions.
1475         (librt-sysdep_routines, librt-shared-only-routines): Add
1476         rt-unwind-resume.
1477         * sysdeps/pthread/rt-unwind-resume.c: New file.
1478         * unwind-forcedunwind.c: New file.
1479         * Makefile (libpthread-routines): Add unwind-forcedunwind.
1480         (libpthread-shared-only-routines): Likewise.
1481         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
1482         * pthreadP.h (pthread_cancel_init): New prototype.
1483         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
1484
1485         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
1486         attr argument const struct pthread_attr *.
1487
1488         * res.c (__res_state): Return __resp.
1489         * descr.h: Include resolv.h.
1490         (struct pthread): Add res field.
1491         * pthread_create.c: Include resolv.h.
1492         (start_thread): Initialize __resp.
1493         * Makefile (tests): Add tst-_res1.
1494         (module-names): Add tst-_res1mod1, tst-_res1mod2.
1495         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
1496         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
1497         libpthread.
1498         * tst-_res1.c: New file.
1499         * tst-_res1mod1.c: New file.
1500         * tst-_res1mod2.c: New file.
1501
1502 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
1503
1504         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
1505
1506         * Makefile: Define various *-no-z-defs variables for test DSOs
1507         which has undefined symbols.
1508
1509 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
1510
1511         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1512         Retry if the stwcx fails to store once_control.
1513
1514 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
1515
1516         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
1517         pthread_attr_setaffinity.
1518         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
1519         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
1520         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
1521         * pthread_attr_destroy.c: Free cpuset element if allocated.
1522         * pthread_create.c: Pass iattr as additional parameter to
1523         create_thread.
1524         * sysdeps/pthread/createthread.c: If attribute is provided and
1525         a new thread is created with affinity set or scheduling parameters,
1526         start thread with CLONE_STOPPED.
1527         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
1528         pthread_attr_setaffinity.
1529         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
1530         cpuset element.
1531
1532 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
1533
1534         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
1535
1536 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
1537
1538         * sysdeps/pthread/configure.in: Require CFI directives also for
1539         ppc and s390.
1540
1541 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
1542
1543         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
1544         Add cfi directives.
1545
1546 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1547
1548         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
1549         CLEANUP_JMP_BUF.
1550         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
1551         registers as variables.  Call __pthread_mutex_unlock_usercnt.
1552         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1553         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
1554         not self pointer in __writer.  Compare with TID to determine
1555         deadlocks.
1556         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1557         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1558         Likewise.
1559         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1560         Likewise.
1561         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
1562         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
1563         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
1564         macros also when compiling librt.
1565
1566 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
1567
1568         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
1569         -fasynchronous-unwind-tables.
1570         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1571         (PSEUDO): Add cfi directives.
1572         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
1573         Likewise.
1574         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
1575         Likewise.
1576
1577 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
1578
1579         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
1580         __pthread_unregister_cancel): Add prototypes and hidden_proto.
1581         * unwind.c (__pthread_unwind_next): Add hidden_def.
1582         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
1583         Likewise.
1584         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
1585         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1586         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1587         Likewise.
1588         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
1589         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1590         Likewise.
1591         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
1592         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
1593         __pthread_unregister_cancel and __pthread_unwind_next.
1594
1595 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1596
1597         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
1598         different symbol for the cancellation syscall wrapper and
1599         non-cancellation syscall wrapper.
1600         (PSEUDO_END): Define.
1601
1602 2003-07-05  Richard Henderson  <rth@redhat.com>
1603
1604         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
1605         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
1606         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
1607         return actual return value from the syscall, not 0.
1608
1609 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
1610
1611         * descr.h (struct pthread): Add pid field.
1612         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
1613         (__reclaim_stacks): Likewise.
1614         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
1615         also check for PID of the signal source.
1616         (__pthread_initialize_minimal_internal): Also initialize pid field
1617         of initial thread's descriptor.
1618         * pthread_cancel.c: Use tgkill instead of tkill if possible.
1619         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1620         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
1621         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1622         * sysdeps/unix/sysv/linux/raise.c: Likewise.
1623
1624 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
1625
1626         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
1627         Fix use of parameter.
1628         (__libc_cleanup_pop): Likewise.
1629
1630 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
1631
1632         * init.c (sigcancel_handler): Change parameters to match handler
1633         for SA_SIGACTION.  Check signal number and code to recognize
1634         invalid invocations.
1635
1636 2003-07-03  Roland McGrath  <roland@redhat.com>
1637
1638         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
1639         Apply sizeof (struct pthread) bias to r13 value.
1640
1641 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
1642
1643         * sysdeps/pthread/configure.in: Require CFI directives.
1644
1645         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
1646         definition.
1647         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
1648         libpthread compilation.
1649         * unwind.c (__pthread_unwind): Add hidden_def.
1650         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
1651
1652 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
1653
1654         * libc-cancellation.c (__libc_cleanup_routine): Define.
1655         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
1656         (__pthread_cleanup_pop): Define.
1657
1658 2003-07-01  Richard Henderson  <rth@redhat.com>
1659
1660         * sysdeps/alpha/elf/pt-initfini.c: New file.
1661         * sysdeps/alpha/pthread_spin_lock.S: New file.
1662         * sysdeps/alpha/pthread_spin_trylock.S: New file.
1663         * sysdeps/alpha/pthreaddef.h: New file.
1664         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
1665         * sysdeps/alpha/tls.h: New file.
1666         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
1667         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
1668         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
1669         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
1670         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
1671         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
1672         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
1673         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
1674         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
1675         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
1676
1677 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
1678
1679         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
1680         cleanup support and unwind info.
1681
1682 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
1683
1684         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
1685         Use correct cleanup handler registration.  Add unwind info.
1686         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
1687         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
1688         * tst-once3.c: Add cleanup handler and check it is called.
1689         * tst-once4.c: Likewise.
1690         * tst-oncex3.c: New file.
1691         * tst-oncex4.c: New file.
1692         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
1693
1694 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
1695
1696         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
1697
1698 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
1699
1700         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
1701         (tf_msgsnd): Likewise.
1702
1703         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
1704         premature returns a bit more.
1705
1706 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
1707
1708         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
1709         definition to the front.
1710
1711         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
1712         the cleanup functions to make the names unique.  Fix dwarf opcode
1713         un unwind table.
1714         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
1715         functions to make the names unique.  Fix CFA offset for two blocks.
1716
1717 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
1718
1719         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
1720         missing closing braces.
1721         Patch by Christophe Saout <christophe@saout.de>.
1722
1723 2003-06-24  Roland McGrath  <roland@redhat.com>
1724
1725         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
1726
1727 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
1728
1729         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
1730         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
1731
1732         * pthreadP.h: Declare __find_thread_by_id.
1733         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
1734         * pthread_clock_gettime.c: Allow using other thread's clock.
1735         * pthread_clock_settime.c: Likewise.
1736         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
1737         * Makefile: Add rules to build and run tst-clock2.
1738         * tst-clock2.c: New file.
1739
1740 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
1741
1742         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
1743         to use exception-based cleanup handler.
1744         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1745
1746         * tst-cond8.c (ch): Announce that we are done.
1747
1748         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
1749
1750         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
1751         Also test aio_suspend with timeout value.
1752
1753 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
1754
1755         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
1756         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
1757         attribute_hidden.
1758
1759         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
1760         (__pthread_mutex_lock_internal): Likewise.
1761         (__pthread_mutex_unlock_internal): Likewise.
1762         (__pthread_mutex_unlock_usercnt): Declare.
1763         * pthread_mutex_destroy.c: Always fail if used in any way.
1764         * pthread_mutex_init.c: Update comment.
1765         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
1766         * pthread_mutex_timedlock.c: Adjust __nusers.
1767         * pthread_mutex_trylock.c: Adjust __nusers.
1768         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
1769         and public interfaces are wrapper with pass additional parameter.
1770         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
1771         parameter zero.
1772         * tst-mutex8.c: New file.
1773         * Makefile (tests): Add tst-mutex8.
1774         * sysdeps/pthread/pthread_cond_timedwait.c: Call
1775         __pthread_mutex_unlock_usercnt.
1776         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1777         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1778         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1779         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1780         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1781         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
1782         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
1783         Add __nusers.
1784         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1785         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1786         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1787         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1788         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1789
1790         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
1791         * pthread_mutex_timedlock.c: Likewise.
1792         * pthread_mutex_trylock.c: Adjust __nusers.
1793         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
1794         * tst-mutex9.c: New file.
1795         * Makefile (tests): Add tst-mutex9.
1796         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
1797         * sysdeps/ia64/tls.h: Likewise.
1798         * sysdeps/powerpc/tls.h: Likewise.
1799         * sysdeps/s390/tls.h: Likewise.
1800         * sysdeps/sh/tls.h: Likewise.
1801         * sysdeps/x86_64/tls.h: Likewise.
1802         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
1803         Change type of __owner.
1804         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1805         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1806         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1807         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1808         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1809
1810 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
1811
1812         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
1813         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
1814
1815         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
1816         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
1817         instead of nr to lll_futex_wake.  Only set errno and return -1
1818         if err < 0.
1819
1820         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
1821         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
1822         return actual return value from the syscall, not 0.
1823
1824 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
1825
1826         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
1827         find a random value.
1828         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
1829         errno==EIDRM.
1830
1831         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
1832         compat_timer_settime.
1833         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
1834         compat_timer_gettime.
1835         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
1836         compat_timer_getoverrun.
1837         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
1838         compat_timer_delete.
1839
1840         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
1841         error-checking mutex detect busy mutexes.
1842
1843 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
1844
1845         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
1846         Add ax to clobber list.
1847         (lll_mutex_cond_lock): Likewise.
1848         (lll_mutex_unlock): Likewise.
1849         (lll_lock): Likewise.
1850         (lll_unlock): Likewise.
1851
1852         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
1853         * tst-cancel18.c: New file.
1854         * tst-cancelx18.c: New file.
1855
1856         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
1857         and tcdrain.
1858
1859         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
1860         * tst-cancel17.c: New file.
1861         * tst-cancelx17.c: New file.
1862
1863         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
1864         * sysdeps/unix/sysv/linux/sigwait.c: New file.
1865         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
1866
1867         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
1868
1869 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
1870
1871         * sysdeps/pthread/createthread.c (create_thread): Set
1872         header.multiple_threads unconditionally.
1873         * allocatestack.c (allocate_stack): Likewise.
1874         * descr.h (struct pthread): Add header.multiple_threads
1875         unconditionally.
1876         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
1877         Define for librt.  #error if neither libpthread, libc nor librt.
1878         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
1879         Likewise.
1880         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
1881         CDISABLE): Likewise.
1882         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
1883         CDISABLE): Likewise.
1884         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
1885         CDISABLE): Likewise.
1886         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
1887         CDISABLE): Likewise.  Access header.multiple_threads outside of
1888         libc and libpthread.
1889         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
1890         Likewise.
1891         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
1892         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
1893
1894 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
1895
1896         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
1897         Also test early cancellation before the thread reaches the cancellation
1898         point.
1899
1900         * Makefile: Compile forward.c with exceptions.
1901
1902         * sysdeps/unix/sysv/linux/sleep.c: New file.
1903
1904 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
1905
1906         * Makefile: Add CFLAGS definition to compile function wrappers
1907         duplicated from libc with exceptions.
1908         * tst-cancel4.c: Also check cancellation handlers.
1909
1910         * Makefile: Add rules to build and run tst-cancel16 and
1911         tst-cancelx16.  Add missing CFLAGS definitions.
1912         * tst-cancel16.c: New file.
1913         * tst-cancelx16.c: New file.
1914
1915 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
1916
1917         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
1918         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
1919         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
1920         (DL_SYSINFO_IMPLEMENTATION): Likewise.
1921
1922         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
1923         (LIBC_CANCEL_RESET): Likewise.
1924         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
1925         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
1926         librt-cancellation.
1927         (CFLAGS-libcrt-cancellation.c): Define.
1928         * sysdeps/pthread/librt-cancellation.c: New file.
1929         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
1930         macros also when compiling librt.
1931         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1932         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1933         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1934         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1935         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1936         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1937         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1938
1939         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
1940         compat_timer_create.
1941
1942 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
1943
1944         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
1945
1946         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
1947         __register_atfork.
1948         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
1949         Add libc_hidden_def.
1950
1951 2003-06-13  Roland McGrath  <roland@redhat.com>
1952
1953         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
1954         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
1955
1956 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
1957
1958         * allocatestack.c (queue_stack): Always inline.
1959         * ptreadhP.h (__do_cancel): Likewise.
1960
1961 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
1962
1963         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
1964         a typo.
1965
1966 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
1967
1968         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1969         (__pthread_cond_signal): Remove incorrect second addition for
1970         cond_lock!=0.
1971
1972 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
1973
1974         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1975         (__pthread_cond_signal): Use correct futex pointer in
1976         __lll_mutex_lock_wait call.
1977
1978         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1979         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
1980
1981 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
1982
1983         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
1984         cancelable.
1985         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
1986         Likewise.
1987
1988         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
1989         hand-written CFI generation code.  Since ENTRY/END also initiated
1990         CFI frames this caused two CFI sets to be generated.
1991
1992 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
1993
1994         * cleanup_routine.c: New file.
1995         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
1996         * sysdeps/pthread/pthread.h: Add support for fully exception-based
1997         cleanup handling.
1998         * Makefile (libpthread-routines): Add cleanup_routine.
1999         Add more CFLAGS variables to compile with exceptions.  Add comments
2000         why which file needs unwind tables.
2001         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
2002         tests.
2003         * tst-cancelx1.c: New file.
2004         * tst-cancelx2.c: New file.
2005         * tst-cancelx3.c: New file.
2006         * tst-cancelx4.c: New file.
2007         * tst-cancelx5.c: New file.
2008         * tst-cancelx6.c: New file.
2009         * tst-cancelx7.c: New file.
2010         * tst-cancelx8.c: New file.
2011         * tst-cancelx9.c: New file.
2012         * tst-cancelx10.c: New file.
2013         * tst-cancelx11.c: New file.
2014         * tst-cancelx12.c: New file.
2015         * tst-cancelx13.c: New file.
2016         * tst-cancelx14.c: New file.
2017         * tst-cancelx15.c: New file.
2018         * tst-cleanupx0.c: New file.
2019         * tst-cleanupx0.expect: New file.
2020         * tst-cleanupx1.c: New file.
2021         * tst-cleanupx2.c: New file.
2022         * tst-cleanupx3.c: New file.
2023
2024         * tst-cleanup0.c: Make standard compliant.
2025         * tst-cleanup1.c: Likewise.
2026
2027         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
2028         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2029         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2030         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2031         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2032         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2033         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
2034         CLEANUP_JMP_BUF.
2035         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2036         * tst-cancel12.c: New file.
2037         * tst-cancel13.c: New file.
2038         * tst-cancel14.c: New file.
2039         * tst-cancel15.c: New file.
2040         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
2041         and tst-cancel15.
2042
2043         * tst-cancel1.c: Add some comments.
2044
2045         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
2046         timeout correctly.
2047
2048 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
2049
2050         * Makefile (CFLAGS-pthread_cancel.c): Define.
2051
2052 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
2053
2054         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
2055         Change type of __writer element to int.
2056         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2057         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2058         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2059         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2060         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2061         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
2062         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2063         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
2064         Compare with TID to determine deadlocks.
2065         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2066         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2067         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
2068         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2069         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2070         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2071         Likewise.
2072         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2073         Likewise.
2074         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2075         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2076         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2077         Likewise.
2078         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2079         Likewise.
2080         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2081         * Makefile (tests): Add tst-rwlock12.
2082         * tst-rwlock12.c: New file.
2083
2084 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
2085
2086         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
2087         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
2088         Remove bogus hidden_proto.
2089         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2090         Likewise.
2091         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
2092         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
2093         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
2094         ___lll_mutex_timedlock): Likewise.
2095
2096 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
2097
2098         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2099         (__pthread_cond_signal): Add some code to eventually handle
2100         cond_lock!=0.
2101
2102 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
2103
2104         * Makefile (tests): Add tst-exec4.
2105         (tst-exec4-ARGS): Define.
2106         * tst-exec4.c: New file.
2107
2108 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
2109
2110         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2111         Also fail if tv_nsec < 0.
2112         (__lll_timedwait_tid): Likewise.
2113         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
2114         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
2115         Likewise.
2116         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
2117         Likewise.
2118         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
2119         Likewise.
2120         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2121         Likewise.
2122         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
2123         Likewise.
2124         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
2125         Likewise.
2126
2127         * Makefile (tests): Add tst-sem8 and tst-sem9.
2128         * tst-sem8.c: New file.
2129         * tst-sem9.c: New file.
2130         * sem_open.c: Fix creation of in_use record if the file exists but
2131         no internal record.
2132
2133         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
2134         definitions.
2135
2136         * sysdeps/pthread/timer_create.c (timer_create): In case
2137         evp==NULL, assign timer ID to sival_ptr.
2138
2139         * descr.h (struct pthread_unwind_buf): Change type of prev element to
2140         struct pthread_unwind_buf *.
2141         (struct pthread): Likewise for cleanup_jmp_buf element.
2142
2143         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
2144         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
2145         * unwind.c (__pthread_unwind_next): Likewise.
2146
2147 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
2148
2149         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2150         (lll_futex_timed_wait): Use int for futex value parameter.
2151         (lll_futex_wake): Likewise.
2152         (lll_futex_requeue): Likewise.
2153
2154         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
2155         Replace one memory operation with one register operation.
2156
2157         * tst-join4.c (do_test): Fix error message.
2158
2159         * tst-rwlock6.c (do_test): Use correct format specifier.
2160
2161         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2162         (__lll_mutex_lock_wait): Replace one memory operation with one
2163         register operation.
2164         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
2165         (__lll_mutex_lock_wait): Likewise.
2166
2167         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2168         (__lll_mutex_cond_lock): Add one to value parameter of
2169         __lll_lock_wait to reflect reality in the futex syscall.
2170         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2171         (lll_mutex_cond_lock): Likewise.
2172
2173 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
2174
2175         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
2176         New function.
2177         (lll_mutex_cond_lock): Define.
2178
2179 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
2180
2181         * Makefile (tests): Add tst-signal6.
2182         * tst-signal6.c: New file.
2183
2184         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
2185         (__lll_mutex_unlock_force): New function
2186         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2187
2188         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2189         (__lll_mutex_unlock_force): New function.
2190         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2191
2192         * tst-rwlock7.c (do_test): Use correct format specifier.
2193
2194         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
2195         Find break parameter in correct asm argument.
2196
2197 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
2198
2199         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
2200         Remove out4.
2201         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
2202         error occured.
2203         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2204         Add __mutex.
2205         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
2206         lll_futex_requeue, lll_mutex_unlock_force): Define.
2207
2208 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
2209
2210         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2211         (pthread_cond_t): Add __mutex.
2212         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
2213         lll_futex_requeue, lll_mutex_unlock_force): Define.
2214
2215 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2216
2217         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
2218         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2219         Add __mutex field.
2220         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
2221         Define.
2222         (lll_futex_wait, lll_futex_wake): Define.
2223         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
2224         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
2225         FUTEX_REQUEUE instead of FUTEX_WAIT.
2226         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
2227         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
2228         mutex which was used in condvar structure.  Call
2229         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
2230         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2231
2232         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
2233         include tcb-offsets.h.  Read wakeup value in locked region.
2234         Use the value of gbr register as THREAD_ID.
2235         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2236         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2237         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2238
2239         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
2240         macros.
2241
2242 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
2243
2244         * sysdeps/pthread/pthread_cond_broadcast.c
2245         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
2246
2247 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
2248
2249         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
2250         typo in register name.
2251         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
2252         correctly.  Actually use requeue.  Little optimization.
2253         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
2254         mutex address early.  Handle cancellation state as 32-bit value.
2255         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2256         Remove unnecessary label.
2257
2258 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
2259
2260         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
2261         instead of FUTEX_WAIT.
2262         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
2263         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2264         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2265         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
2266         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2267         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
2268         used in condvar structure.  Call __pthread_mutex_cond_lock instead
2269         of __pthread_mutex_lock_internal.
2270         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2271         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2272         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2273         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
2274         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2275         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2276         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
2277         Add pthread_mutex_cond_lock.
2278         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
2279         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
2280         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
2281         lll_mutex_cond_lock.
2282         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2283         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2284         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2285         Add __mutex field.
2286         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2287         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2288
2289         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
2290         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2291
2292         * pthreadP.h: Declare __pthread_mutex_cond_lock.
2293         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
2294         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
2295         macro don't define aliases.
2296
2297         * cancellation.c: Remove __pthread_enable_asynccancel_2.
2298         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
2299         * sysdeps/pthread/pthread_cond_timedwait.c: Use
2300         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
2301         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2302         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2303         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2304         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2305         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2306
2307 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
2308
2309         * sem_open.c: Fix one endless loop.  Implement correct semantics
2310         wrt opening the same semaphore more then once.
2311         * sem_close.c: Adjust for sem_open change.
2312         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
2313         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
2314         * Makefile (tests): Add tst-sem7.
2315         * tst-sem7.c: New file.
2316
2317 2003-05-16  Roland McGrath  <roland@redhat.com>
2318
2319         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
2320         uninitialized variable braino.
2321
2322 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
2323
2324         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
2325         test for syscall availability.
2326
2327         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
2328         __no_posix_timers to -1 if the syscalls don't exist.
2329
2330         * pthread_join.c (pthread_join): Set tid field of the joined
2331         thread to -1.  This isn't necessary but helps to recognize some
2332         error conditions with almost no cost.
2333
2334         * allocatestack.c (FREE_P): Also negative values indicate an
2335         unused stack.
2336
2337         * unwind.c: Include <unistd.h>.
2338
2339 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
2340
2341         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
2342
2343 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
2344
2345         * Makefile (crti-objs, crtn-objs): New variables.
2346         (omit-deps, extra-objs): Add crtn.
2347         ($(objpfx)libpthread.so): Depend on both crti and crtn
2348         and links to them in multidir.
2349         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
2350
2351 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
2352
2353         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2354         (lll_mutex_unlock): Use atomic_exchange_rel.
2355
2356 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
2357
2358         * cond-perf.c (cons): Add missing locking around setting of alldone.
2359
2360 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
2361
2362         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
2363         related macros.
2364         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2365
2366 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
2367
2368         * tst-sem6.c: New file.
2369         * Makefile (tests): Add tst-sem6.
2370
2371         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
2372         Use atomic_exchange_rel instead of atomic_exchange.
2373         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
2374         Likewise.
2375
2376         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
2377         code for lll_futex_wait and lll_futex_wake in static apps.  Use
2378         vsyscall is possible.
2379
2380         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
2381         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
2382         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
2383         pthread_setaffinity_np.
2384         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
2385         and pthread_setaffinity_np.
2386         * Makefile (libpthread-routines): Add pthread_getaffinity and
2387         pthread_setaffinity.
2388
2389         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
2390         use it in case mmap to allocate the stack fails.
2391         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
2392         ARCH_MAP_FLAGS here.
2393         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
2394         ARCH_RETRY_MMAP.
2395
2396 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
2397
2398         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
2399         handler implementation.  It is now lockless in fork().
2400         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2401         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2402         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
2403         declare the __fork_*_lists.
2404         (struct fork_handler): Include pointers to all three functions.
2405         Add next, refcntr and need_signal elements.
2406         (__fork_handlers): New declaration.
2407         (__register_atfork_malloc): Remove declaration.
2408         (HAVE_register_atfork_malloc): Remove definition.
2409         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
2410         __pthread_child_handler variable.
2411         (__libc_pthread_init): Use __register_atfork instead of explicitly
2412         adding to the list.
2413         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
2414         and lll_futex_wake.
2415         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2416
2417         * unwind.c (unwind_cleanup): Print error message and then abort.  This
2418         function must never be reached.
2419
2420         * cond-perf.c: New file.
2421
2422 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
2423
2424         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
2425
2426 2003-05-04  Roland McGrath  <roland@redhat.com>
2427
2428         * Makefile ($(objpfx)../libc.so): New target.
2429
2430 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
2431
2432         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2433         (pthread_condattr_t): Size is only an int, don't use long for
2434         alignment.
2435         (pthread_mutexattr_t): Likewise.
2436         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2437         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2438         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2439
2440 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
2441
2442         * sysdeps/i386/tls.h: Define THREAD_ID.
2443         * sysdeps/ia64/tls.h: Likewise.
2444         * sysdeps/powerpc/tls.h: Likewise.
2445         * sysdeps/s390/tls.h: Likewise.
2446         * sysdeps/sh/tls.h: Likewise.
2447         * sysdeps/x86_64/tls.h: Likewise.
2448         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
2449         record ownership.
2450         * pthread_mutex_timedlock.c: Likewise.
2451         * pthread_mutex_trylock.c: Likewise.
2452         * pthread_mutex_unlock.c: Likewise.
2453         * pthread_rwlock_trywrlock.c: Likewise.
2454         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
2455         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2456         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
2457         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2458
2459         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
2460         flag.
2461
2462 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
2463
2464         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
2465         (__SIZEOF_PTHREAD_COND_T): Define to 48.
2466         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
2467         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2468         Make __align long long instead of long.
2469         (pthread_rwlock_t): Formatting.
2470         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2471         (pthread_rwlock_t): Formatting.
2472         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2473         (pthread_cond_t): Make __align long long instead of long.
2474         (pthread_rwlock_t): Move __flags field to the same position as in
2475         linuxthreads.
2476
2477 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
2478
2479         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
2480         * tst-rwlock7.c (do_test): Likewise.
2481
2482 2003-04-26  Roland McGrath  <roland@redhat.com>
2483
2484         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
2485
2486 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
2487
2488         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
2489         sizeof (struct pthread).
2490         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
2491         1 struct pthread.
2492         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
2493         to 0.
2494         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
2495         struct pthread.
2496         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
2497         to 32-bit bytes.
2498         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
2499         tcbp.
2500         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
2501         unneccessarily.
2502         (NO_TLS_OFFSET): Define.
2503         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
2504         add TLS_TCB_SIZE unnecessarily.
2505
2506 2003-04-22  Roland McGrath  <roland@redhat.com>
2507
2508         * Makeconfig (shared-thread-library): Reverse link order to work
2509         around linker bug.
2510
2511 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
2512
2513         * semaphore.h: Fix typo in comment.
2514
2515 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
2516
2517         * sysdeps/pthread/sigfillset.c: New file.
2518
2519         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
2520         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
2521         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
2522         * sysdeps/pthread/sigaction.c: Likewise.
2523         * sysdeps/pthread/sigprocmask.c: New file.
2524         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
2525         __SIGRTMIN+1.
2526         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2527         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
2528         in this case.
2529
2530 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
2531
2532         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2533         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
2534
2535         * sysdeps/unix/sysv/linux/unregister-atfork.c
2536         (__unregister_atfork): Don't free memory not allocated dynamically.
2537
2538         * semaphore.h: Remove __THROW marker from cancellation points.
2539         * nptl/sysdeps/pthread/pthread.h: Likewise.
2540
2541 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
2542
2543         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
2544         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
2545         __THROW.
2546
2547 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
2548
2549         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
2550
2551 2003-04-15  Roland McGrath  <roland@redhat.com>
2552
2553         * forward.c (__pthread_unwind): Tweak to avoid warning.
2554
2555 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
2556
2557         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
2558
2559 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
2560
2561         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
2562         overflow CFA advance instructions.
2563         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2564
2565 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
2566
2567         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
2568         * sysdeps/i386/pthread_spin_lock.c: Likewise.
2569         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
2570         defined.
2571
2572         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
2573         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
2574         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
2575         DW_CFA_advance_loc for .Laddl-.Lsubl.
2576
2577 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
2578
2579         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
2580         position-independent unwind data for static libraries.
2581         Add missing unwind info.  Add comments.
2582
2583         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
2584         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2585         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2586         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2587
2588 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
2589
2590         * Makefile: Make sure all cancellation points are compiled with
2591         exception and asynchronous unwind tables.
2592
2593         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
2594         which mishandles loading of global object addresses in PIC.
2595         (THREAD_SETMEM_NC): Likewise.
2596
2597 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
2598
2599         * pthread.h: Define new data structure for cleanup buffer.  Declare
2600         new cleanup handler interfaces.
2601         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
2602         (struct pthread): Add cleanup_jmp_buf pointer.  Define
2603         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
2604         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
2605         it.  Declare old cleanup handler installation functions.
2606         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
2607         handling.
2608         * cleanup_defer.c: Likewise.
2609         * cleanup_compat.c: New file.  Old cleanup code.
2610         * cleanup_def_compat.c: New file.  Old cleanup code.
2611         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
2612         if own thread descriptor.
2613         * unwind.c: New file.
2614         * forward.c: Add __pthread_unwind.
2615         * init.c (pthread_functions): Add __pthread_unwind.
2616         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
2617         Add ptr___pthread_unwind.
2618         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
2619         and unwind function.
2620         * Makefile (libpthread-routines): Add cleanup_compat,
2621         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
2622         table generation if necessary.
2623         * version.c: Record whether unwind support is compiled in.
2624         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
2625         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
2626         handler interfaces.
2627         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
2628         complication to generate unwind information for syscall wrappers.
2629         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2630         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2631         __cleanup_fct_attribute.
2632
2633         * Makefile: Add rules to build and run tst-cleanup0.
2634         * tst-cleanup0.c: New file.
2635         * tst-cleanup0.expect: New file.
2636
2637         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
2638         caller.  Optimize to avoid often unecessary local variable.
2639
2640 2003-04-11  Roland McGrath  <roland@redhat.com>
2641
2642         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
2643         sets variable `multidir'; include that.
2644         (generated): Add it.
2645         ($(objpfx)$(multidir)/crti.o): New target.
2646         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
2647
2648 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
2649
2650         * tst-attr2.c (do_test): Add cast to avoid warning.
2651         * tst-mutex4.c (do_test): Likewise.
2652
2653 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
2654
2655         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
2656         in child.
2657
2658 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
2659
2660         * Makefile (tests): Add tst-detach1.
2661         * tst-detach1.c: New file.
2662
2663 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
2664
2665         * sysdeps/pthread/pthread.h: Remove duplicate
2666         pthread_cleanup_{push,pop} definitions.
2667
2668         * tst-barrier2.c: Eliminate warnings.
2669         * tst-cancel4.c: Likewise.
2670         * tst-cond4.c: Likewise.
2671         * tst-cond6.c: Likewise.
2672         * tst-detach1.c: Likewise.
2673         * tst-rwlock4.c: Likewise.
2674         * tst-rwlock6.c: Likewise.
2675         * tst-rwlock7.c: Likewise.
2676         * tst-sem3.c: Likewise.
2677         * tst-spin2.c: Likewise.
2678         * tst-umask1.c: Likewise.
2679
2680 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
2681
2682         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
2683
2684 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
2685
2686         * descr.h (struct pthread): Move cancelhandling member to the front.
2687
2688 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
2689
2690         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
2691         malloc_parent, and malloc_child statically.
2692         (__register_atfork_malloc): New function.
2693         (free_mem): Don't free any of the malloc_* variables on the list.
2694         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
2695         Define HAVE_register_atfork_malloc.
2696
2697 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
2698
2699         * sysdeps/pthread/createthread.c (create_thread): Add some more
2700         comments explaining when to set multiple_threads and when not.
2701
2702         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
2703         THREAD_ATOMIC_BIT_SET if not already defined.
2704         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
2705         THREAD_ATOMIC_BIT_SET:
2706         * sysdeps/x86_64/tls.h: Likewise.
2707         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
2708         THREAD_ATOMIC_CMPXCHG_VAL.
2709         (_pthread_cleanup_pop_restore): Likewise.
2710         * cancellation.c (__pthread_enable_asynccancel): Likewise.
2711         (__pthread_enable_asynccancel_2): Likewise.
2712         (__pthread_disable_asynccancel): Likewise.
2713         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
2714         (__libc_disable_asynccancel): Likewise.
2715         * init.c (sigcancel_handler): Likewise.
2716         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
2717         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
2718
2719 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
2720
2721         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
2722         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
2723         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
2724         * Makefile (tests): Add tst-cancel11.
2725         * tst-cancel11.c: New file.
2726
2727 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
2728
2729         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
2730         round, not the first.  Use specific_used flag instead of local
2731         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
2732         (__free_tcb): Don't call deallocate_tsd here.
2733         (start_thread): Call deallocate_tsd here.
2734         * pthread_setspecific.c: Set specific_used flag really only when
2735         needed.
2736         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
2737         * tst-tsd3.c: New file.
2738         * tst-tsd4.c: New file.
2739
2740 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
2741
2742         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
2743         Use atomic_exchange_and_add instead of __lll_add.
2744         (__lll_mutex_timedlock): Likewise.
2745         Patch by Ian Wienand.
2746
2747 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
2748
2749         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2750         (SINGLE_THREAD_P): Fix typo.
2751         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
2752
2753 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
2754
2755         * Makefile (tests): Add tst-align.
2756         * tst-align.c: New file.
2757         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
2758
2759         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
2760         function correctly.
2761
2762         * tst-tsd2.c: Add casts to avoid warnings.
2763
2764 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
2765
2766         * descr.h (struct pthread): Move most often used elements to the front.
2767
2768 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
2769
2770         * Makefile (libpthread-routines): Add pthread_atfork.
2771         (libpthread-static-only-routines): Add pthread_atfork.
2772
2773 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2774
2775         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
2776         of TLS_DTV_AT_TP.
2777         (INSTALL_DTV): Add parens.
2778         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
2779         Use passed descr instead of THREAD_SELF.
2780         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
2781         (__lll_mutex_timedlock_wait): Correct expected value after
2782         spurious wakeup.
2783         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
2784         Release lock before waking up the waiters.
2785         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
2786         criteria.  Reorderstruct passed to cleanup handler.  Fix
2787         handling of cancellation and failung pthread_mutex_unlock call.
2788         Use __pthread_enable_asynccancel_2 instead of
2789         __pthread_enable_asynccancel.
2790         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2791         Return result of lock re-get if it fails.
2792         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
2793         for __pthread_cleanup_push.
2794         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
2795         completely broken rwlock implementation.
2796         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2797         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2798         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2799         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2800         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2801         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
2802         versioned_symbol macro.
2803         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
2804         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
2805
2806 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
2807
2808         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
2809         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
2810         and __helper_tid.
2811         (struct timer): Remove th and bar field.
2812         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
2813         debugging code.  Create only one helper thread.
2814         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
2815         helper thread.
2816         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2817         Renamed.  Define statically.  Use thread info from siginfo.
2818         (__helper_once): New variable.
2819         (__helper_tid): New variable.
2820         (__reset_helper_control): New function.
2821         (__start_helper_thread): New function.
2822
2823         * pthread_create.c (start_thread): Don't use setjmp inside
2824         __builtin_expect to work around gcc bug.
2825
2826         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
2827         timer_delete syscall fails, but not with ENOSYS, set
2828         __no_posix_timers.
2829
2830         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
2831         (timer_settime): Fix typo.
2832         * sysdeps/unix/sysv/linux/timer_getoverr.c
2833         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
2834
2835 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
2836
2837         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
2838         offset of cleanupbuf.__prev.
2839
2840 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
2841
2842         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
2843         of included file.
2844
2845 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
2846
2847         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
2848         NULL provide default definition to syscall.
2849
2850 2003-03-25  Roland McGrath  <roland@redhat.com>
2851
2852         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
2853         (timer_id2ptr): Fix typo.
2854
2855 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
2856
2857         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
2858         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
2859         * sysdeps/ia64/pthreaddef.h: Likewise.
2860         * sysdeps/powerpc/pthreaddef.h: Likewise.
2861         * sysdeps/s390/pthreaddef.h: Likewise.
2862         * sysdeps/sh/pthreaddef.h: Likewise.
2863         * sysdeps/x86_64/pthreaddef.h: Likewise.
2864         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
2865         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
2866         being changed.
2867         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
2868         SIGTIMER is not unblocked.
2869         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
2870         RT signal taken.
2871         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
2872         be send.
2873         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
2874         pass pointer through as ID.
2875         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
2876         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
2877         * sysdeps/unix/sysv/linux/timer_create.c: New file.
2878         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
2879         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
2880         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
2881         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
2882         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
2883         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
2884         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
2885         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
2886         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
2887         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
2888         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
2889         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
2890         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
2891         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
2892         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
2893         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
2894         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
2895         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
2896         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
2897         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
2898         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
2899         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
2900         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
2901         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
2902         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
2903         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
2904         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
2905         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
2906         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
2907         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
2908
2909         * pthreadP.h: Remove FRAME_LEFT definition.
2910         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
2911         already left frame.  Programs which have this problem are not POSIX
2912         compliant.
2913         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
2914
2915 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
2916
2917         * sysdeps/pthread/tst-timer.c: Check return values of the
2918         functions we test.
2919
2920 2003-03-23  Roland McGrath  <roland@redhat.com>
2921
2922         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
2923         * tst-tls3mod.c: Likewise.
2924         * tst-tls1.c: Likewise.
2925         * tst-tls2.c: Likewise.
2926
2927         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
2928         undefined behavior.
2929
2930         * tst-join5.c (tf1, tf2): Add a cast.
2931
2932         * Makeconfig (includes): Append -I$(..)nptl to this variable.
2933
2934         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
2935         Don't test anything.
2936         * tst-cond4.c: Likewise.
2937         * tst-cond6.c: Likewise.
2938         * tst-flock2.c: Likewise.
2939         * tst-mutex4.c: Likewise.
2940         * tst-rwlock4.c: Likewise.
2941         * tst-signal1.c: Likewise.
2942         * tst-spin2.c: Likewise.
2943         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
2944
2945         * tst-mutex4.c: Use test-skeleton.c.
2946         * tst-spin2.c: Likewise.
2947         * tst-sysconf.c: Likewise.
2948         * tst-barrier2.c: Likewise.
2949         * tst-cond4.c: Likewise.
2950         * tst-cond6.c: Likewise.
2951         * tst-rwlock4.c: Likewise.
2952         * tst-unload.c: Likewise.
2953         * tst-flock2.c (do_test): Use return instead of exit.
2954
2955 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
2956
2957         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
2958
2959 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
2960
2961         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2962         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
2963         instead of __lll_compare_and_swap.
2964         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
2965         Likewise.
2966         Removed definition if __lll_compare_and_swap.
2967
2968         * cancellation.c: Adjust for new form of compare&exchange macros.
2969         * cleanup_defer.c: Likewise.
2970         * init.c: Likewise.
2971         * libc-cancellation.c: Likewise.
2972         * old_pthread_cond_broadcast.c: Likewise.
2973         * old_pthread_cond_signal.c: Likewise.
2974         * old_pthread_cond_timedwait.c: Likewise.
2975         * old_pthread_cond_wait.c: Likewise.
2976         * pthread_cancel.c: Likewise.
2977         * pthread_create.c: Likewise.
2978         * pthread_detach.c: Likewise.
2979         * pthread_join.c: Likewise.
2980         * pthread_key_delete.c: Likewise.
2981         * pthread_setcancelstate.c: Likewise.
2982         * pthread_setcanceltype.c: Likewise.
2983         * pthread_timedjoin.c: Likewise.
2984         * pthread_tryjoin.c: Likewise.
2985         * sysdeps/pthread/createthread.c: Likewise.
2986
2987 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
2988
2989         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
2990         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
2991         definitions.  Replace uses with calls to atomic_* functions.
2992         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2993         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
2994         __lll_test_and_set calls with atomic_exchange_and_add and
2995         atomic_exchange calls respectively.
2996         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2997         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2998         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
2999         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3000         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
3001         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
3002         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
3003
3004         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
3005         returns the old value.
3006
3007 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
3008
3009         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
3010         int for variable OLDVAL and correct inline assembler contraint.
3011         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
3012         type int for variable OLD.
3013
3014         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
3015         only for s390-32.
3016         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3017         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
3018         instead of multiple_threads field in the TCB.
3019
3020 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
3021
3022         * sysdeps/i386/i686/bits/atomic.h: Removed.
3023         * sysdeps/i386/i586/bits/atomic.h: Removed.
3024         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
3025         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
3026         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
3027         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
3028         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
3029         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
3030         * atomic.h: Removed.  Moved to glibc.
3031
3032         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
3033         support for clock selection.
3034
3035         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
3036         signalling waiters.
3037
3038 2003-03-18  Roland McGrath  <roland@redhat.com>
3039
3040         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3041         Add __lll_rel_instr first.  Add memory clobber.
3042         (lll_mutex_unlock): Use __lll_test_and_set.
3043         From Paul Mackerras <paulus@samba.org>.
3044
3045         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
3046         unconditionally.
3047         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3048         (SINGLE_THREAD_P):  Add `header.' prefix.
3049         From Paul Mackerras <paulus@samba.org>.
3050
3051         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
3052         pthread_timedjoin_np to ...
3053         (libpthread: GLIBC_2.3.3): ... here.
3054         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
3055
3056         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3057         Avoid shadowing VAL variable.
3058
3059         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3060         New macro.
3061
3062 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
3063
3064         * Makefile (tests): Add tst-cond11.
3065         * tst-cond11.c: New file.
3066
3067         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
3068         struct passed to cleanup handler to eliminate one more
3069         instruction.
3070         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3071
3072         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3073         (pthrad_cond_t): Replace __unused field with __clock.
3074
3075         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
3076         waken all waiters in cleanup handler.
3077         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3078         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3079
3080         * pthread_condattr_getclock.c: New file.
3081         * pthread_condattr_setclock.c: New file.
3082         * sysdeps/pthread/pthread.h: Declare these new functions.
3083         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
3084         * Makefile (libpthread-routines): Add the new functions.
3085         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
3086         Renamed field to value.  Document use of the bits.
3087         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
3088         change.
3089         * pthread_condattr_setpshared.c: Likewise.
3090         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
3091         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
3092         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3093         Add __clock field.
3094         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3095         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3096         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3097         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3098         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3099         Implement clock selection.
3100         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3101         * pthread-errnos.sym: Add ENOSYS.
3102         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3103         _POSIX_CLOCK_SELECTION.
3104         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3105
3106         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
3107         invalid .size directive.
3108
3109 2003-03-17  Roland McGrath  <roland@redhat.com>
3110
3111         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3112         Formatting tweaks.
3113
3114 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3115
3116         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
3117         Use __lll_add instead of spelling it out.  Use protected symbol names.
3118         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
3119         Use __lll_add.
3120         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
3121         Renamed from lll_compare_and_swap.  Use new name where necessary.
3122         (__lll_add): Defined.
3123         (__lll_dec_if_positive): Defined.
3124         (__lll_test_and_set): Defined.
3125         * sysdeps/ia64/pthread_spin_init.c: Removed.
3126         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
3127         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
3128         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
3129         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
3130         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
3131         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
3132         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
3133         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
3134         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
3135         __sync_lock_release_si.
3136         Patch by Jakub Jelinek.
3137
3138         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
3139         Fix timeout handling.
3140         (__lll_timedwait_tid): Likewise.
3141         (lll_unlock_wake_cb): Wake up other waiters if necessary.
3142         Patch by Jakub Jelinek.
3143
3144         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
3145
3146 2003-03-17  Roland McGrath  <roland@redhat.com>
3147
3148         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
3149         * sysdeps/pthread/pthread_spin_init.c: New file.
3150         * sysdeps/pthread/pthread_spin_unlock.c: New file.
3151         * sysdeps/powerpc/Makefile: New file.
3152         * sysdeps/powerpc/pthread_spin_lock.c: New file.
3153         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
3154         * sysdeps/powerpc/pthreaddef.h: New file.
3155         * sysdeps/powerpc/tcb-offsets.sym: New file.
3156         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
3157         * sysdeps/powerpc/tls.h: New file.
3158         * sysdeps/powerpc/bits/atomic.h: New file.
3159         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
3160         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
3161         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
3162
3163         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
3164         * sysdeps/unix/sysv/linux/sem_post.c: New file.
3165         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
3166         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
3167         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
3168         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
3169         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
3170         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
3171         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
3172         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
3173         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
3174         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
3175         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
3176         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
3177         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
3178
3179         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
3180         not gettimeofday.
3181         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
3182         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
3183         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
3184         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
3185         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
3186
3187 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3188
3189         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
3190         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3191         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3192         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3193         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
3194
3195 2003-03-16  Roland McGrath  <roland@redhat.com>
3196
3197         * tst-fork4.c: Include <string.h>.
3198         * tst-signal2.c: Likewise.
3199         * tst-mutex5.c (do_test): exit -> return.
3200         * tst-mutex2.c: Include <stdlib.h>.
3201
3202 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
3203
3204         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
3205         (__lll_mutex_timedlock_wait): Correct expected value after
3206         spurious wakeup.  Otherwise we would never wait again.
3207
3208         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
3209         zone versus inline asm stupidity.  Use correct instructions.
3210
3211         * tst-rwlock6.c: Add some more status output.
3212
3213 2003-03-15  Roland McGrath  <roland@redhat.com>
3214
3215         * sysdeps/pthread/configure.in: New file.
3216         * sysdeps/pthread/configure: New file (generated).
3217
3218 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
3219
3220         * allocatestack.c (allocate_stack): Store the exact stack size of
3221         user allocated stacks.
3222
3223 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
3224
3225         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
3226         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
3227         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
3228         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
3229         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
3230         Use `header.' prefix.
3231         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
3232
3233 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
3234
3235         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
3236         __builtin_frame_address, use stack pointer.
3237
3238         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
3239         instead of __builtin_frame_pointer.
3240
3241 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
3242
3243         * tst-basic1.c (do_test): Add cast to avoid warning.
3244         * tst-basic2.c (do_test): Likewise.
3245
3246         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
3247         amount of stack correction.
3248
3249         * tst-fork4.c: Use test-skeleton.c.
3250
3251 2003-03-14  Roland McGrath  <roland@redhat.com>
3252
3253         * init.c: Fix typo "#eli" for "#else".
3254
3255 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
3256
3257         * allocatestack.c (__stack_user): Use hidden_data_def.
3258         * pthread_create.c (__pthread_keys): Likewise.
3259
3260         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
3261
3262 2003-03-14  Roland McGrath  <roland@redhat.com>
3263
3264         * tst-fork4.c: New file.
3265         * Makefile (tests): Add it.
3266
3267         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
3268         we always define the padding space.
3269         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
3270         stopped supporting its own extensions fully.
3271         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
3272         struct also called `header', so `header.multiple_threads' is the field
3273         name to use on all machines.
3274         * allocatestack.c (allocate_stack): Use `header.' prefix.
3275         * sysdeps/pthread/createthread.c (create_thread): Likewise.
3276         * pthread_create.c (__pthread_create_2_1): Likewise.
3277         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
3278         (THREAD_SELF): Likewise.
3279         * sysdeps/x86_64/tls.h: Likewise.
3280         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
3281         (SINGLE_THREAD_P): Likewise.
3282         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
3283         (SINGLE_THREAD_P): Likewise.
3284         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3285         (SINGLE_THREAD_P): Likewise.
3286
3287         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
3288         value directly.
3289
3290 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
3291
3292         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
3293         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
3294
3295         * pthread_create.c (start_thread): setjmp is expected to return 0.
3296
3297         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
3298         (THREAD_GETMEM_NC): Likewise.
3299
3300 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
3301
3302         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
3303         and the size of the stack which must be allocated is a multiple,
3304         allocate one more page.
3305         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
3306         MULTI_PAGE_ALIASING.
3307
3308 2003-03-13  Roland McGrath  <roland@redhat.com>
3309
3310         * pthread_create.c (start_thread): Set EXITING_BIT after the
3311         event-reporting (and destructors), not before.
3312
3313 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
3314
3315         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
3316         lll_futex_wake): Declare register variables as long int instead of
3317         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
3318         Make syscall arguments clobbered by the syscall.
3319         (lll_futex_wait): Define using lll_futex_timed_wait.
3320
3321         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
3322         to void *.
3323
3324         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
3325         PPID if [! NDEBUG].
3326
3327         * allocatestack.c (nptl_ncreated): Only declare if
3328         COLORING_INCREMENT != 0.
3329
3330         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
3331         (__libc_enable_asynccancel_2): Remove prototype.
3332
3333         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
3334         ctid to match kernel.
3335
3336 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
3337
3338         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
3339         libc_multiple_threads.
3340         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
3341         __libc_multiple_threads to...
3342         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
3343
3344         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
3345         versioning.
3346         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3347         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3348
3349         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
3350         (__pthread_once_internal): Define.
3351
3352         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
3353         macros instead of .symver directly.
3354         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3355         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3356
3357         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
3358         * sysdeps/x86_64/tcb-offsets.sym: New file.
3359         * sysdeps/x86_64/Makefile: New file.
3360
3361         * sysdeps/i386/tcb-offsets.sym: Add SELF.
3362         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
3363         to access own pthread_t in TCB.
3364         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3365         Likewise.
3366         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3367         Likewise.
3368         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3369
3370 2003-03-12  Roland McGrath  <roland@redhat.com>
3371
3372         * pthread-errnos.sym: New file.
3373         * Makefile (gen-as-const-headers): New variable, list that file.
3374         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
3375         header <pthread-errnos.h> instead of defining errno values here.
3376         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3377         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3378         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
3379         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3380         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3381         Likewise.
3382         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3383         Likewise.
3384         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3385         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3386         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
3387         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3388         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3389         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3390         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3391         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3392         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3393         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
3394         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3395         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
3396         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
3397         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
3398         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
3399         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3400         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3401         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3402         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3403         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
3404         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
3405         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
3406         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
3407         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
3408         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
3409         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3410         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3411
3412         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
3413         CLONE_CHILD_SETTID worked.
3414
3415 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
3416
3417         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
3418         file.
3419         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
3420         file.
3421
3422         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3423         (pthread_cond_t): Add padding.
3424
3425         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
3426         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
3427         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
3428
3429         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
3430         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
3431         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
3432         (__pthread_rwlock_timedrdlock): Likewise.
3433         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
3434         (__pthread_rwlock_wrlock): Likewise.
3435         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
3436         (__pthread_rwlock_rdlock): Likewise.
3437
3438         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
3439
3440         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
3441         result of lock re-get if it fails.
3442
3443 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
3444
3445         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
3446         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3447         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
3448         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3449         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3450         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3451         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3452         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3453         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3454         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3455
3456         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
3457         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
3458
3459         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
3460         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
3461         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
3462         (create_thread): Likewise.
3463         Define __pthread_multiple_t