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