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