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