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