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