* sysdeps/unix/sysv/linux/sparc/bits/setjmp.h (_JMPBUF_UNWINDS): Add
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2006-01-09  Roland McGrath  <roland@redhat.com>
2
3         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
4         Use __extension__ on anonymous union definition.
5         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
9
10 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
11
12         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
13         stack bias to mc_ftp field.
14
15 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
16
17         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
18         being too clever and reloading the futex value where it shouldn't.
19
20 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
21
22         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
23         correct type.
24
25 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
26
27         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
28         Add cfi directives.
29
30 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
31
32         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
33         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
34         rename in tcbhead_t.
35
36         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
37         Don't give the union a name because it changes the mangled name.
38         Instead name the struct for __data.
39         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
40         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
41         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
42         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
43         * pthread_create.c (start_thread): Adjust robust mutex free loop.
44         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
45
46 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
47
48         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
49         Return status.
50         (lll_futex_timed_wait): Define.
51         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
52         * sysdeps/pthread/aio_misc.h: New file.
53
54 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
55
56         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
57
58 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
59
60         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
61         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
62         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
63
64 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
65
66         * tst-cancel24.cc: Use C headers instead of C++ headers.
67
68 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
69
70         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
71         sparc-linux configured glibc.
72         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
73         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
74         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
75         atomic_compare_and_exchange_val_24_acq instead of
76         atomic_compare_and_exchange_val_acq.
77         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
78         instead of atomic_exchange_rel.
79         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
80         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
81         file.
82         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
83         file.
84         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
85         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
86         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
87         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
88         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
89         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
90         New file.
91         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
92         New file.
93         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
94         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
95         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
96         file.
97         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
98         file.
99         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
100
101 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
102
103         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
104         mutex initializers.
105
106 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
107
108         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
109         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
110         THREAD_COPY_POINTER_GUARD): Define.
111         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
112         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
113
114 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
115
116         * version.c: Update copyright year.
117
118 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
119
120         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
121         .eh_frame section, use cfi_* directives.
122         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
123
124 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
125
126         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
127         now.
128
129 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
130
131         * sysdeps/pthread/sigaction.c: Removed.
132         * sigaction.c: New file.
133         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
134
135 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
136
137         * Makefile (tests): Add tst-signal7.
138         * tst-signal7.c: New file.
139
140 2005-12-27  Roland McGrath  <roland@redhat.com>
141
142         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
143         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
144         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
145         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
146         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
147         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
148         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
149         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
150         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
151         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
152         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
153
154 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
155
156         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
157         and __prev field to pthread_mutex_t.
158         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
159         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
160         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
161         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
162         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
163         to pthread_mutex_t.
164
165 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
166
167         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
168         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
169         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
170         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
171         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
172         and PTHREAD_MUTEXATTR_FLAG_BITS.
173         * descr.h (struct pthread): Add robust_list field and define
174         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
175         * pthread_mutexattr_getrobust.c: New file.
176         * pthread_mutexattr_setrobust.c: New file.
177         * pthread_mutex_consistent.c: New file.
178         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
179         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
180         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
181         Adjust pthread_mutex_t initializers.
182         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
183         field to pthread_mutex_t.
184         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
185         and __prev field to pthread_mutex_t.
186         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
187         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
188         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
189         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
190         * pthread_mutexattr_gettype.c: Likewise.
191         * pthread_mutexattr_setpshared.c: Likewise.
192         * pthread_mutexattr_settype.c: Likewise.
193         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
194         Initialize mutex kind according to robust flag.
195         * pthread_mutex_lock.c: Implement local robust mutex.
196         * pthread_mutex_timedlock.c: Likewise.
197         * pthread_mutex_trylock.c: Likewise.
198         * pthread_mutex_unlock.c: Likewise.
199         * pthread_create.c (start_thread): Mark robust mutexes which remained
200         locked as dead.
201         * tst-robust1.c: New file.
202         * tst-robust2.c: New file.
203         * tst-robust3.c: New file.
204         * tst-robust4.c: New file.
205         * tst-robust5.c: New file.
206         * tst-robust6.c: New file.
207         * tst-robust7.c: New file.
208         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
209         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
210         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
211         tst-robust5, tst-robust6, and tst-robust7.
212
213         * tst-typesizes.c: New file.
214         * Makefile (tests): Add tst-typesizes.
215
216         * tst-once3.c: More debug output.
217
218 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
219
220         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
221         missing after last change.
222
223         * version.c: Update copyright year.
224
225 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
226
227         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
228         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
229         * pthread_mutex_trylock.c: Likewise.
230         * pthread_mutex_timedlock.c: Likewise.
231         * pthread_mutex_unlock.c: Likewise.
232
233 2005-12-22  Roland McGrath  <roland@redhat.com>
234
235         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
236         so that #include_next's search location is not reset to the -I..
237         directory where <nptl/...> can be found.
238
239 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
240
241         [BZ #1913]
242         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
243         Fix unwind info.  Remove useless branch prediction prefix.
244         * tst-cancel24.cc: New file.
245         * Makefile: Add rules to build and run tst-cancel24.
246
247 2005-12-21  Roland McGrath  <roland@redhat.com>
248
249         * libc-cancellation.c: Use <> rather than "" #includes.
250         * pt-cleanup.c: Likewise.
251         * pthread_create.c: Likewise.
252         * pthread_join.c: Likewise.
253         * pthread_timedjoin.c: Likewise.
254         * pthread_tryjoin.c: Likewise.
255         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
256         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
257         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
258         * unwind.c: Likewise.
259
260 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
261
262         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
263         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
264         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
265         THREAD_COPY_POINTER_GUARD): Define.
266
267 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
268
269         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
270         rather than one.
271         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
272         THREAD_COPY_POINTER_GUARD): Define.
273         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
274         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
275         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
276         THREAD_COPY_POINTER_GUARD): Define.
277         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
278         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
279         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
280         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
281         Use PTR_DEMANGLE for B0 if defined.
282
283 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
284
285         * pthread_create.c (__pthread_create_2_1): Use
286         THREAD_COPY_POINTER_GUARD if available.
287         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
288         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
289         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
290         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
291         * sysdeps/x86_64/tls.h: Likewise.
292
293 2005-12-15  Roland McGrath  <roland@redhat.com>
294
295         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
296
297 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
298
299         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
300         sysdeps/generic.
301         * errno-loc.c: New file.
302
303 2005-12-12  Roland McGrath  <roland@redhat.com>
304
305         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
306         adjustments before choosing stack size.  Update minimum stack size
307         calculation to match allocate_stack change.
308
309 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
310
311         * allocatestack.c (allocate_stack): Don't demand that there is an
312         additional full page available on the stack beside guard, TLS, the
313         minimum stack.
314
315 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
316
317         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
318         (__cleanup_fct_attribute): Use __regparm__ not regparm.
319
320         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
321         compiling 32-bit code we must define __cleanup_fct_attribute.
322
323 005-11-24  Jakub Jelinek  <jakub@redhat.com>
324
325         [BZ #1920]
326         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
327         __attribute__ instead of __attribute.
328         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
329         (__cleanup_fct_attribute): Likewise.
330
331 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
332
333         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
334         a write barrier before writing libgcc_s_getcfa.
335
336 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
337
338         * sysdeps/unix/sysv/linux/configure: Removed.
339
340 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
341
342         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
343         optional init_array/fini_array support.
344
345 2005-10-24  Roland McGrath  <roland@redhat.com>
346
347         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
348         versioned_symbol use.
349
350 2005-10-16  Roland McGrath  <roland@redhat.com>
351
352         * init.c (__pthread_initialize_minimal_internal): Even when using a
353         compile-time default stack size, apply the minimum that allocate_stack
354         will require, and round up to page size.
355
356 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
357
358         * Makefile ($(test-modules)): Remove static pattern rule.
359
360 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
361             Ulrich Drepper  <drepper@redhat.com>
362
363         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
364         alignment in callback function.
365         * Makefile: Add rules to build and run tst-align3.
366         * tst-align3.c: New file.
367
368 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
369
370         * allocatestack.c (setxid_signal_thread): Add
371         INTERNAL_SYSCALL_DECL (err).
372
373 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
374
375         * allocatestack.c (setxid_signal_thread): Need to use
376         atomic_compare_and_exchange_bool_acq.
377
378 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
379             Jakub Jelinek  <jakub@redhat.com>
380
381         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
382         CANCEL_RESTMASK.
383         (struct pthread): Move specific_used field to avoid padding.
384         Add setxid_futex field.
385         * init.c (sighandler_setxid): Reset setxid flag and release the
386         setxid futex.
387         * allocatestack.c (setxid_signal_thread): New function.  Broken
388         out of the bodies of the two loops in __nptl_setxid.  For undetached
389         threads check whether they are exiting and if yes, don't send a signal.
390         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
391         * pthread_create.c (start_thread): For undetached threads, check
392         whether setxid bit is set.  If yes, wait until signal has been
393         processed.
394
395         * allocatestack.c (STACK_VARIABLES): Initialize them.
396         * pthread_create.c (__pthread_create_2_1): Initialize pd.
397
398 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
399
400         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
401         waiters, awake all waiters on the associated mutex.
402
403 2005-09-22  Roland McGrath  <roland@redhat.com>
404
405         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
406         ../sysdeps/x86_64/hp-timing.h).
407
408 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
409
410         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
411         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
412         (lll_futex_wake_unlock): Define.
413         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
414         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
415         (lll_futex_wake_unlock): Define.
416         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
417         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
418         (lll_futex_wake_unlock): Define.
419         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
420         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
421         (lll_futex_wake_unlock): Define.
422         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
423         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
424         (lll_futex_wake_unlock): Define.
425         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
426         lll_futex_wake_unlock.
427         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
428         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
429         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
430         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
431         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
432         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
433
434 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
435
436         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
437         Fix typo in register name.
438
439 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
440
441         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
442         Use __sigfillset.  Document that sigfillset does the right thing wrt
443         to SIGSETXID.
444
445 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
446
447         [BZ #1102]
448         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
449         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
450         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
451         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
452         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
453         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
454         in the structure.
455         * Makefile (tests): Add tst-initializers1.
456         (CFLAGS-tst-initializers1.c): Set.
457         * tst-initializers1.c: New test.
458
459 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
460
461         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
462         Make sure __flags are located at offset 48 from the start of the
463         structure.
464
465 2005-07-02  Roland McGrath  <roland@redhat.com>
466
467         * Makeconfig: Comment fix.
468
469 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
470
471         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
472         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
473         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
474         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
475         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
476         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
477         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
478         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
479         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
480         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
481
482 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
483
484         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
485         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
486         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
487         fields.
488         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
489         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
490         field.  Put in sysinfo field unconditionally.
491         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
492         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
493         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
494         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
495         fields.
496         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
497         * pthread_create.c (__pthread_create_2_1): Use
498         THREAD_COPY_STACK_GUARD macro.
499         * Makefile: Add rules to build and run tst-stackguard1{,-static}
500         tests.
501         * tst-stackguard1.c: New file.
502         * tst-stackguard1-static.c: New file.
503
504 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
505
506         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
507         Invoke CGOTSETUP and CGOTRESTORE.
508         (CGOTSETUP, CGOTRESTORE): Define.
509
510 2005-05-29  Richard Henderson  <rth@redhat.com>
511
512         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
513         (tf_write, tf_writev): Use it.
514         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
515         the system minimum.
516
517 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
518
519         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
520         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
521         __librt_*_asynccancel@local.
522
523 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
524
525         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
526         all occurrences of JUMPTARGET.  Instead append @local to labels.
527
528 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
529
530         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
531         size/alignment of struct pthread rather than tcbhead_t.
532         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
533         Likewise.
534         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
535         Likewise.
536         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
537         Likewise.
538
539 2005-05-19  Richard Henderson  <rth@redhat.com>
540
541         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
542         __sync_val_compare_and_swap, not explicit _si variant.
543         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
544
545 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
546
547         [BZ #915]
548         * sysdeps/pthread/pthread.h: Avoid empty initializers.
549
550 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
551
552         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
553         .eh_frame section, use cfi_* directives.
554
555 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
556
557         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
558         of "" includes.
559
560 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
561
562         [BZ #1075]
563         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
564         aio_write blocks.
565
566 2005-04-27  Roland McGrath  <roland@redhat.com>
567
568         * Makefile (tests): Remove tst-clock2.
569
570         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
571         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
572         translating to the kernel clockid_t for our own process/thread clock.
573
574         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
575
576 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
577
578         * old_pthread_cond_init.c: Include <errno.h>.
579         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
580         process shared or uses clock other than CLOCK_REALTIME.
581         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
582
583 2005-04-13  David S. Miller  <davem@davemloft.net>
584
585         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
586         * sysdeps/sparc/sparc64/clone.S: New file.
587
588 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
589
590         [BZ #1102]
591         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
592         __inline instead of inline.
593         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
594
595 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
596
597         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
598         functionally equivalent, but shorter instructions.
599         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
600         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
601         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
602         Likewise.
603         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
604         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
605         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
606         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
607         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
608         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
609         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
610         Likewise.
611         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
612         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
613         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
614         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
615         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
616
617 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
618
619         * sysdeps/mips/Makefile: New file.
620         * sysdeps/mips/nptl-sysdep.S: New file.
621         * sysdeps/mips/tcb-offsets.sym: New file.
622         * sysdeps/mips/pthread_spin_lock.S: New file.
623         * sysdeps/mips/pthread_spin_trylock.S: New file.
624         * sysdeps/mips/pthreaddef.h: New file.
625         * sysdeps/mips/tls.h: New file.
626         * sysdeps/mips/jmpbuf-unwind.h: New file.
627         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
628         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
629         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
630         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
631         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
632         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
633         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
634         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
635         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
636         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
637
638 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
639
640         [BZ #1112]
641         * pthread_create.c (__pthread_create_2_1): Rename syscall error
642         variable to scerr.
643
644 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
645
646         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
647
648 2005-02-25  Roland McGrath  <roland@redhat.com>
649
650         * alloca_cutoff.c: Correct license text.
651         * tst-unload.c: Likewise.
652         * sysdeps/pthread/allocalim.h: Likewise.
653         * sysdeps/pthread/pt-initfini.c: Likewise.
654         * sysdeps/pthread/bits/libc-lock.h: Likewise.
655         * sysdeps/pthread/bits/sigthread.h: Likewise.
656         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
657         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
658
659 2005-02-16  Roland McGrath  <roland@redhat.com>
660
661         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
662         Use unsigned int * for ptr_nthreads.
663
664 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
665
666         [BZ #721]
667         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
668         gcc4.
669
670 2005-02-07  Richard Henderson  <rth@redhat.com>
671
672         [BZ #787]
673         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
674         argument.
675
676 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
677
678         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
679         order of arguments in invocation of atomic_add_zero.
680
681 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
682
683         [BZ #737]
684         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
685         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
686         at least gotntpoff relocation and addition.
687         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
688         Likewise.
689         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
690         Likewise.
691         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
692         Likewise.
693
694 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
695
696         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
697         entry for static tls deallocation fix.
698         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
699         also contains information whether the memory pointed to is static
700         TLS or not.
701         * sysdeps/i386/tls.h: Likewise.
702         * sysdeps/ia64/tls.h: Likewise.
703         * sysdeps/powerpc/tls.h: Likewise.
704         * sysdeps/s390/tls.h: Likewise.
705         * sysdeps/sh/tls.h: Likewise.
706         * sysdeps/sparc/tls.h: Likewise.
707         * sysdeps/x86_64/tls.h: Likewise.
708
709 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
710
711         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
712
713 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
714
715         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
716         %esp.
717         * Makefile (tests): Add tst-align2.
718         * tst-align2.c: New test.
719         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
720         -mpreferred-stack-boundary=4.
721
722 2004-12-18  Roland McGrath  <roland@redhat.com>
723
724         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
725         New file removed withdrawn for the moment.
726
727 2004-12-17  Richard Henderson  <rth@redhat.com>
728
729         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
730         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
731
732 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
733
734         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
735         Increased PTHREAD_STACK_MIN.
736
737         * tst-context1.c (stacks): Use bigger stack size.
738
739 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
740
741         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
742         * sysdeps/sparc/tcb-offsets.sym: Add TID.
743
744 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
745
746         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
747         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
748         * sysdeps/s390/tcb-offsets.sym (TID): Add.
749
750 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
751
752         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
753
754 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
755
756         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
757         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
758
759         * tst-getpid1.c: If child crashes, report this first.  Print which
760         signal.
761
762 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
763
764         * init.c (__pthread_initialize_minimal_internal): Also unblock
765         SIGSETXID.
766
767 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
768
769         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
770         _POSIX_THREAD_CPUTIME): Define to 0.
771         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
772         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
773         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
774         __timer_signal_thread_tclk): Remove.
775         (init_module): Remove their initialization.
776         (thread_cleanup): Remove their cleanup assertions.
777         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
778         __timer_signal_thread_tclk): Remove.
779         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
780         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
781         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
782
783 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
784
785         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
786         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
787
788         * Makefile (tests): Add tst-getpid2.
789         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
790         (do_test): Use it.  Use __clone2 instead of clone on ia64.
791         * tst-getpid2.c: New test.
792
793 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
794
795         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
796
797 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
798
799         * Makefile (tests): Add tst-getpid1.
800         * tst-getpid1.c: New file.
801         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
802         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
803
804 2004-12-02  Roland McGrath  <roland@redhat.com>
805
806         * Makefile (libpthread-nonshared): Variable removed.
807         ($(objpfx)libpthread_nonshared.a): Target removed.
808         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
809         These are now handled by generic magic from
810         libpthread-static-only-routines being set.
811
812 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
813
814         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
815         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
816         _POSIX_THREAD_PRIO_PROTECT): Define.
817         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
818         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
819         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
820
821 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
822
823         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
824         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
825         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
826         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
827         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
828         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
829         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
830
831 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
832
833         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
834
835         * Makefile (libpthread-routines): Add pthread_setschedprio.
836         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
837         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
838         * pthread_setschedprio.c: New file.
839
840 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
841
842         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
843         * pthread_cancel.c (pthread_create): Likewise.
844
845         * Makefile (libpthread-routines): Add vars.
846         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
847         * init.c (__default_stacksize, __is_smp): Remove.
848         * vars.c: New file.
849         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
850         and define a wrapper macro.
851         (PTHREAD_STATIC_FN_REQUIRE): Define.
852         * allocatestack.c (__find_thread_by_id): Undefine.
853         * pthread_create (__pthread_keys): Remove.
854         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
855         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
856         PTHREAD_STATIC_FN_REQUIRE.
857
858 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
859
860         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
861         parameter to REGISTER macro.
862
863 2004-11-17  Roland McGrath  <roland@redhat.com>
864
865         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
866         Make sure SIGCANCEL is blocked as well.
867
868 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
869
870         * sysdeps/pthread/setxid.h: New file.
871         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
872         (struct xid_command): Add forward decl.
873         (struct pthread_functions): Change return type of __nptl_setxid hook
874         to int.
875         * pthreadP.h (__nptl_setxid): Change return type to int.
876         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
877         calling thread, return its return value and set errno on failure.
878         * descr.h (struct xid_command): Change id type to long array.
879
880         * Makefile: Add rules to build and test tst-setuid1 and
881         tst-setuid1-static.
882         * tst-setuid1.c: New test.
883         * tst-setuid1-static.c: New test.
884
885 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
886
887         * Makefile (tests): Add tst-exit3.
888         * tst-exit3.c: New test.
889
890 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
891
892         * Makefile (tests): Add tst-exit2.
893         * tst-exit2.c: New file.
894
895 2004-11-09  Roland McGrath  <roland@redhat.com>
896
897         [BZ #530]
898         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
899         here, before calling clone.
900         * pthread_create.c (start_thread): Don't do it here.
901
902 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
903
904         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
905
906 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
907
908         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
909         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
910         assembler warning.
911
912 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
913
914         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
915         if sched_priority is not between minprio and maxprio.
916
917 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
918
919         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
920         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
921
922         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
923         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
924
925 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
926
927         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
928         not-cancelable I/O functions.
929
930 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
931
932         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
933         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
934         make sure 2 is stored in the futex and we looked at the old value.
935         Fix a few other problems to return the correct value.
936
937 2004-10-14  Richard Henderson  <rth@redhat.com>
938
939         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
940         make gcc4 happy.
941
942 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
943
944         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
945         of pthread-functions.h and pthreaddef.h.
946         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
947
948         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
949         Change __data.__nwaiters from int to unsigned int.
950
951         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
952         sysconf (_SC_THREAD_CPUTIME) returns negative value.
953
954         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
955         before return type.
956
957         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
958         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
959
960 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
961
962         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
963         test fails, remove message queue.
964         (tf_msgsnd): Likewise.
965
966 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
967
968         * tst-clock1.c: Change #ifdef to #if defined.
969         * tst-clock2.c: Likewise.
970         * tst-cond11.c: Likewise.
971
972         * sysdeps/pthread/timer_create.c (timer_create): Use
973         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
974         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
975         THREAD_CPUTIME.
976
977 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
978
979         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
980         _POSIX_THREAD_CPUTIME): Define to 0.
981
982 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
983
984         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
985         and _POSIX_THREAD_CPUTIME to zero.
986         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
987         * tst-barrier2.c: Fix testing for POSIX feature.
988         * tst-clock1.c: Likewise.
989         * tst-clock2.c: Likewise.
990         * tst-cond11.c: Likewise.
991         * tst-cond4.c: Likewise.
992         * tst-cond6.c: Likewise.
993         * tst-flock2.c: Likewise.
994         * tst-mutex4.c: Likewise.
995         * tst-mutex9.c: Likewise.
996         * tst-rwlock12.c: Likewise.
997         * tst-rwlock4.c: Likewise.
998         * tst-signal1.c: Likewise.
999         * tst-spin2.c: Likewise.
1000         * sysdeps/pthread/posix-timer.h: Likewise.
1001         * sysdeps/pthread/timer_create.c: Likewise.
1002         * sysdeps/pthread/timer_routines.c: Likewise.
1003
1004 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
1005
1006         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1007         (__lll_mutex_timedlock_wait): Address futex correctly.
1008
1009         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1010         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
1011         make sure 2 is stored in the futex and we looked at the old value.
1012         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1013         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
1014         which might very well made the code not working at all before.
1015         [BZ #417]
1016
1017 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
1018
1019         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
1020         allow SIGSETXID to be sent.
1021         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
1022         for SIGSETXID to be defined.
1023         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
1024         SIGSETXID cannot be blocked.
1025
1026         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1027         Add __extension__ to long long types.
1028         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1029         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1030         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1031         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1032         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1033         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1034         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1035
1036 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
1037
1038         * descr.h (struct pthread): Add stopped_start field.
1039         * sysdeps/pthread/createthread.c (create_thread): Set
1040         start_stopped flag in descriptor for new thread appropriately.
1041         * pthread_create.c (start_thread): Only take lock to be stopped on
1042         startup if stopped_start flag says so.
1043
1044 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
1045
1046         * pthread_create.c (__pthread_create_2_1): Remember whether thread
1047         is created detached and if yes, do not try to free the stack in case
1048         the thread creation failed.
1049         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
1050         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
1051         case there has been no error.  [BZ #405]
1052
1053         * pthread_create.c (start_thread): Don't wait for scheduler data
1054         etc to be set at the beginning of the function.  The cancellation
1055         infrastructure must have been set up.  And enable async
1056         cancellation before potentially going to sleep.  [BZ #401]
1057
1058 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
1059
1060         * Versions: Remove exports for pthread_set*id_np functions.
1061         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
1062         for now.
1063         * Makefile: Don't build pthread_set*id code for now.
1064
1065 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
1066
1067         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
1068         internal use.
1069         * allocatestack.c (__nptl_setxid): New function.
1070         * descr.h (struct xid_command): Define type.
1071         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
1072         (sighandler_setxid): New function.
1073         (__pthread_initialize_minimal): Register sighandler_setxid for
1074         SIGCANCEL.
1075         * pt-allocrtsig.c: Update comment.
1076         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
1077         Declare __nptl_setxid.
1078         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
1079         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
1080         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1081         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1082         and pthread_setresuid_np.
1083         * pthread_setgid_np.c: New file.
1084         * pthread_setuid_np.c: New file.
1085         * pthread_setegid_np.c: New file.
1086         * pthread_seteuid_np.c: New file.
1087         * pthread_setregid_np.c: New file.
1088         * pthread_setreuid_np.c: New file.
1089         * pthread_setresgid_np.c: New file.
1090         * pthread_setresuid_np.c: New file.
1091         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
1092         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1093         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1094         and pthread_setresuid_np.
1095         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
1096         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
1097         pthread_setregid, and pthread_setresgid.
1098
1099 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
1100
1101         * allocatestack.c (allocate_stack): Return EAGAIN instead of
1102         ENOMEM when out of memory.
1103
1104 2004-09-10  Roland McGrath  <roland@redhat.com>
1105
1106         [BZ #379]
1107         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
1108         code, since we don't try to use the broken CLONE_STOPPED any more.
1109         * pthread_create.c (start_thread): Likewise.
1110
1111 2004-09-15  Richard Henderson  <rth@redhat.com>
1112
1113         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
1114
1115 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
1116
1117         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
1118         (__libc_unwind_longjmp): Delete macro and declare as function.
1119         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
1120         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
1121         nptl directory.
1122         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
1123         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
1124         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
1125
1126 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
1127
1128         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
1129         for __USE_XOPEN2K.
1130         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
1131         types also for __USE_XOPEN2K.
1132         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1133         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1134         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1135         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1136         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1137         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1138         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1139         [BZ #320]
1140
1141 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
1142
1143         * sysdeps/pthread/pthread.h
1144         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
1145         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
1146         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
1147         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
1148         [BZ #375]
1149
1150 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
1151
1152         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
1153         PSEUDO to be used with . prefix.
1154
1155         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
1156         Use atomic_increment instead of atomic_exchange_and_add.
1157         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
1158         Likewise.
1159         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
1160         Likewise.
1161         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1162         Likewise.
1163
1164         * allocatestack.c (allocate_stack): Use atomic_increment_val
1165         instead of atomic_exchange_and_add.
1166         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
1167         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1168         Likewise.
1169         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1170         Likewise.
1171
1172         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
1173         the initialization function might throw.
1174
1175 2005-09-05  Richard Henderson  <rth@redhat.com>
1176
1177         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1178         Move definition inside libpthread, libc, librt check.  Provide
1179         definition for rtld.
1180
1181 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
1182
1183         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
1184         * sysdeps/i386/jmpbuf-unwind.h: Likewise
1185         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
1186         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
1187         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
1188         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
1189         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
1190         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
1191         * unwind.c: Use it.
1192
1193         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1194         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
1195         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1196         Likewise.
1197         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1198         Decrement __nwaiters.  If pthread_cond_destroy has been called and
1199         this is the last waiter, signal pthread_cond_destroy caller and
1200         avoid using the pthread_cond_t structure after unlock.
1201         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1202         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1203         Read clock type from the least significant bits of __nwaiters instead
1204         of __clock.
1205         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1206         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
1207
1208 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
1209
1210         [BZ #342]
1211         * Makefile (tests): Add tst-cond20 and tst-cond21.
1212         * tst-cond20.c: New test.
1213         * tst-cond21.c: New test.
1214         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1215         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
1216         it unsigned int.
1217         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1218         Likewise.
1219         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1220         (pthread_cond_t): Likewise.
1221         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1222         Likewise.
1223         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1224         Likewise.
1225         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1226         Likewise.
1227         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
1228         (cond_nwaiters): New.
1229         (clock_bits): New.
1230         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
1231         if there are waiters not signalled yet.
1232         Wait until all already signalled waiters wake up.
1233         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
1234         __nwaiters.  If pthread_cond_destroy has been called and this is the
1235         last waiter, signal pthread_cond_destroy caller and avoid using
1236         the pthread_cond_t structure after unlock.
1237         (__pthread_cond_wait): Increment __nwaiters in the beginning,
1238         decrement it when leaving.  If pthread_cond_destroy has been called
1239         and this is the last waiter, signal pthread_cond_destroy caller.
1240         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1241         Likewise.  Read clock type from the least significant bits of
1242         __nwaiters instead of __clock.
1243         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
1244         whether clock ID can be encoded in COND_CLOCK_BITS bits.
1245         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
1246         clock type just from the last COND_CLOCK_BITS bits of value.
1247         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
1248         instead of __clock, just from second bit of condattr's value.
1249
1250 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
1251
1252         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
1253         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
1254         != 64.
1255         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1256
1257 2004-08-15  Roland McGrath  <roland@frob.com>
1258
1259         * pthread_atfork.c: Update copyright terms including special exception
1260         for these trivial files, which are statically linked into executables
1261         that use dynamic linking for the significant library code.
1262
1263 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
1264
1265         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
1266         pthread_rwlock_rdlock.
1267         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
1268         Decrease __nr_readers_queued after reacquiring lock.
1269         * sysdeps/pthread/pthread_rwlock_timedrdlock
1270         (pthread_rwlock_timedrdlock): Likewise.
1271         Reported by Bob Cook <bobcook47@hotmail.com>.
1272
1273 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
1274
1275         * tst-rwlock14.c (tf): Read main thread handle from *ARG
1276         before pthread_barrier_wait.
1277
1278 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
1279
1280         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1281         Remove unnecessary exception handling data.
1282
1283 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
1284
1285         [BZ #284]
1286         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
1287         instead of clockid_t.
1288
1289 2004-07-21  Roland McGrath  <roland@redhat.com>
1290
1291         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
1292
1293 2004-07-19  Roland McGrath  <roland@redhat.com>
1294
1295         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
1296
1297 2004-07-02  Roland McGrath  <roland@redhat.com>
1298
1299         * configure: Don't exit.
1300
1301 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1302
1303         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1304         (__pthread_cond_timedwait): Check for invalid nanosecond in
1305         timeout value.
1306
1307 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
1308
1309         * Makefile: Add rules to build and run tst-fini1.
1310         * tst-fini1.c: New file.
1311         * tst-fini1mod.c: New file.
1312
1313 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
1314
1315         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
1316         if no cancellation support is needed.
1317         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1318         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1319         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1320         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1321         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1322         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1323         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1324         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1325         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1326
1327         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
1328         only if not already defined.
1329
1330 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
1331
1332         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
1333         constraint "m" instead of "0" for futex.
1334
1335         * shlib-versions: Add powerpc64-.*-linux.*.
1336
1337 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
1338
1339         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
1340         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
1341         for valid tv_nsec.
1342         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
1343         1 billion and 64-bit tv_nsec which is valid when truncated to 32
1344         bits.
1345
1346 2004-06-29  Roland McGrath  <roland@redhat.com>
1347
1348         * Banner: NPTL no longer has its own version number.
1349         * Makefile (nptl-version): Variable removed.
1350         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
1351         using $(version), the glibc version number.
1352
1353 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1354
1355         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
1356         Fix branch offset for a PLT entry.
1357         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
1358         Likewise.
1359         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1360         Likewise.
1361         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
1362         Likewise.
1363         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
1364         Likewise.
1365
1366 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1367
1368         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
1369         unconditionally.
1370
1371 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1372
1373         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1374         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
1375         instead of tv_sec.
1376         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
1377         (pthread_rwlock_timedrdlock): Likewise.
1378
1379 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
1380
1381         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1382         Set __r7 to val, not mutex.
1383
1384 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
1385
1386         * Makefile: Add rules to build tst-rwlock14.
1387         * tst-rwlock14.c: New file.
1388
1389 2004-06-24  Boris Hu  <boris.hu@intel.com>
1390
1391         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
1392         check.
1393         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1394
1395 2004-06-19  Andreas Jaeger  <aj@suse.de>
1396
1397         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
1398         assembler in last patch.
1399
1400 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
1401
1402         * sysdeps/pthread/pthread_cond_timedwait.c
1403         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
1404         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1405         (__pthread_cond_timedwait): Check for invalid nanosecond in
1406         timeout value.
1407         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1408         * tst-cond19.c: New file.
1409         * Makefile: Add rules to build and run tst-cond19.
1410
1411 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
1412
1413         * tst-context1.c (GUARD_PATTERN): Defined.
1414         (tst_context_t): Define struct containing ucontext_t & guard words.
1415         (ctx): Declare as an array of tst_context_t.
1416         (fct): Verify uc_link & guard words are still valid.
1417         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
1418
1419 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1420
1421         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1422         Add __data.__futex field, reshuffle __data.__clock.
1423         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
1424         (__pthread_cond_signal): Increment __futex at the same time as
1425         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1426         address of low 32-bits of __wakeup_seq to futex syscall.
1427         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
1428         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1429         releasing internal lock to FUTEX_WAIT.
1430         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1431         (__pthread_cond_timedwait): Likewise.
1432         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1433         (FUTEX_CMP_REQUEUE): Define.
1434         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1435         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1436         Pass __futex value from before the unlock and __futex address instead
1437         of address of low 32-bits of __wakeup_seq to futex syscall.
1438         Fallback to FUTEX_WAKE all on any errors.
1439
1440 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
1441
1442         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
1443         comment typo.
1444         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
1445         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
1446         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
1447         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
1448         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
1449
1450 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1451
1452         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
1453         Add memory clobber to inline assembly.
1454         (__lll_mutex_trylock): Likewise.
1455         (__lll_mutex_cond_trylock): Likewise.
1456
1457 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1458
1459         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1460         Pass val argument as 6th system call argument in %r7.
1461
1462 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1463
1464         * Makefile (tests): Add tst-cond16.
1465         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
1466         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
1467         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1468         Add __data.__futex field, reshuffle __data.__clock.
1469         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
1470         (__pthread_cond_signal): Increment __futex at the same time as
1471         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1472         address of low 32-bits of __wakeup_seq to futex syscall.
1473         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
1474         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1475         releasing internal lock to FUTEX_WAIT.
1476         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
1477         (__pthread_cond_timedwait): Likewise.
1478         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
1479         (FUTEX_CMP_REQUEUE): Define.
1480         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1481         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1482         Pass __futex value from before the unlock and __futex address instead
1483         of address of low 32-bits of __wakeup_seq to futex syscall.
1484         Fallback to FUTEX_WAKE all on any errors.
1485         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
1486         Define.
1487         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1488         internally.  Return non-zero if error, zero if success.
1489         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1490         Add __data.__futex field, reshuffle __data.__clock.
1491         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
1492         Define.
1493         (lll_futex_requeue): Add val argument, return 1 unconditionally
1494         for the time being.
1495         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1496         Add __data.__futex field, reshuffle __data.__clock.
1497         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1498         Define.
1499         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1500         internally.  Return non-zero if error, zero if success.
1501         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1502         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
1503         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1504         Define.
1505         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1506         internally.  Return non-zero if error, zero if success.
1507         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1508         Add __data.__futex field, reshuffle __data.__clock.
1509         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
1510         Define.
1511         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1512         internally.  Return non-zero if error, zero if success.
1513         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1514         Add __data.__futex field, reshuffle __data.__clock.
1515         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1516         Add __data.__futex field, reshuffle __data.__clock.
1517         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
1518         Increment __futex at the same time as __wakeup_seq or __total_seq.
1519         Pass address of __futex instead of address of low 32-bits of
1520         __wakeup_seq to futex syscall.
1521         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1522         Pass __futex value from before releasing internal lock
1523         to FUTEX_WAIT.
1524         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1525         Likewise.  Avoid unnecessary shadowing of variables.
1526         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
1527         Set __futex to 2 * __total_seq.  Pass __futex value from before the
1528         unlock and __futex address instead of address of low 32-bits of
1529         __wakeup_seq to futex_requeue macro, adjust for new return value
1530         meaning.
1531         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1532         (__pthread_cond_signal): Increment __futex at the same time as
1533         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1534         address of low 32-bits of __wakeup_seq to futex syscall.
1535         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1536         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1537         releasing internal lock to FUTEX_WAIT.
1538         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1539         (__pthread_cond_timedwait): Likewise.
1540         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1541         (FUTEX_CMP_REQUEUE): Define.
1542         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1543         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1544         Pass __futex value from before the unlock and __futex address instead
1545         of address of low 32-bits of __wakeup_seq to futex syscall.
1546         Fallback to FUTEX_WAKE all on any errors.
1547
1548 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1549
1550         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
1551         Add nop to align the end of critical section.
1552         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
1553
1554 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1555
1556         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1557         Add __broadcast_seq field.
1558         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
1559         all waiters as woken with woken_seq and bump broadcast counter.
1560         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
1561         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
1562         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1563         Comment typo fixes.  Avoid returning -ETIMEDOUT.
1564
1565 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
1566
1567         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1568         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
1569         Reported by Kaz Kojima.
1570
1571 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
1572
1573         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
1574
1575 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1576
1577         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
1578         __broadcast_seq with bc_seq after acquiring internal lock instead of
1579         before it.
1580
1581 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
1582
1583         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
1584         compilation.
1585         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1586         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
1587         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1588         (pthread_cond_t): Add __data.__broadcast_seq field.
1589         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1590         (FRAME_SIZE): Define.
1591         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
1592         Comment typo fixes.
1593         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
1594         Define.
1595         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
1596         typo fixes.
1597         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1598         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
1599         fixes.
1600
1601 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
1602
1603         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
1604         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1605         Add __broadcast_seq field.
1606         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1607         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1608         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1609         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1610         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1611         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
1612         all waiters as woken with woken_seq and bump broadcast counter.
1613         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
1614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
1615         __broadcast_seq field.
1616         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1617         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1618         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1619         * pthread_cond_init.c: Initialize __broadcast_seq field.
1620         * Makefile (tests): Add tst-cond17 and tst-cond18.
1621         Add .NOTPARALLEL goal.
1622         * tst-cond16.c: New file.  From Jakub.
1623         * tst-cond17.c: New file.  From Jakub.
1624         * tst-cond18.c: New file.  From Jakub.
1625
1626 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
1627
1628         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
1629         unwind info.
1630
1631         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1632         Parametrize frame size.  Correct some unwind info.
1633         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1634
1635 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
1636
1637         * tst-stack3.c: Note testing functionality beyond POSIX.
1638
1639 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
1640
1641         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
1642         Change conditional from ifdef to if.
1643
1644 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
1645
1646         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
1647         SYSDEP_CANCEL_ERROR): Define.
1648         (PSEUDO): Use it.
1649
1650 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
1651
1652         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
1653
1654 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
1655
1656         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
1657
1658 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1659
1660         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
1661         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1662         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
1663         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1664
1665 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
1666
1667         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
1668         thread has all signals blocked.
1669
1670 2004-04-18  Andreas Jaeger  <aj@suse.de>
1671
1672         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
1673         (SEM_VALUE_MAX): Add missing brace.
1674
1675 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
1676
1677         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
1678         in rt subdir.
1679         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
1680         * sysdeps/pthread/tst-mqueue8x.c: New test.
1681         * tst-cancel4.c: Update comment about message queues.
1682
1683         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
1684         return it_value { 0, 0 }.
1685         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
1686         like SIGEV_SIGNAL.
1687         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
1688         assertion for SIGEV_NONE.
1689         (thread_attr_compare): Compare all attributes, not just a partial
1690         subset.
1691
1692 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
1693
1694         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
1695
1696 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
1697
1698         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
1699         Just use a plain number.
1700         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
1701         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1702         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1703         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1704         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1705         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1706         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1707
1708 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1709
1710         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
1711         frame info.
1712         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1713
1714 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
1715
1716         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
1717         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
1718         of calling sigwaitinfo.
1719
1720 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
1721
1722         * allocatestack.c (allocate_stack): Set reported_guardsize
1723         unconditionally.
1724         * pthread_getattr_np.c (pthread_getattr_np): Use
1725         reported_guardsize instead of guardsize.
1726         * descr.h (struct pthread): Add reported_guardsize field.
1727
1728 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
1729
1730         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
1731
1732 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
1733
1734         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
1735
1736 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
1737
1738         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
1739         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
1740         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
1741         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
1742         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
1743         Define.
1744         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
1745         (_POSIX_MESSAGE_PASSING): Define.
1746         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
1747         (_POSIX_MESSAGE_PASSING): Define.
1748         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
1749         (_POSIX_MESSAGE_PASSING): Define.
1750
1751 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
1752
1753         * tst-context1.c (fct): Check whether correct stack is used.
1754
1755 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
1756
1757         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
1758         matching constraints for asm mem parameters.
1759
1760         * tst-clock2.c (tf): Don't define unless needed.
1761
1762 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
1763
1764         * Makefile (link-libc-static): Use $(static-gnulib) instead of
1765         $(gnulib).
1766
1767 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
1768
1769         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
1770         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
1771         * pthreadP.h: Declare __nptl_deallocate_tsd.
1772         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
1773         Adjust caller.
1774
1775         * Makefile (tests): Add tst-tsd5.
1776         * tst-tsd5.c: New file.
1777
1778 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
1779
1780         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1781         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
1782         is SHLIB_COMPAT check.
1783         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1784         (__pthread_attr_getaffinity_old): Likewise.
1785         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1786         (__pthread_getaffinity_old): Likewise.
1787         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1788         (__pthread_setaffinity_old): Likewise.
1789
1790 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
1791
1792         * allocatestack.c (_make_stacks_executable): Call
1793         _dl_make_stack_executable first.
1794
1795 2004-03-24  Roland McGrath  <roland@redhat.com>
1796
1797         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
1798         constraint instead of "0".
1799
1800 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
1801
1802         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1803         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
1804
1805         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
1806         code to avoid warning.
1807
1808 2004-03-24  Andreas Jaeger  <aj@suse.de>
1809
1810         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1811         (__pthread_attr_setaffinity_old): Remove const.
1812
1813 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
1814
1815         * sysdeps/unix/sysv/linux/smp.h: New file.
1816         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
1817         * init.c: Define __is_smp.
1818         (__pthread_initialize_minimal_internal): Call is_smp_system to
1819         initialize __is_smp.
1820         * pthreadP.h: Declare __is_smp.
1821         Define MAX_ADAPTIVE_COUNT is necessary.
1822         * pthread_mutex_init.c: Add comment regarding __spins field.
1823         * pthread_mutex_lock.c: Implement adaptive mutex type.
1824         * pthread_mutex_timedlock.c: Likewise.
1825         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1826         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
1827         Add __spins field.
1828         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1829         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1830         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1831         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1832         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1833         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1834         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1835         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
1836         lll_mutex_cond_trylock.
1837         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1838         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1839         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1840         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1841         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1842         Define BUSY_WAIT_NOP.
1843         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1844         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1845
1846         * tst-mutex5.c: Add support for testing adaptive mutexes.
1847         * tst-mutex7.c: Likewise.
1848         * tst-mutex5a.c: New file.
1849         * tst-mutex7a.c: New file.
1850         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
1851
1852         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1853         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
1854         vgettimeofday call might destroy the content.
1855
1856         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
1857         @pause in the loop.
1858
1859         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
1860         No need to restrict type of ret.  Make it int.  Add comment.
1861
1862         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
1863         Remove unnecessary setne instruction.
1864
1865 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
1866
1867         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1868         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
1869         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
1870         If realloc fails, break out of the loop.
1871
1872 2004-03-20  Andreas Jaeger  <aj@suse.de>
1873
1874         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1875         (__pthread_setaffinity_old): Fix interface.
1876         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1877         (__pthread_getaffinity_old): Likewise.
1878
1879         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1880         (__pthread_setaffinity_new): Remove duplicate declaration.
1881
1882 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1883
1884         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
1885         the return value to a safe register.
1886         (CDISABLE): Set the function argument correctly.
1887
1888 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1889
1890         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
1891         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
1892         Rewrite so that only one locked memory operation per round is needed.
1893         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
1894         (pthread_barrier_wait): After wakeup, release lock only when the
1895         last thread stopped using the barrier object.
1896         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
1897         (__pthread_cond_wait): Don't store mutex address if the current
1898         value is ~0l.  Add correct cleanup support and unwind info.
1899         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1900         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1901         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
1902         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
1903         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
1904         Add correct cleanup support and unwind info.
1905         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
1906         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
1907         information for syscall wrappers.
1908
1909 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
1910
1911         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
1912         cpusetsize field, remove next.
1913         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
1914         parameter for size of the CPU set.
1915         (pthread_setaffinity_np): Likewise.
1916         (pthread_attr_getaffinity_np): Likewise.
1917         (pthread_attr_setaffinity_np): Likewise.
1918         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
1919         interface change, keep compatibility code.
1920         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
1921         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
1922         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
1923         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
1924         __pthread_getaffinity_np.
1925         * Versions: Add version for changed interfaces.
1926         * tst-attr3.c: Adjust test for interface change.
1927         * pthread_getattr_np.c: Query the kernel about the affinity mask with
1928         increasing buffer sizes.
1929         * pthread_attr_destroy.c: Remove unused list handling.
1930         * pthread_attr_init.c: Likewise.
1931
1932 2004-03-17  Roland McGrath  <roland@redhat.com>
1933
1934         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
1935         first argument to clock_getres so we ever enable kernel timers.
1936
1937 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
1938
1939         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
1940
1941 2004-03-12  Richard Henderson  <rth@redhat.com>
1942
1943         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
1944         oldvalue from CENABLE to CDISABLE.
1945
1946 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
1947
1948         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
1949         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1950         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1951         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1952
1953 2004-03-11  Richard Henderson  <rth@redhat.com>
1954
1955         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
1956         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
1957         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
1958
1959 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1960
1961         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
1962         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
1963         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
1964
1965 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1966
1967         * forward.c (__pthread_cond_broadcast_2_0,
1968         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
1969         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
1970         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
1971
1972 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1973
1974         * sysdeps/sh/tcb-offsets.sym: Add PID.
1975         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
1976         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
1977
1978 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
1979
1980         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
1981         include <sysdep-cancel.h>, vfork is no cancellation point.
1982         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
1983         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
1984         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
1985
1986 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
1987
1988         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
1989         libc_hidden_def.
1990         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
1991         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
1992         Likewise.
1993         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
1994         Likewise.
1995         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
1996         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
1997         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
1998         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
1999         of DO_CALL_VIA_BREAK.  Work around a gas problem.
2000
2001         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
2002         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
2003         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
2004         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
2005         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
2006         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
2007
2008         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
2009         a local register for saving old PID.  Negate PID in parent upon exit.
2010
2011         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
2012         tcb-offsets.h.
2013         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2014         before syscall, set to the old value in the parent afterwards.
2015         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
2016         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
2017         tcb-offsets.h.
2018         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2019         before syscall, set to the old value in the parent afterwards.
2020         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
2021         * sysdeps/s390/tcb-offsets.sym: Add PID.
2022
2023         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
2024         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
2025         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
2026         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
2027         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
2028         * sysdeps/sparc/tcb-offsets.sym: Add PID.
2029
2030 2004-03-10  Andreas Schwab  <schwab@suse.de>
2031
2032         * sysdeps/ia64/tcb-offsets.sym: Add PID.
2033         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
2034         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
2035
2036 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
2037
2038         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
2039         * tst-cancel21.c (do_one_test): Likewise.
2040         Reported by Gordon Jin <gordon.jin@intel.com>.
2041
2042 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
2043
2044         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
2045         if non-zero and set to INT_MIN if zero.
2046         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
2047         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
2048         (SAVE_PID, RESTORE_PID): Define.
2049         (__vfork): Use it.
2050         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
2051         Use relative path to avoid including NPTL i386/vfork.S.
2052         (SAVE_PID, RESTORE_PID): Define.
2053         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
2054         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
2055         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
2056         tst-vfork2x.
2057         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
2058         * tst-vfork1.c: New test.
2059         * tst-vfork2.c: New test.
2060         * tst-vfork1x.c: New test.
2061         * tst-vfork2x.c: New test.
2062
2063 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
2064
2065         * sysdeps/i386/tcb-offsets.sym: Add PID.
2066         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2067         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
2068         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
2069
2070 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
2071
2072         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
2073
2074 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2075
2076         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2077         _rtld_global_ro.
2078
2079 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
2080
2081         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2082         _rtld_global_ro.
2083
2084         * tst-once4.c: Remove unnecessary macro definition.
2085
2086         * tst-mutex7.c (do_test): Limit thread stack size.
2087         * tst-once2.c (do_test): Likewise.
2088         * tst-tls3.c (do_test): Likewise.
2089         * tst-tls1.c (do_test): Likewise.
2090         * tst-signal3.c (do_test): Likewise.
2091         * tst-kill6.c (do_test): Likewise.
2092         * tst-key4.c (do_test): Likewise.
2093         * tst-join4.c (do_test): Likewise.
2094         * tst-fork1.c (do_test): Likewise.
2095         * tst-context1.c (do_test): Likewise.
2096         * tst-cond2.c (do_test): Likewise.
2097         * tst-cond10.c (do_test): Likewise.
2098         * tst-clock2.c (do_test): Likewise.
2099         * tst-cancel10.c (do_test): Likewise.
2100         * tst-basic2.c (do_test): Likewise.
2101         * tst-barrier4.c (do_test): Likewise.
2102
2103 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
2104
2105         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
2106
2107 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
2108
2109         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2110         (__pthread_cond_timedwait): Optimize wakeup test.
2111         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2112         (__pthread_cond_wait): Likewise.
2113         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2114         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2115         Likewise.
2116
2117 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
2118
2119         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2120         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
2121         the atomic instruction needed.
2122         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2123         (__lll_mutex_lock_wait): Likewise.
2124
2125 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
2126
2127         * Makefile (tests): Add tst-cond14 and tst-cond15.
2128         * tst-cond14.c: New file.
2129         * tst-cond15.c: New file.
2130
2131 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
2132
2133         * sysdeps/pthread/createthread.c (create_thread): Remove use of
2134         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
2135         needs to be implemented differently to be useful.
2136
2137 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
2138
2139         * pthread_attr_setschedparam.c: Don't test priority against limits
2140         here.  Set ATTR_FLAG_SCHED_SET flag.
2141         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
2142         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
2143         from parent thread to child.  If attribute is used and scheduling
2144         parameters are not inherited, copy parameters from attribute or
2145         compute them.  Check priority value.
2146         * pthread_getschedparam.c: If the parameters aren't known yet get
2147         them from the kernel.
2148         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
2149         ATTR_FLAG_POLICY_SET flag for thread.
2150         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
2151         and ATTR_FLAG_POLICY_SET.
2152
2153         * sysdeps/pthread/createthread.c: Use tgkill if possible.
2154
2155         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
2156         fail if stack address hasn't been set.  Just return 0.
2157
2158 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
2159
2160         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
2161         libpthread for the files in this list.
2162         (CFLAGS-tst-unload): Removed.
2163         * tst-unload.c (do_test): Don't use complete path for
2164         LIBPHREAD_SO.
2165
2166         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
2167         tst-_res1mod2.
2168
2169 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
2170
2171         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2172         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
2173         operation per round is needed.
2174         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2175         (__lll_mutex_lock_wait): Likewise.
2176
2177 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
2178
2179         * tst-cancel9.c (cleanup): Don't print to stderr.
2180
2181 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2182
2183         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
2184
2185 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
2186
2187         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2188         (__syscall_error_handler2): Call CDISABLE.
2189         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2190         (__syscall_error_handler2): Call CDISABLE.
2191
2192         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2193         Release lock before the loop, don't reacquire it.
2194
2195         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
2196
2197 2004-02-19  Andreas Schwab  <schwab@suse.de>
2198
2199         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2200         Fix last change.
2201
2202 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
2203
2204         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
2205         (pthread_barrier_wait): After wakeup, release lock only when the
2206         last thread stopped using the barrier object.
2207         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
2208         (pthread_barrier_wait): Likewise.
2209         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2210         Likewise.
2211         * Makefile (tests): Add tst-barrier4.
2212         * tst-barrier4.c: New file.
2213
2214         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2215         (__pthread_cond_timedwait): Perform timeout test while holding
2216         internal lock to prevent wakeup race.
2217         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2218         * sysdeps/pthread/pthread_cond_timedwait.c
2219         (__pthread_cond_timedwait): Likewise.
2220         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2221         (__pthread_cond_timedwait): Likewise.
2222
2223 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
2224
2225         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
2226         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
2227         * Makefile (tests): Add tst-rwlock13.
2228         * tst-rwlock13.c: New test.
2229
2230 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
2231
2232         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2233         (__condvar_tw_cleanup): Little optimization.
2234         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2235
2236 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
2237
2238         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
2239         libpthread as "lib" parameter to SHLIB_COMPAT.
2240         (__novmx_siglongjmp): Fix typo in function name.
2241         (__novmx_longjmp): Fix typo in function name.
2242
2243 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2244
2245         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
2246         __builtin_expect.
2247
2248         * sysdeps/generic/pt-longjmp.c: Moved to...
2249         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
2250
2251 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
2252
2253         * Makefile (libpthread-routines): Add pt-cleanup.
2254         * pt-longjmp.c: Removed.
2255         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
2256         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
2257         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
2258         Version longjmp, siglongjmp for GLIBC_2.3.4.
2259         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
2260
2261 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2262
2263         * sysdeps/pthread/pthread_cond_timedwait.c
2264         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
2265         Reuse code.  Add __builtin_expects.
2266
2267         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2268         (__pthread_cond_timedwait): Get internal lock in case timeout has
2269         passed before the futex syscall.
2270         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2271
2272 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
2273
2274         * allocatestack.c: Pretty printing.
2275
2276         * sysdeps/pthread/createthread.c (create_thread): Don't add
2277         CLONE_DETACHED bit if it is not necessary.
2278
2279 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
2280
2281         * pthread_getattr_np.c: Include ldsodefs.h.
2282
2283 2004-01-16  Richard Henderson  <rth@redhat.com>
2284
2285         * allocatestack.c: Don't declare __libc_stack_end.
2286         * init.c (__pthread_initialize_minimal_internal): Likewise.
2287         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
2288
2289 2004-01-15  Richard Henderson  <rth@redhat.com>
2290
2291         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
2292         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
2293         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
2294         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
2295         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
2296         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
2297         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
2298         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
2299
2300 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
2301
2302         * init.c (pthread_functions): Make array const.
2303
2304 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
2305
2306         * allocatestack.c (__make_stacks_executable): Change interface.
2307         Check parameters.  Pass parameter on to libc counterpart.
2308         * pthreadP.h: Change declaration.
2309
2310 2004-01-13  Richard Henderson  <rth@redhat.com>
2311
2312         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
2313         prototype form.
2314         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
2315         Likewise.
2316
2317         * sysdeps/alpha/Makefile: New file.
2318         * sysdeps/alpha/tcb-offsets.sym: New file.
2319         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2320         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
2321
2322         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
2323         on powerpc version.
2324
2325 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
2326
2327         * Makefile (tests): Add tst-backtrace1.
2328         * tst-backtrace1.c: New test.
2329
2330 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
2331
2332         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
2333         register as second parameter to the REGISTER macro.
2334         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
2335         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
2336         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
2337         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
2338         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
2339         of thread register as second parameter to REGISTER macro in 64 case.
2340
2341 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
2342
2343         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
2344         (CFLAGS-getpid.o): Defined.
2345         (CFLAGS-getpid.os): Defined.
2346
2347 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
2348
2349         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
2350         returned for main thread does not overlap with any other VMA.
2351         Patch by Jakub Jelinek.
2352
2353 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
2354
2355         * tst-raise1.c: Include stdio.h.
2356
2357 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
2358
2359         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
2360         setting with __ASSUME_TGKILL || defined __NR_tgkill.
2361         If pid is 0, set it to selftid.
2362         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
2363         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
2364         != 0, return self->tid without doing a syscall.
2365         * descr.h (struct pthread): Move pid field after tid.
2366
2367         * Makefile (tests): Add tst-raise1.
2368         * tst-raise1.c: New file.
2369
2370 2003-12-23  Roland McGrath  <roland@redhat.com>
2371
2372         * tst-oddstacklimit.c: New file.
2373         * Makefile (tests): Add it.
2374         (tst-oddstacklimit-ENV): New variable.
2375
2376         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
2377         value up to page size for __default_stacksize.
2378
2379 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
2380
2381         * Makefile (tests): Add tst-eintr5.
2382         * tst-eintr5.c: New file.
2383
2384         * eintr.c (eintr_source): Prevent sending signal to self.
2385
2386         * tst-eintr2.c (tf1): Improve error message.
2387
2388 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
2389
2390         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
2391         * sysdeps/unix/sysv/linux/getpid.c: New file.
2392         * pthread_cancel.c: Add comment explaining use of PID field.
2393         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2394         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
2395         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
2396         temporarily to signal the field must not be relied on and updated
2397         by getpid().
2398         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
2399         temporarily negative.
2400         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2401
2402 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
2403
2404         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
2405         (eintr_source): If ARG != NULL, use pthread_kill.
2406         * tst-eintr1.c: Adjust for this change.
2407         * tst-eintr2.c: Likewise.
2408         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
2409         * tst-eintr3.c: New file.
2410         * tst-eintr4.c: New file.
2411
2412 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
2413
2414         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
2415         if CANCELSTATE_BITMASK is set.
2416         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
2417         Likewise.
2418
2419         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
2420         (tests-reverse): Add tst-cancel23.
2421         * tst-cancel22.c: New test.
2422         * tst-cancel23.c: New test.
2423
2424 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
2425
2426         * tst-eintr1.c: Better error messages.
2427
2428         * Makefile (tests): Add tst-eintr2.
2429         * tst-eintr2.c: New file.
2430
2431 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
2432
2433         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
2434         (CFLAGS-tst-cancelx21.c): Set.
2435         * tst-cancel21.c: New test.
2436         * tst-cancelx21.c: New test.
2437
2438         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
2439         comparison operand.
2440         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
2441         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
2442         * pt-longjmp.c: Include jmpbuf-unwind.h.
2443         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
2444         _JMPBUF_UNWINDS.  Adjust compared pointers.
2445         * init.c (__pthread_initialize_minimal_internal): Initialize
2446         pd->stackblock_size.
2447         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
2448         * sysdeps/alpha/jmpbuf-unwind.h: New file.
2449         * sysdeps/i386/jmpbuf-unwind.h: New file.
2450         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
2451         * sysdeps/s390/jmpbuf-unwind.h: New file.
2452         * sysdeps/sh/jmpbuf-unwind.h: New file.
2453         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
2454         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
2455         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
2456         (_JMPBUF_CFA_UNWINDS): Remove.
2457         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
2458
2459 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
2460
2461         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
2462         (CFLAGS-tst-cancelx20.c): Set.
2463         * tst-cancel20.c: New test.
2464         * tst-cancelx20.c: New test.
2465
2466 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
2467
2468         * init.c (__pthread_initialize_minimal_internal): Don't treat
2469         architectures with separate register stack special here when
2470         computing default stack size.
2471
2472 2003-12-17  Roland McGrath  <roland@redhat.com>
2473
2474         * Makefile (tst-cancelx7-ARGS): New variable.
2475         Reportd by Greg Schafer <gschafer@zip.com.au>.
2476
2477 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
2478
2479         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
2480         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
2481         (tst-stack3-ENV): Set.
2482         ($(objpfx)tst-stack3-mem): New.
2483         * tst-stack3.c: New test.
2484
2485 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
2486
2487         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
2488         Add unwind directives.  Drop unused .regstk directive.
2489         (_fini_EPILOG_BEGINS): Add unwind directives.
2490
2491 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
2492
2493         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2494         Assume parameter is a pointer.
2495         (lll_futex_wake): Likewise.
2496         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
2497         Likewise.
2498         (lll_futex_wake): Likewise.
2499         Reported by Boris Hu.
2500         * sysdeps/unix/sysv/linux/unregister-atfork.c
2501         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
2502
2503         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
2504
2505 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
2506
2507         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
2508         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
2509         __rtld_lock_initialize for ld.so lock.
2510         Patch in part by Adam Li <adam.li@intel.com>.
2511
2512 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
2513
2514         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
2515         in $(gnulib).  Also, remove stale comment.
2516
2517 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
2518
2519         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
2520         advantage of new syscall stub and optimize accordingly.
2521
2522         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
2523         from SYS_futex, to match expectations of
2524         sysdep.h:DO_INLINE_SYSCALL.
2525         (lll_futex_clobbers): Remove.
2526         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
2527         (lll_futex_wake): Likewise.
2528         (lll_futex_requeue): Likewise.
2529         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
2530         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
2531         Jelinek).
2532         (__lll_mutex_lock): Likewise.
2533         (__lll_mutex_cond_lock): Likewise.
2534         (__lll_mutex_timed_lock): Likewise.
2535         (__lll_mutex_unlock): Likewise.
2536         (__lll_mutex_unlock_force): Likewise.
2537
2538         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
2539         comes before the include of <sysdep.h>.
2540         (THREAD_SELF_SYSINFO): New macro.
2541         (THREAD_SYSINFO): Likewise.
2542         (INIT_SYSINFO): New macro.
2543         (TLS_INIT_TP): Call INIT_SYSINFO.
2544
2545         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
2546
2547         * sysdeps/pthread/createthread.c (create_thread): Use
2548         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
2549         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
2550         THREAD_SELF_SYSINFO instead of open code.
2551         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
2552         (THREAD_SYSINFO): Likewise.
2553
2554         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
2555
2556         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
2557
2558 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
2559
2560         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
2561         instead of .init.  Patch by David Mosberger.
2562
2563 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
2564
2565         * sysdeps/pthread/configure.in: Remove broken declaration in C
2566         cleanup handling check.
2567
2568 2003-11-30  Andreas Jaeger  <aj@suse.de>
2569
2570         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
2571         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
2572         Likewise.
2573
2574 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
2575
2576         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
2577         * pthread_attr_destroy.c: Include shlib-compat.h.
2578         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
2579         is set in iattr->flags.
2580         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
2581
2582 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
2583
2584         * Makefile (distribute): Add tst-cleanup4aux.c.
2585
2586         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
2587         include.
2588
2589 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
2590
2591         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
2592         pthread_cond_signal.
2593
2594         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
2595         store mutex address if the current value is ~0l.
2596         * sysdeps/pthread/pthread_cond_timedwait.c
2597         (__pthread_cond_timedwait): Likewise.
2598         * sysdeps/pthread/pthread_cond_broadcast.c
2599         (__pthread_cond_broadcast): Don't use requeue for pshared
2600         condvars.
2601
2602         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2603         (__pthread_cond_wait): Don't store mutex address if the current
2604         value is ~0l.
2605         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2606         (__pthread_cond_timedwait): Likewise.
2607         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2608         (__pthread_cond_broadcast): Don't use requeue for pshared
2609         condvars.
2610
2611         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
2612         element with ~0l for pshared condvars, with NULL otherwise.
2613
2614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2615         (__pthread_cond_wait): Don't store mutex address if the current
2616         value is ~0l.
2617         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2618         (__pthread_cond_timedwait): Likewise.
2619         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2620         (__pthread_cond_broadcast): Don't use requeue for pshared
2621         condvars.
2622
2623         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
2624         * tst-cond12.c: New file.
2625         * tst-cond13.c: New file.
2626
2627 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
2628
2629         * sysdeps/pthread/configure.in: Make missing forced unwind support
2630         fatal.
2631
2632 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
2633
2634         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
2635
2636 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
2637
2638         * Makefile: Add magic to clean up correctly.
2639
2640 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
2641
2642         * unwind.c (FRAME_LEFT): Define.
2643         (unwind_stop): Handle old style cleanups here.
2644         (__pthread_unwind): Handle old style cleanups only if
2645         !HAVE_FORCED_UNWIND.
2646         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
2647         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
2648         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
2649         ($(objpfx)tst-cleanupx4): Likewise.
2650         * tst-cleanup4.c: New test.
2651         * tst-cleanup4aux.c: New.
2652         * tst-cleanupx4.c: New test.
2653
2654 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
2655
2656         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
2657         lll_mutex_*lock macros to skip atomic operations on some archs.
2658
2659 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
2660
2661         * sysdeps/pthread/tst-timer.c (main): Initialize
2662         sigev2.sigev_value as well.
2663
2664 2003-10-15  Roland McGrath  <roland@redhat.com>
2665
2666         * sysdeps/pthread/configure.in: Barf if visibility attribute support
2667         is missing.
2668         * sysdeps/pthread/configure: Regenerated.
2669
2670 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2671
2672         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
2673         locking macros.  No distinction between normal and mutex locking
2674         anymore.
2675         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
2676         Merge bits from lowlevelmutex.S we still need.
2677         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
2678         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
2679         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
2680         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
2681         new mutex implementation.
2682         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
2683         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
2684         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2685         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2686         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
2687         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2688         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2689         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2690         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2691         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
2692         symbol for entry point to avoid cancellation.
2693
2694 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
2695
2696         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
2697         changes.
2698         (SAVE_OLDTYPE_0): Fix a typo.
2699
2700 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
2701
2702         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2703         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
2704
2705 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
2706
2707         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
2708         correct offset.
2709
2710 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
2711
2712         * Makefile (tests): Add tst-cancel19.
2713         * tst-cancel19.c: New test.
2714
2715 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
2716
2717         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
2718         restoring of the old cancellation type.
2719
2720 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
2721
2722         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
2723
2724 2003-09-27  Wolfram Gloger  <wg@malloc.de>
2725
2726         * sysdeps/pthread/malloc-machine.h: New file
2727
2728 2003-09-24  Roland McGrath  <roland@redhat.com>
2729
2730         * allocatestack.c (__make_stacks_executable): Don't ignore return
2731         value from _dl_make_stack_executable.
2732
2733 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
2734
2735         * allocatestack.c (__make_stacks_executable): Also change
2736         permission of the currently unused stacks.
2737
2738         * allocatestack.c (change_stack_perm): Split out from
2739         __make_stacks_executable.
2740         (allocate_stack): If the required permission changed between the time
2741         we started preparing the stack and queueing it, change the permission.
2742         (__make_stacks_executable): Call change_stack_perm.
2743
2744         * Makefile: Build tst-execstack-mod locally.
2745         * tst-execstack-mod.c: New file.
2746
2747 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
2748
2749         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
2750
2751 2003-09-23  Roland McGrath  <roland@redhat.com>
2752
2753         * tst-execstack.c: New file.
2754         * Makefile (tests): Add it.
2755         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
2756         (LDFLAGS-tst-execstack): New variable.
2757
2758         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
2759         whether to use PROT_EXEC for stack mmap.
2760         (__make_stacks_executable): New function.
2761         * pthreadP.h: Declare it.
2762         * init.c (__pthread_initialize_minimal_internal): Set
2763         GL(dl_make_stack_executable_hook) to that.
2764
2765 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
2766
2767         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
2768         recommendation from AMD re avoidance of lock prefix.
2769
2770 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
2771
2772         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
2773         lll_futex_timed_wait instead of lll_futex_wait.
2774         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
2775         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
2776         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
2777         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
2778         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
2779         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
2780         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
2781         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
2782         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
2783         Completely revamp the locking macros.  No distinction between
2784         normal and mutex locking anymore.
2785         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2786         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
2787         __lll_lock_timedwait): Fix prototypes.
2788         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
2789         __lll_lock_timedwait): Likewise.
2790         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
2791         macros, add __builtin_expect.
2792         (lll_mutex_timedlock): Likewise.  Fix return value.
2793         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
2794         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
2795         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
2796         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
2797         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
2798         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
2799         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
2800         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
2801
2802 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
2803
2804         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2805         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
2806         operation if possible.
2807
2808         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
2809         like jumping over the lock prefix.
2810
2811 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
2812
2813         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
2814         locking macros.  No distinction between normal and mutex locking
2815         anymore.
2816         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2817         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2818         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2819         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
2820         locking.  Merge bits from lowlevelmutex.S we still need.
2821         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2822         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2823         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
2824         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
2825         * Makefile (routines): Remove libc-lowlevelmutex.
2826         (libpthread-rountines): Remove lowlevelmutex.
2827         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
2828         for new mutex implementation.
2829         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2830         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2831         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2832         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2833         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2834         Likewise.
2835         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2836         Likewise.
2837         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2838         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2839         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
2840         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
2841         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2842         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2843         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2844         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2845         Likewise.
2846         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2847         Likewise.
2848         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2849         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2850         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2851         Don't use requeue.
2852         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2853         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
2854
2855 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
2856
2857         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
2858         in parameters of asm with output parameters.
2859
2860         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
2861         type of DECR parameter to int.
2862         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
2863
2864 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
2865
2866         * tst-attr3.c (tf, do_test): Print stack start/end/size and
2867         guardsize for each thread.
2868
2869 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
2870
2871         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
2872         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2873         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
2874
2875         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
2876         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
2877         NULL.
2878         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
2879         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
2880         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2881         (pthread_getaffinity_np): Add hidden_def.
2882
2883         * Makefile (tests): Add tst-attr3.
2884         * tst-attr3.c: New test.
2885
2886         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
2887
2888 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
2889
2890         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
2891         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
2892
2893 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
2894
2895         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
2896         * tst-align.c: Include tst-stack-align.h.
2897         (tf, do_test): Use TEST_STACK_ALIGN macro.
2898
2899 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
2900
2901         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
2902         variable.
2903
2904 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
2905
2906         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
2907         stack-related values for the initial thread.
2908
2909 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
2910
2911         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
2912
2913 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
2914
2915         * pthread_mutex_lock.c: Minor code rearrangements.
2916
2917 2003-09-05  Roland McGrath  <roland@redhat.com>
2918
2919         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
2920         Instead, include ../nptl_db/db_info.c to do its magic.
2921         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
2922         (__pthread_pthread_key_2ndlevel_size): Likewise.
2923         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
2924         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
2925         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
2926         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
2927         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
2928         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
2929         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
2930         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
2931         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
2932         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
2933         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
2934         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
2935         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
2936         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
2937         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
2938         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
2939         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
2940
2941 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
2942
2943         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
2944         of pthread_t to be compatible with LT.
2945         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2946         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2947         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2948         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2949         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
2950         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2951         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2952
2953 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
2954
2955         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
2956
2957 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
2958
2959         * unwind-forcedunwind.c: Move to...
2960         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
2961         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
2962         * sysdeps/pthread/jmpbuf-unwind.h: New file.
2963         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
2964         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
2965         * unwind.c: Include jmpbuf-unwind.h.
2966         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
2967
2968 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
2969
2970         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
2971         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
2972         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
2973         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
2974         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2975         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
2976         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
2977         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
2978         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
2979         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
2980         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
2981         function.
2982         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
2983         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
2984         * Makefile (tests): Add tst-stack2.
2985         * tst-stack2.c: New test.
2986         * tst-stack1.c: Include limits.h and sys/param.h.
2987         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
2988
2989         * pthread_condattr_setpshared.c: Include errno.h.
2990         (pthread_condattr_setpshared): Return EINVAL if pshared
2991         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
2992
2993         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
2994         defined symbol for entry point to avoid cancellation.
2995         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2996         Likewise.
2997         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
2998         Likewise.
2999         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3000         Likewise.
3001         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
3002         Likewise.
3003         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3004         Likewise.
3005         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
3006         __close_nocancel, __read_nocancel, __write_nocancel,
3007         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
3008         libpthread.so or librt.so, define to corresponding function
3009         without _nocancel suffix.
3010         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
3011         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
3012         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
3013
3014         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
3015
3016 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
3017
3018         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
3019         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
3020
3021         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
3022         in subsections has a symbol associated with it.
3023
3024         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
3025         defined symbol for entry point to avoid cancellation.
3026         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
3027
3028 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3029
3030         * Makefile (tests): Add tst-tls5.
3031         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
3032         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
3033         ($(objpfx)tst-tls5): New.
3034         ($(objpfx)tst-tls6.out): Likewise.
3035         (tests): Depend on $(objpfx)tst-tls6.out.
3036         * tst-tls3.c: Include stdint.h and pthreaddef.h.
3037         (do_test): Check pthread_self () return value alignment.
3038         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
3039         (tf): Check pthread_self () return value alignment.
3040         * tst-tls5.c: New test.
3041         * tst-tls5.h: New.
3042         * tst-tls5mod.c: New.
3043         * tst-tls5moda.c: New.
3044         * tst-tls5modb.c: New.
3045         * tst-tls5modc.c: New.
3046         * tst-tls5modd.c: New.
3047         * tst-tls5mode.c: New.
3048         * tst-tls5modf.c: New.
3049         * tst-tls6.sh: New test.
3050
3051         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
3052         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
3053         * init.c (pthread_functions): Initialize them.
3054         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
3055         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
3056         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
3057         pthread_cond_timedwait@@GLIBC_2.3.2.
3058
3059 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3060
3061         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
3062         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
3063         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
3064         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
3065         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
3066         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
3067
3068         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
3069
3070         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
3071         _POSIX_THREAD_PRIORITY_SCHEDULING.
3072         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3073
3074 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
3075
3076         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
3077         nested function, use static inline function from libio.h.
3078         Code by Richard Henderson.
3079
3080         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
3081         weak.
3082
3083 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
3084
3085         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
3086         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
3087         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
3088         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
3089         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
3090         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
3091         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
3092         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
3093         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
3094         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
3095         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
3096         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
3097         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
3098         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
3099         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
3100         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
3101         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
3102         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
3103         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
3104         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
3105         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
3106         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
3107         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
3108         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
3109         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
3110         * sysdeps/sparc/tls.h: New file.
3111         * sysdeps/sparc/tcb-offsets.sym: New file.
3112         * sysdeps/sparc/Makefile: New file.
3113         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
3114         * init.c [__sparc__] (__NR_set_tid_address): Define.
3115
3116 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
3117
3118         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
3119         _IO_release_lock): Define.
3120
3121 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
3122
3123         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
3124         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
3125
3126 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
3127
3128         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
3129         (__pthread_cleanup_class): Add missing return types of member
3130         functions.
3131
3132 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
3133
3134         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3135         (lll_mutex_unlock_force): Add memory barrier between store and futex
3136         syscall.
3137
3138 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
3139
3140         * tst-cancel4.c (do_test): Also unlink tempfname and remove
3141         tempmsg in first loop.
3142
3143 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
3144
3145         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3146         _POSIX_THREAD_PRIORITY_SCHEDULING.
3147         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3148
3149 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3150
3151         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
3152         (__rtld_lock_default_lock_recursive,
3153         __rtld_lock_default_unlock_recursive): Define.
3154         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
3155         __rtld_lock_unlock_recursive): Define using
3156         GL(_dl_rtld_*lock_recursive).
3157         * init.c (__pthread_initialize_minimal_internal): Initialize
3158         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
3159         Lock GL(_dl_load_lock) the same number of times as
3160         GL(_dl_load_lock) using non-mt implementation was nested.
3161
3162         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
3163         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
3164
3165 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
3166
3167         * tst-cancel17.c (do_test): Make len2 maximum of page size and
3168         PIPE_BUF.
3169
3170 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3171
3172         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
3173
3174 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
3175
3176         * sysdeps/pthread/createthread.c (do_clone): Move error handling
3177         to first syscall error check.  Move syscall error check for tkill
3178         into __ASSUME_CLONE_STOPPED #ifdef.
3179
3180 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
3181
3182         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
3183         is not defined, do explicit synchronization.
3184         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
3185         is not defined also unlock pd->lock for non-debugging case in case
3186         it is necessary.
3187         * pthread_create.c (start_thread): Always get and release pd->lock
3188         if __ASSUME_CLONE_STOPPED is not defined.
3189         (start_thread_debug): Removed.  Adjust users.
3190         * allocatestack.c (allocate_stack): Always initialize lock if
3191         __ASSUME_CLONE_STOPPED is not defined.
3192         * Makefile (tests): Add tst-sched1.
3193         * tst-sched1.c: New file.
3194
3195         * sysdeps/pthread/createthread.c (do_clone): Only use
3196         sched_setschduler and pass correct parameters.
3197
3198 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3199
3200         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
3201         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
3202         PTHREAD_STACK_MIN in comments.
3203
3204 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3205
3206         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3207         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
3208         argument.
3209         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
3210         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
3211         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
3212         (__pthread_cleanup_upto): Fix prototype.
3213         (_longjmp_unwind): Adjust caller.
3214         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
3215         Change second argument to const struct pointer.
3216         * tst-sem8.c (main): Remove unused s2 and s3 variables.
3217         * tst-sem9.c (main): Likewise.
3218         * unwind.c: Include string.h for strlen prototype.
3219
3220 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
3221
3222         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3223         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
3224         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
3225         Define HAVE_CMOV.
3226         Patch by Nicholas Miell <nmiell@attbi.com>.
3227
3228 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
3229
3230         * init.c (__pthread_initialize_minimal_internal): Initialize
3231         GL(dl_init_static_tls).
3232         * pthreadP.h (__pthread_init_static_tls): New prototype.
3233         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
3234         New functions.
3235         * Makefile (tests): Add tst-tls4.
3236         (modules-names): Add tst-tls4moda and tst-tls4modb.
3237         ($(objpfx)tst-tls4): Link against libdl and libpthread.
3238         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
3239         tst-tls4modb.so.
3240         * tst-tls4.c: New file.
3241         * tst-tls4moda.c: New file.
3242         * tst-tls4modb.c: New file.
3243
3244 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
3245
3246         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
3247         before __timer_dealloc.
3248         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
3249         Don't call list_unlink.
3250
3251 2003-07-29  Roland McGrath  <roland@redhat.com>
3252
3253         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
3254
3255 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
3256
3257         * tst-cancel17.c (do_test): Check if aio_cancel failed.
3258         Don't reuse struct aiocb A if it failed.
3259         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
3260         not just one byte, as that does not block.
3261
3262 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
3263
3264         * sysdeps/pthread/unwind-resume.c: New file.
3265         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
3266         unwind-resume in csu subdir.
3267         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
3268         exceptions.
3269         (librt-sysdep_routines, librt-shared-only-routines): Add
3270         rt-unwind-resume.
3271         * sysdeps/pthread/rt-unwind-resume.c: New file.
3272         * unwind-forcedunwind.c: New file.
3273         * Makefile (libpthread-routines): Add unwind-forcedunwind.
3274         (libpthread-shared-only-routines): Likewise.
3275         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
3276         * pthreadP.h (pthread_cancel_init): New prototype.
3277         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
3278
3279         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
3280         attr argument const struct pthread_attr *.
3281
3282         * res.c (__res_state): Return __resp.
3283         * descr.h: Include resolv.h.
3284         (struct pthread): Add res field.
3285         * pthread_create.c: Include resolv.h.
3286         (start_thread): Initialize __resp.
3287         * Makefile (tests): Add tst-_res1.
3288         (module-names): Add tst-_res1mod1, tst-_res1mod2.
3289         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
3290         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
3291         libpthread.
3292         * tst-_res1.c: New file.
3293         * tst-_res1mod1.c: New file.
3294         * tst-_res1mod2.c: New file.
3295
3296 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
3297
3298         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
3299
3300         * Makefile: Define various *-no-z-defs variables for test DSOs
3301         which has undefined symbols.
3302
3303 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
3304
3305         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3306         Retry if the stwcx fails to store once_control.
3307
3308 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
3309
3310         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
3311         pthread_attr_setaffinity.
3312         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
3313         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
3314         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
3315         * pthread_attr_destroy.c: Free cpuset element if allocated.
3316         * pthread_create.c: Pass iattr as additional parameter to
3317         create_thread.
3318         * sysdeps/pthread/createthread.c: If attribute is provided and
3319         a new thread is created with affinity set or scheduling parameters,
3320         start thread with CLONE_STOPPED.
3321         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
3322         pthread_attr_setaffinity.
3323         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
3324         cpuset element.
3325
3326 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
3327
3328         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
3329
3330 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
3331
3332         * sysdeps/pthread/configure.in: Require CFI directives also for
3333         ppc and s390.
3334
3335 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
3336
3337         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3338         Add cfi directives.
3339
3340 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3341
3342         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
3343         CLEANUP_JMP_BUF.
3344         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
3345         registers as variables.  Call __pthread_mutex_unlock_usercnt.
3346         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3347         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
3348         not self pointer in __writer.  Compare with TID to determine
3349         deadlocks.
3350         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3351         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
3352         Likewise.
3353         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
3354         Likewise.
3355         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
3356         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
3357         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
3358         macros also when compiling librt.
3359
3360 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
3361
3362         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
3363         -fasynchronous-unwind-tables.
3364         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3365         (PSEUDO): Add cfi directives.
3366         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
3367         Likewise.
3368         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3369         Likewise.
3370
3371 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
3372
3373         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
3374         __pthread_unregister_cancel): Add prototypes and hidden_proto.
3375         * unwind.c (__pthread_unwind_next): Add hidden_def.
3376         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
3377         Likewise.
3378         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3379         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
3380         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3381         Likewise.
3382         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
3383         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
3384         Likewise.
3385         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
3386         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
3387         __pthread_unregister_cancel and __pthread_unwind_next.
3388
3389 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
3390
3391         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
3392         different symbol for the cancellation syscall wrapper and
3393         non-cancellation syscall wrapper.
3394         (PSEUDO_END): Define.
3395
3396 2003-07-05  Richard Henderson  <rth@redhat.com>
3397
3398         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
3399         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
3400         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3401         return actual return value from the syscall, not 0.
3402
3403 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
3404
3405         * descr.h (struct pthread): Add pid field.
3406         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
3407         (__reclaim_stacks): Likewise.
3408         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
3409         also check for PID of the signal source.
3410         (__pthread_initialize_minimal_internal): Also initialize pid field
3411         of initial thread's descriptor.
3412         * pthread_cancel.c: Use tgkill instead of tkill if possible.
3413         * sysdeps/unix/sysv/linux/fork.c: Likewise.
3414         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
3415         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
3416         * sysdeps/unix/sysv/linux/raise.c: Likewise.
3417
3418 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
3419
3420         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
3421         Fix use of parameter.
3422         (__libc_cleanup_pop): Likewise.
3423
3424 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
3425
3426         * init.c (sigcancel_handler): Change parameters to match handler
3427         for SA_SIGACTION.  Check signal number and code to recognize
3428         invalid invocations.
3429
3430 2003-07-03  Roland McGrath  <roland@redhat.com>
3431
3432         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
3433         Apply sizeof (struct pthread) bias to r13 value.
3434
3435 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
3436
3437         * sysdeps/pthread/configure.in: Require CFI directives.
3438
3439         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
3440         definition.
3441         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
3442         libpthread compilation.
3443         * unwind.c (__pthread_unwind): Add hidden_def.
3444         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
3445
3446 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3447
3448         * libc-cancellation.c (__libc_cleanup_routine): Define.
3449         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
3450         (__pthread_cleanup_pop): Define.
3451
3452 2003-07-01  Richard Henderson  <rth@redhat.com>
3453
3454         * sysdeps/alpha/elf/pt-initfini.c: New file.
3455         * sysdeps/alpha/pthread_spin_lock.S: New file.
3456         * sysdeps/alpha/pthread_spin_trylock.S: New file.
3457         * sysdeps/alpha/pthreaddef.h: New file.
3458         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
3459         * sysdeps/alpha/tls.h: New file.
3460         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
3461         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
3462         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
3463         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
3464         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
3465         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
3466         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
3467         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
3468         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
3469         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
3470
3471 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3472
3473         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
3474         cleanup support and unwind info.
3475
3476 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
3477
3478         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3479         Use correct cleanup handler registration.  Add unwind info.
3480         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
3481         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
3482         * tst-once3.c: Add cleanup handler and check it is called.
3483         * tst-once4.c: Likewise.
3484         * tst-oncex3.c: New file.
3485         * tst-oncex4.c: New file.
3486         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
3487
3488 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
3489
3490         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
3491
3492 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
3493
3494         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
3495         (tf_msgsnd): Likewise.
3496
3497         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
3498         premature returns a bit more.
3499
3500 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
3501
3502         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
3503         definition to the front.
3504
3505         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
3506         the cleanup functions to make the names unique.  Fix dwarf opcode
3507         un unwind table.
3508         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
3509         functions to make the names unique.  Fix CFA offset for two blocks.
3510
3511 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
3512
3513         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
3514         missing closing braces.
3515         Patch by Christophe Saout <christophe@saout.de>.
3516
3517 2003-06-24  Roland McGrath  <roland@redhat.com>
3518
3519         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
3520
3521 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
3522
3523         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
3524         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
3525
3526         * pthreadP.h: Declare __find_thread_by_id.
3527         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
3528         * pthread_clock_gettime.c: Allow using other thread's clock.
3529         * pthread_clock_settime.c: Likewise.
3530         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
3531         * Makefile: Add rules to build and run tst-clock2.
3532         * tst-clock2.c: New file.
3533
3534 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
3535
3536         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
3537         to use exception-based cleanup handler.
3538         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3539
3540         * tst-cond8.c (ch): Announce that we are done.
3541
3542         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
3543
3544         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
3545         Also test aio_suspend with timeout value.
3546
3547 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
3548
3549         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
3550         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
3551         attribute_hidden.
3552
3553         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
3554         (__pthread_mutex_lock_internal): Likewise.
3555         (__pthread_mutex_unlock_internal): Likewise.
3556         (__pthread_mutex_unlock_usercnt): Declare.
3557         * pthread_mutex_destroy.c: Always fail if used in any way.
3558         * pthread_mutex_init.c: Update comment.
3559         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
3560         * pthread_mutex_timedlock.c: Adjust __nusers.
3561         * pthread_mutex_trylock.c: Adjust __nusers.
3562         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
3563         and public interfaces are wrapper with pass additional parameter.
3564         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
3565         parameter zero.
3566         * tst-mutex8.c: New file.
3567         * Makefile (tests): Add tst-mutex8.
3568         * sysdeps/pthread/pthread_cond_timedwait.c: Call
3569         __pthread_mutex_unlock_usercnt.
3570         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3571         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3572         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3573         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3574         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3575         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
3576         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3577         Add __nusers.
3578         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3579         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3580         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3581         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3582         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3583
3584         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
3585         * pthread_mutex_timedlock.c: Likewise.
3586         * pthread_mutex_trylock.c: Adjust __nusers.
3587         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
3588         * tst-mutex9.c: New file.
3589         * Makefile (tests): Add tst-mutex9.
3590         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
3591         * sysdeps/ia64/tls.h: Likewise.
3592         * sysdeps/powerpc/tls.h: Likewise.
3593         * sysdeps/s390/tls.h: Likewise.
3594         * sysdeps/sh/tls.h: Likewise.
3595         * sysdeps/x86_64/tls.h: Likewise.
3596         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3597         Change type of __owner.
3598         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3599         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3600         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3601         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3602         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3603
3604 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
3605
3606         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
3607         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
3608
3609         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
3610         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
3611         instead of nr to lll_futex_wake.  Only set errno and return -1
3612         if err < 0.
3613
3614         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
3615         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3616         return actual return value from the syscall, not 0.
3617
3618 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
3619
3620         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
3621         find a random value.
3622         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
3623         errno==EIDRM.
3624
3625         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
3626         compat_timer_settime.
3627         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
3628         compat_timer_gettime.
3629         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
3630         compat_timer_getoverrun.
3631         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
3632         compat_timer_delete.
3633
3634         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
3635         error-checking mutex detect busy mutexes.
3636
3637 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
3638
3639         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
3640         Add ax to clobber list.
3641         (lll_mutex_cond_lock): Likewise.
3642         (lll_mutex_unlock): Likewise.
3643         (lll_lock): Likewise.
3644         (lll_unlock): Likewise.
3645
3646         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
3647         * tst-cancel18.c: New file.
3648         * tst-cancelx18.c: New file.
3649
3650         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
3651         and tcdrain.
3652
3653         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
3654         * tst-cancel17.c: New file.
3655         * tst-cancelx17.c: New file.
3656
3657         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
3658         * sysdeps/unix/sysv/linux/sigwait.c: New file.
3659         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
3660
3661         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
3662
3663 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
3664
3665         * sysdeps/pthread/createthread.c (create_thread): Set
3666         header.multiple_threads unconditionally.
3667         * allocatestack.c (allocate_stack): Likewise.
3668         * descr.h (struct pthread): Add header.multiple_threads
3669         unconditionally.
3670         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
3671         Define for librt.  #error if neither libpthread, libc nor librt.
3672         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
3673         Likewise.
3674         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
3675         CDISABLE): Likewise.
3676         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
3677         CDISABLE): Likewise.
3678         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
3679         CDISABLE): Likewise.
3680         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
3681         CDISABLE): Likewise.  Access header.multiple_threads outside of
3682         libc and libpthread.
3683         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
3684         Likewise.
3685         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
3686         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
3687
3688 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
3689
3690         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
3691         Also test early cancellation before the thread reaches the cancellation
3692         point.
3693
3694         * Makefile: Compile forward.c with exceptions.
3695
3696         * sysdeps/unix/sysv/linux/sleep.c: New file.
3697
3698 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
3699
3700         * Makefile: Add CFLAGS definition to compile function wrappers
3701         duplicated from libc with exceptions.
3702         * tst-cancel4.c: Also check cancellation handlers.
3703
3704         * Makefile: Add rules to build and run tst-cancel16 and
3705         tst-cancelx16.  Add missing CFLAGS definitions.
3706         * tst-cancel16.c: New file.
3707         * tst-cancelx16.c: New file.
3708
3709 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
3710
3711         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3712         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
3713         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
3714         (DL_SYSINFO_IMPLEMENTATION): Likewise.
3715
3716         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
3717         (LIBC_CANCEL_RESET): Likewise.
3718         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
3719         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
3720         librt-cancellation.
3721         (CFLAGS-libcrt-cancellation.c): Define.
3722         * sysdeps/pthread/librt-cancellation.c: New file.
3723         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
3724         macros also when compiling librt.
3725         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3726         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3727         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3728         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3729         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3730         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3731         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3732
3733         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
3734         compat_timer_create.
3735
3736 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
3737
3738         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
3739
3740         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
3741         __register_atfork.
3742         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
3743         Add libc_hidden_def.
3744
3745 2003-06-13  Roland McGrath  <roland@redhat.com>
3746
3747         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
3748         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
3749
3750 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
3751
3752         * allocatestack.c (queue_stack): Always inline.
3753         * ptreadhP.h (__do_cancel): Likewise.
3754
3755 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
3756
3757         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
3758         a typo.
3759
3760 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
3761
3762         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3763         (__pthread_cond_signal): Remove incorrect second addition for
3764         cond_lock!=0.
3765
3766 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
3767
3768         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3769         (__pthread_cond_signal): Use correct futex pointer in
3770         __lll_mutex_lock_wait call.
3771
3772         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3773         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
3774
3775 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
3776
3777         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
3778         cancelable.
3779         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
3780         Likewise.
3781
3782         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
3783         hand-written CFI generation code.  Since ENTRY/END also initiated
3784         CFI frames this caused two CFI sets to be generated.
3785
3786 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
3787
3788         * cleanup_routine.c: New file.
3789         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
3790         * sysdeps/pthread/pthread.h: Add support for fully exception-based
3791         cleanup handling.
3792         * Makefile (libpthread-routines): Add cleanup_routine.
3793         Add more CFLAGS variables to compile with exceptions.  Add comments
3794         why which file needs unwind tables.
3795         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
3796         tests.
3797         * tst-cancelx1.c: New file.
3798         * tst-cancelx2.c: New file.
3799         * tst-cancelx3.c: New file.
3800         * tst-cancelx4.c: New file.
3801         * tst-cancelx5.c: New file.
3802         * tst-cancelx6.c: New file.
3803         * tst-cancelx7.c: New file.
3804         * tst-cancelx8.c: New file.
3805         * tst-cancelx9.c: New file.
3806         * tst-cancelx10.c: New file.
3807         * tst-cancelx11.c: New file.
3808         * tst-cancelx12.c: New file.
3809         * tst-cancelx13.c: New file.
3810         * tst-cancelx14.c: New file.
3811         * tst-cancelx15.c: New file.
3812         * tst-cleanupx0.c: New file.
3813         * tst-cleanupx0.expect: New file.
3814         * tst-cleanupx1.c: New file.
3815         * tst-cleanupx2.c: New file.
3816         * tst-cleanupx3.c: New file.
3817
3818         * tst-cleanup0.c: Make standard compliant.
3819         * tst-cleanup1.c: Likewise.
3820
3821         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
3822         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3823         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3824         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3825         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3826         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3827         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
3828         CLEANUP_JMP_BUF.
3829         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3830         * tst-cancel12.c: New file.
3831         * tst-cancel13.c: New file.
3832         * tst-cancel14.c: New file.
3833         * tst-cancel15.c: New file.
3834         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
3835         and tst-cancel15.
3836
3837         * tst-cancel1.c: Add some comments.
3838
3839         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
3840         timeout correctly.
3841
3842 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
3843
3844         * Makefile (CFLAGS-pthread_cancel.c): Define.
3845
3846 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
3847
3848         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
3849         Change type of __writer element to int.
3850         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3851         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3852         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3853         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3854         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3855         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
3856         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3857         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
3858         Compare with TID to determine deadlocks.
3859         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
3860         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3861         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
3862         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3863         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3864         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3865         Likewise.
3866         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3867         Likewise.
3868         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3869         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3870         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3871         Likewise.
3872         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3873         Likewise.
3874         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3875         * Makefile (tests): Add tst-rwlock12.
3876         * tst-rwlock12.c: New file.
3877
3878 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
3879
3880         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
3881         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
3882         Remove bogus hidden_proto.
3883         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
3884         Likewise.
3885         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
3886         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
3887         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
3888         ___lll_mutex_timedlock): Likewise.
3889
3890 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
3891
3892         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3893         (__pthread_cond_signal): Add some code to eventually handle
3894         cond_lock!=0.
3895
3896 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
3897
3898         * Makefile (tests): Add tst-exec4.
3899         (tst-exec4-ARGS): Define.
3900         * tst-exec4.c: New file.
3901
3902 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
3903
3904         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
3905         Also fail if tv_nsec < 0.
3906         (__lll_timedwait_tid): Likewise.
3907         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
3908         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
3909         Likewise.
3910         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
3911         Likewise.
3912         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
3913         Likewise.
3914         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
3915         Likewise.
3916         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
3917         Likewise.
3918         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
3919         Likewise.
3920
3921         * Makefile (tests): Add tst-sem8 and tst-sem9.
3922         * tst-sem8.c: New file.
3923         * tst-sem9.c: New file.
3924         * sem_open.c: Fix creation of in_use record if the file exists but
3925         no internal record.
3926
3927         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
3928         definitions.
3929
3930         * sysdeps/pthread/timer_create.c (timer_create): In case
3931         evp==NULL, assign timer ID to sival_ptr.
3932
3933         * descr.h (struct pthread_unwind_buf): Change type of prev element to
3934         struct pthread_unwind_buf *.
3935         (struct pthread): Likewise for cleanup_jmp_buf element.
3936
3937         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
3938         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
3939         * unwind.c (__pthread_unwind_next): Likewise.
3940
3941 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
3942
3943         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3944         (lll_futex_timed_wait): Use int for futex value parameter.
3945         (lll_futex_wake): Likewise.
3946         (lll_futex_requeue): Likewise.
3947
3948         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3949         Replace one memory operation with one register operation.
3950
3951         * tst-join4.c (do_test): Fix error message.
3952
3953         * tst-rwlock6.c (do_test): Use correct format specifier.
3954
3955         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
3956         (__lll_mutex_lock_wait): Replace one memory operation with one
3957         register operation.
3958         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
3959         (__lll_mutex_lock_wait): Likewise.
3960
3961         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3962         (__lll_mutex_cond_lock): Add one to value parameter of
3963         __lll_lock_wait to reflect reality in the futex syscall.
3964         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3965         (lll_mutex_cond_lock): Likewise.
3966
3967 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3968
3969         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
3970         New function.
3971         (lll_mutex_cond_lock): Define.
3972
3973 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
3974
3975         * Makefile (tests): Add tst-signal6.
3976         * tst-signal6.c: New file.
3977
3978         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
3979         (__lll_mutex_unlock_force): New function
3980         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3981
3982         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3983         (__lll_mutex_unlock_force): New function.
3984         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3985
3986         * tst-rwlock7.c (do_test): Use correct format specifier.
3987
3988         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
3989         Find break parameter in correct asm argument.
3990
3991 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
3992
3993         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
3994         Remove out4.
3995         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
3996         error occured.
3997         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3998         Add __mutex.
3999         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
4000         lll_futex_requeue, lll_mutex_unlock_force): Define.
4001
4002 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
4003
4004         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4005         (pthread_cond_t): Add __mutex.
4006         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
4007         lll_futex_requeue, lll_mutex_unlock_force): Define.
4008
4009 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4010
4011         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
4012         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4013         Add __mutex field.
4014         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
4015         Define.
4016         (lll_futex_wait, lll_futex_wake): Define.
4017         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
4018         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
4019         FUTEX_REQUEUE instead of FUTEX_WAIT.
4020         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
4021         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
4022         mutex which was used in condvar structure.  Call
4023         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
4024         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
4025
4026         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
4027         include tcb-offsets.h.  Read wakeup value in locked region.
4028         Use the value of gbr register as THREAD_ID.
4029         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4030         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4031         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4032
4033         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
4034         macros.
4035
4036 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
4037
4038         * sysdeps/pthread/pthread_cond_broadcast.c
4039         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
4040
4041 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
4042
4043         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
4044         typo in register name.
4045         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
4046         correctly.  Actually use requeue.  Little optimization.
4047         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
4048         mutex address early.  Handle cancellation state as 32-bit value.
4049         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4050         Remove unnecessary label.
4051
4052 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
4053
4054         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
4055         instead of FUTEX_WAIT.
4056         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
4057         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4058         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4059         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4060         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4061         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
4062         used in condvar structure.  Call __pthread_mutex_cond_lock instead
4063         of __pthread_mutex_lock_internal.
4064         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4065         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4066         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4067         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
4068         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4069         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4070         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
4071         Add pthread_mutex_cond_lock.
4072         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
4073         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
4074         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
4075         lll_mutex_cond_lock.
4076         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
4077         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4078         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4079         Add __mutex field.
4080         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4081         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4082
4083         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
4084         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4085
4086         * pthreadP.h: Declare __pthread_mutex_cond_lock.
4087         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
4088         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
4089         macro don't define aliases.
4090
4091         * cancellation.c: Remove __pthread_enable_asynccancel_2.
4092         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
4093         * sysdeps/pthread/pthread_cond_timedwait.c: Use
4094         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
4095         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4096         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4097         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4098         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4099         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4100
4101 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
4102
4103         * sem_open.c: Fix one endless loop.  Implement correct semantics
4104         wrt opening the same semaphore more then once.
4105         * sem_close.c: Adjust for sem_open change.
4106         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
4107         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
4108         * Makefile (tests): Add tst-sem7.
4109         * tst-sem7.c: New file.
4110
4111 2003-05-16  Roland McGrath  <roland@redhat.com>
4112
4113         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
4114         uninitialized variable braino.
4115
4116 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
4117
4118         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
4119         test for syscall availability.
4120
4121         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
4122         __no_posix_timers to -1 if the syscalls don't exist.
4123
4124         * pthread_join.c (pthread_join): Set tid field of the joined
4125         thread to -1.  This isn't necessary but helps to recognize some
4126         error conditions with almost no cost.
4127
4128         * allocatestack.c (FREE_P): Also negative values indicate an
4129         unused stack.
4130
4131         * unwind.c: Include <unistd.h>.
4132
4133 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
4134
4135         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
4136
4137 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
4138
4139         * Makefile (crti-objs, crtn-objs): New variables.
4140         (omit-deps, extra-objs): Add crtn.
4141         ($(objpfx)libpthread.so): Depend on both crti and crtn
4142         and links to them in multidir.
4143         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
4144
4145 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
4146
4147         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4148         (lll_mutex_unlock): Use atomic_exchange_rel.
4149
4150 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
4151
4152         * cond-perf.c (cons): Add missing locking around setting of alldone.
4153
4154 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
4155
4156         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
4157         related macros.
4158         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4159
4160 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
4161
4162         * tst-sem6.c: New file.
4163         * Makefile (tests): Add tst-sem6.
4164
4165         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
4166         Use atomic_exchange_rel instead of atomic_exchange.
4167         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
4168         Likewise.
4169
4170         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
4171         code for lll_futex_wait and lll_futex_wake in static apps.  Use
4172         vsyscall is possible.
4173
4174         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
4175         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
4176         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
4177         pthread_setaffinity_np.
4178         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
4179         and pthread_setaffinity_np.
4180         * Makefile (libpthread-routines): Add pthread_getaffinity and
4181         pthread_setaffinity.
4182
4183         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
4184         use it in case mmap to allocate the stack fails.
4185         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
4186         ARCH_MAP_FLAGS here.
4187         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
4188         ARCH_RETRY_MMAP.
4189
4190 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
4191
4192         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
4193         handler implementation.  It is now lockless in fork().
4194         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
4195         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
4196         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
4197         declare the __fork_*_lists.
4198         (struct fork_handler): Include pointers to all three functions.
4199         Add next, refcntr and need_signal elements.
4200         (__fork_handlers): New declaration.
4201         (__register_atfork_malloc): Remove declaration.
4202         (HAVE_register_atfork_malloc): Remove definition.
4203         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
4204         __pthread_child_handler variable.
4205         (__libc_pthread_init): Use __register_atfork instead of explicitly
4206         adding to the list.
4207         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
4208         and lll_futex_wake.
4209         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4210
4211         * unwind.c (unwind_cleanup): Print error message and then abort.  This
4212         function must never be reached.
4213
4214         * cond-perf.c: New file.
4215
4216 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
4217
4218         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
4219
4220 2003-05-04  Roland McGrath  <roland@redhat.com>
4221
4222         * Makefile ($(objpfx)../libc.so): New target.
4223
4224 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
4225
4226         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4227         (pthread_condattr_t): Size is only an int, don't use long for
4228         alignment.
4229         (pthread_mutexattr_t): Likewise.
4230         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4231         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4232         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4233
4234 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
4235
4236         * sysdeps/i386/tls.h: Define THREAD_ID.
4237         * sysdeps/ia64/tls.h: Likewise.
4238         * sysdeps/powerpc/tls.h: Likewise.
4239         * sysdeps/s390/tls.h: Likewise.
4240         * sysdeps/sh/tls.h: Likewise.
4241         * sysdeps/x86_64/tls.h: Likewise.
4242         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
4243         record ownership.
4244         * pthread_mutex_timedlock.c: Likewise.
4245         * pthread_mutex_trylock.c: Likewise.
4246         * pthread_mutex_unlock.c: Likewise.
4247         * pthread_rwlock_trywrlock.c: Likewise.
4248         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
4249         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4250         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4251         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4252
4253         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
4254         flag.
4255
4256 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
4257
4258         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4259         (__SIZEOF_PTHREAD_COND_T): Define to 48.
4260         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
4261         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4262         Make __align long long instead of long.
4263         (pthread_rwlock_t): Formatting.
4264         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
4265         (pthread_rwlock_t): Formatting.
4266         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4267         (pthread_cond_t): Make __align long long instead of long.
4268         (pthread_rwlock_t): Move __flags field to the same position as in
4269         linuxthreads.
4270
4271 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
4272
4273         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
4274         * tst-rwlock7.c (do_test): Likewise.
4275
4276 2003-04-26  Roland McGrath  <roland@redhat.com>
4277
4278         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
4279
4280 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
4281
4282         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
4283         sizeof (struct pthread).
4284         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
4285         1 struct pthread.
4286         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
4287         to 0.
4288         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
4289         struct pthread.
4290         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
4291         to 32-bit bytes.
4292         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
4293         tcbp.
4294         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
4295         unneccessarily.
4296         (NO_TLS_OFFSET): Define.
4297         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
4298         add TLS_TCB_SIZE unnecessarily.
4299
4300 2003-04-22  Roland McGrath  <roland@redhat.com>
4301
4302         * Makeconfig (shared-thread-library): Reverse link order to work
4303         around linker bug.
4304
4305 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
4306
4307         * semaphore.h: Fix typo in comment.
4308
4309 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
4310
4311         * sysdeps/pthread/sigfillset.c: New file.
4312
4313         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
4314         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
4315         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
4316         * sysdeps/pthread/sigaction.c: Likewise.
4317         * sysdeps/pthread/sigprocmask.c: New file.
4318         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
4319         __SIGRTMIN+1.
4320         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4321         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
4322         in this case.
4323
4324 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
4325
4326         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4327         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
4328
4329         * sysdeps/unix/sysv/linux/unregister-atfork.c
4330         (__unregister_atfork): Don't free memory not allocated dynamically.
4331
4332         * semaphore.h: Remove __THROW marker from cancellation points.
4333         * nptl/sysdeps/pthread/pthread.h: Likewise.
4334
4335 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
4336
4337         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
4338         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
4339         __THROW.
4340
4341 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
4342
4343         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
4344
4345 2003-04-15  Roland McGrath  <roland@redhat.com>
4346
4347         * forward.c (__pthread_unwind): Tweak to avoid warning.
4348
4349 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
4350
4351         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
4352
4353 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
4354
4355         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
4356         overflow CFA advance instructions.
4357         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4358
4359 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
4360
4361         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
4362         * sysdeps/i386/pthread_spin_lock.c: Likewise.
4363         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
4364         defined.
4365
4366         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
4367         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
4368         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
4369         DW_CFA_advance_loc for .Laddl-.Lsubl.
4370
4371 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
4372
4373         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
4374         position-independent unwind data for static libraries.
4375         Add missing unwind info.  Add comments.
4376
4377         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
4378         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4379         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4380         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4381
4382 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
4383
4384         * Makefile: Make sure all cancellation points are compiled with
4385         exception and asynchronous unwind tables.
4386
4387         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
4388         which mishandles loading of global object addresses in PIC.
4389         (THREAD_SETMEM_NC): Likewise.
4390
4391 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4392
4393         * pthread.h: Define new data structure for cleanup buffer.  Declare
4394         new cleanup handler interfaces.
4395         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
4396         (struct pthread): Add cleanup_jmp_buf pointer.  Define
4397         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
4398         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
4399         it.  Declare old cleanup handler installation functions.
4400         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
4401         handling.
4402         * cleanup_defer.c: Likewise.
4403         * cleanup_compat.c: New file.  Old cleanup code.
4404         * cleanup_def_compat.c: New file.  Old cleanup code.
4405         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
4406         if own thread descriptor.
4407         * unwind.c: New file.
4408         * forward.c: Add __pthread_unwind.
4409         * init.c (pthread_functions): Add __pthread_unwind.
4410         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
4411         Add ptr___pthread_unwind.
4412         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
4413         and unwind function.
4414         * Makefile (libpthread-routines): Add cleanup_compat,
4415         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
4416         table generation if necessary.
4417         * version.c: Record whether unwind support is compiled in.
4418         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
4419         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
4420         handler interfaces.
4421         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
4422         complication to generate unwind information for syscall wrappers.
4423         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4424         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
4425         __cleanup_fct_attribute.
4426
4427         * Makefile: Add rules to build and run tst-cleanup0.
4428         * tst-cleanup0.c: New file.
4429         * tst-cleanup0.expect: New file.
4430
4431         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
4432         caller.  Optimize to avoid often unecessary local variable.
4433
4434 2003-04-11  Roland McGrath  <roland@redhat.com>
4435
4436         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
4437         sets variable `multidir'; include that.
4438         (generated): Add it.
4439         ($(objpfx)$(multidir)/crti.o): New target.
4440         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
4441
4442 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4443
4444         * tst-attr2.c (do_test): Add cast to avoid warning.
4445         * tst-mutex4.c (do_test): Likewise.
4446
4447 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
4448
4449         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
4450         in child.
4451
4452 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
4453
4454         * Makefile (tests): Add tst-detach1.
4455         * tst-detach1.c: New file.
4456
4457 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
4458
4459         * sysdeps/pthread/pthread.h: Remove duplicate
4460         pthread_cleanup_{push,pop} definitions.
4461
4462         * tst-barrier2.c: Eliminate warnings.
4463         * tst-cancel4.c: Likewise.
4464         * tst-cond4.c: Likewise.
4465         * tst-cond6.c: Likewise.
4466         * tst-detach1.c: Likewise.
4467         * tst-rwlock4.c: Likewise.
4468         * tst-rwlock6.c: Likewise.
4469         * tst-rwlock7.c: Likewise.
4470         * tst-sem3.c: Likewise.
4471         * tst-spin2.c: Likewise.
4472         * tst-umask1.c: Likewise.
4473
4474 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
4475
4476         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
4477
4478 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
4479
4480         * descr.h (struct pthread): Move cancelhandling member to the front.
4481
4482 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
4483
4484         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
4485         malloc_parent, and malloc_child statically.
4486         (__register_atfork_malloc): New function.
4487         (free_mem): Don't free any of the malloc_* variables on the list.
4488         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
4489         Define HAVE_register_atfork_malloc.
4490
4491 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
4492
4493         * sysdeps/pthread/createthread.c (create_thread): Add some more
4494         comments explaining when to set multiple_threads and when not.
4495
4496         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4497         THREAD_ATOMIC_BIT_SET if not already defined.
4498         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4499         THREAD_ATOMIC_BIT_SET:
4500         * sysdeps/x86_64/tls.h: Likewise.
4501         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
4502         THREAD_ATOMIC_CMPXCHG_VAL.
4503         (_pthread_cleanup_pop_restore): Likewise.
4504         * cancellation.c (__pthread_enable_asynccancel): Likewise.
4505         (__pthread_enable_asynccancel_2): Likewise.
4506         (__pthread_disable_asynccancel): Likewise.
4507         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4508         (__libc_disable_asynccancel): Likewise.
4509         * init.c (sigcancel_handler): Likewise.
4510         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
4511         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
4512
4513 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
4514
4515         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
4516         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4517         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
4518         * Makefile (tests): Add tst-cancel11.
4519         * tst-cancel11.c: New file.
4520
4521 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
4522
4523         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
4524         round, not the first.  Use specific_used flag instead of local
4525         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
4526         (__free_tcb): Don't call deallocate_tsd here.
4527         (start_thread): Call deallocate_tsd here.
4528         * pthread_setspecific.c: Set specific_used flag really only when
4529         needed.
4530         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
4531         * tst-tsd3.c: New file.
4532         * tst-tsd4.c: New file.
4533
4534 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4535
4536         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
4537         Use atomic_exchange_and_add instead of __lll_add.
4538         (__lll_mutex_timedlock): Likewise.
4539         Patch by Ian Wienand.
4540
4541 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
4542
4543         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4544         (SINGLE_THREAD_P): Fix typo.
4545         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
4546
4547 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4548
4549         * Makefile (tests): Add tst-align.
4550         * tst-align.c: New file.
4551         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
4552
4553         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
4554         function correctly.
4555
4556         * tst-tsd2.c: Add casts to avoid warnings.
4557
4558 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
4559
4560         * descr.h (struct pthread): Move most often used elements to the front.
4561
4562 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
4563
4564         * Makefile (libpthread-routines): Add pthread_atfork.
4565         (libpthread-static-only-routines): Add pthread_atfork.
4566
4567 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4568
4569         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
4570         of TLS_DTV_AT_TP.
4571         (INSTALL_DTV): Add parens.
4572         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
4573         Use passed descr instead of THREAD_SELF.
4574         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
4575         (__lll_mutex_timedlock_wait): Correct expected value after
4576         spurious wakeup.
4577         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
4578         Release lock before waking up the waiters.
4579         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
4580         criteria.  Reorderstruct passed to cleanup handler.  Fix
4581         handling of cancellation and failung pthread_mutex_unlock call.
4582         Use __pthread_enable_asynccancel_2 instead of
4583         __pthread_enable_asynccancel.
4584         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4585         Return result of lock re-get if it fails.
4586         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
4587         for __pthread_cleanup_push.
4588         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
4589         completely broken rwlock implementation.
4590         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4591         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4592         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4593         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
4594         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4595         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
4596         versioned_symbol macro.
4597         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
4598         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4599
4600 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
4601
4602         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
4603         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
4604         and __helper_tid.
4605         (struct timer): Remove th and bar field.
4606         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
4607         debugging code.  Create only one helper thread.
4608         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
4609         helper thread.
4610         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4611         Renamed.  Define statically.  Use thread info from siginfo.
4612         (__helper_once): New variable.
4613         (__helper_tid): New variable.
4614         (__reset_helper_control): New function.
4615         (__start_helper_thread): New function.
4616
4617         * pthread_create.c (start_thread): Don't use setjmp inside
4618         __builtin_expect to work around gcc bug.
4619
4620         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
4621         timer_delete syscall fails, but not with ENOSYS, set
4622         __no_posix_timers.
4623
4624         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
4625         (timer_settime): Fix typo.
4626         * sysdeps/unix/sysv/linux/timer_getoverr.c
4627         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
4628
4629 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
4630
4631         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
4632         offset of cleanupbuf.__prev.
4633
4634 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
4635
4636         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
4637         of included file.
4638
4639 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
4640
4641         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
4642         NULL provide default definition to syscall.
4643
4644 2003-03-25  Roland McGrath  <roland@redhat.com>
4645
4646         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
4647         (timer_id2ptr): Fix typo.
4648
4649 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
4650
4651         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
4652         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
4653         * sysdeps/ia64/pthreaddef.h: Likewise.
4654         * sysdeps/powerpc/pthreaddef.h: Likewise.
4655         * sysdeps/s390/pthreaddef.h: Likewise.
4656         * sysdeps/sh/pthreaddef.h: Likewise.
4657         * sysdeps/x86_64/pthreaddef.h: Likewise.
4658         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
4659         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
4660         being changed.
4661         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4662         SIGTIMER is not unblocked.
4663         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
4664         RT signal taken.
4665         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
4666         be send.
4667         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
4668         pass pointer through as ID.
4669         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
4670         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
4671         * sysdeps/unix/sysv/linux/timer_create.c: New file.
4672         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
4673         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
4674         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
4675         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
4676         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
4677         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
4678         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
4679         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
4680         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
4681         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
4682         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
4683         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
4684         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
4685         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
4686         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
4687         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
4688         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
4689         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
4690         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
4691         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
4692         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
4693         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
4694         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
4695         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
4696         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
4697         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
4698         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
4699         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
4700         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
4701         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
4702
4703         * pthreadP.h: Remove FRAME_LEFT definition.
4704         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
4705         already left frame.  Programs which have this problem are not POSIX
4706         compliant.
4707         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
4708
4709 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
4710
4711         * sysdeps/pthread/tst-timer.c: Check return values of the
4712         functions we test.
4713
4714 2003-03-23  Roland McGrath  <roland@redhat.com>
4715
4716         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
4717         * tst-tls3mod.c: Likewise.
4718         * tst-tls1.c: Likewise.
4719         * tst-tls2.c: Likewise.
4720
4721         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
4722         undefined behavior.
4723
4724         * tst-join5.c (tf1, tf2): Add a cast.
4725
4726         * Makeconfig (includes): Append -I$(..)nptl to this variable.
4727
4728         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
4729         Don't test anything.
4730         * tst-cond4.c: Likewise.
4731         * tst-cond6.c: Likewise.
4732         * tst-flock2.c: Likewise.
4733         * tst-mutex4.c: Likewise.
4734         * tst-rwlock4.c: Likewise.
4735         * tst-signal1.c: Likewise.
4736         * tst-spin2.c: Likewise.
4737         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
4738
4739         * tst-mutex4.c: Use test-skeleton.c.
4740         * tst-spin2.c: Likewise.
4741         * tst-sysconf.c: Likewise.
4742         * tst-barrier2.c: Likewise.
4743         * tst-cond4.c: Likewise.
4744         * tst-cond6.c: Likewise.
4745         * tst-rwlock4.c: Likewise.
4746         * tst-unload.c: Likewise.
4747         * tst-flock2.c (do_test): Use return instead of exit.
4748
4749 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
4750
4751         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
4752
4753 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
4754
4755         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4756         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
4757         instead of __lll_compare_and_swap.
4758         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4759         Likewise.
4760         Removed definition if __lll_compare_and_swap.
4761
4762         * cancellation.c: Adjust for new form of compare&exchange macros.
4763         * cleanup_defer.c: Likewise.
4764         * init.c: Likewise.
4765         * libc-cancellation.c: Likewise.
4766         * old_pthread_cond_broadcast.c: Likewise.
4767         * old_pthread_cond_signal.c: Likewise.
4768         * old_pthread_cond_timedwait.c: Likewise.
4769         * old_pthread_cond_wait.c: Likewise.
4770         * pthread_cancel.c: Likewise.
4771         * pthread_create.c: Likewise.
4772         * pthread_detach.c: Likewise.
4773         * pthread_join.c: Likewise.
4774         * pthread_key_delete.c: Likewise.
4775         * pthread_setcancelstate.c: Likewise.
4776         * pthread_setcanceltype.c: Likewise.
4777         * pthread_timedjoin.c: Likewise.
4778         * pthread_tryjoin.c: Likewise.
4779         * sysdeps/pthread/createthread.c: Likewise.
4780
4781 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
4782
4783         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
4784         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
4785         definitions.  Replace uses with calls to atomic_* functions.
4786         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
4787         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
4788         __lll_test_and_set calls with atomic_exchange_and_add and
4789         atomic_exchange calls respectively.
4790         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
4791         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
4792         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
4793         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
4794         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
4795         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
4796         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
4797
4798         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
4799         returns the old value.
4800
4801 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
4802
4803         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
4804         int for variable OLDVAL and correct inline assembler contraint.
4805         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
4806         type int for variable OLD.
4807
4808         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
4809         only for s390-32.
4810         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
4811         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
4812         instead of multiple_threads field in the TCB.
4813
4814 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
4815
4816         * sysdeps/i386/i686/bits/atomic.h: Removed.
4817         * sysdeps/i386/i586/bits/atomic.h: Removed.
4818         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
4819         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
4820         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
4821         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
4822         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
4823         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
4824         * atomic.h: Removed.  Moved to glibc.
4825
4826         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
4827         support for clock selection.
4828
4829         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
4830         signalling waiters.
4831
4832 2003-03-18  Roland McGrath  <roland@redhat.com>
4833
4834         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
4835         Add __lll_rel_instr first.  Add memory clobber.
4836         (lll_mutex_unlock): Use __lll_test_and_set.
4837         From Paul Mackerras <paulus@samba.org>.
4838
4839         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
4840         unconditionally.
4841         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4842         (SINGLE_THREAD_P):  Add `header.' prefix.
4843         From Paul Mackerras <paulus@samba.org>.
4844
4845         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
4846         pthread_timedjoin_np to ...
4847         (libpthread: GLIBC_2.3.3): ... here.
4848         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
4849
4850         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4851         Avoid shadowing VAL variable.
4852
4853         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
4854         New macro.
4855
4856 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
4857
4858         * Makefile (tests): Add tst-cond11.
4859         * tst-cond11.c: New file.
4860
4861         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
4862         struct passed to cleanup handler to eliminate one more
4863         instruction.
4864         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4865
4866         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4867         (pthrad_cond_t): Replace __unused field with __clock.
4868
4869         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
4870         waken all waiters in cleanup handler.
4871         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4872         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4873
4874         * pthread_condattr_getclock.c: New file.
4875         * pthread_condattr_setclock.c: New file.
4876         * sysdeps/pthread/pthread.h: Declare these new functions.
4877         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
4878         * Makefile (libpthread-routines): Add the new functions.
4879         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
4880         Renamed field to value.  Document use of the bits.
4881         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
4882         change.
4883         * pthread_condattr_setpshared.c: Likewise.
4884         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
4885         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
4886         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4887         Add __clock field.
4888         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4889         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4890         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4891         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4892         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4893         Implement clock selection.
4894         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4895         * pthread-errnos.sym: Add ENOSYS.
4896         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4897         _POSIX_CLOCK_SELECTION.
4898         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4899
4900         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
4901         invalid .size directive.
4902
4903 2003-03-17  Roland McGrath  <roland@redhat.com>
4904
4905         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
4906         Formatting tweaks.
4907
4908 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
4909
4910         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
4911         Use __lll_add instead of spelling it out.  Use protected symbol names.
4912         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
4913         Use __lll_add.
4914         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
4915         Renamed from lll_compare_and_swap.  Use new name where necessary.
4916         (__lll_add): Defined.
4917         (__lll_dec_if_positive): Defined.
4918         (__lll_test_and_set): Defined.
4919         * sysdeps/ia64/pthread_spin_init.c: Removed.
4920         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
4921         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
4922         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
4923         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
4924         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
4925         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
4926         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
4927         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
4928         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
4929         __sync_lock_release_si.
4930         Patch by Jakub Jelinek.
4931
4932         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
4933         Fix timeout handling.
4934         (__lll_timedwait_tid): Likewise.
4935         (lll_unlock_wake_cb): Wake up other waiters if necessary.
4936         Patch by Jakub Jelinek.
4937
4938         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
4939
4940 2003-03-17  Roland McGrath  <roland@redhat.com>
4941
4942         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
4943         * sysdeps/pthread/pthread_spin_init.c: New file.
4944         * sysdeps/pthread/pthread_spin_unlock.c: New file.
4945         * sysdeps/powerpc/Makefile: New file.
4946         * sysdeps/powerpc/pthread_spin_lock.c: New file.
4947         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
4948         * sysdeps/powerpc/pthreaddef.h: New file.
4949         * sysdeps/powerpc/tcb-offsets.sym: New file.
4950         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
4951         * sysdeps/powerpc/tls.h: New file.
4952         * sysdeps/powerpc/bits/atomic.h: New file.
4953         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
4954         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
4955         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
4956
4957         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
4958         * sysdeps/unix/sysv/linux/sem_post.c: New file.
4959         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
4960         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
4961         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
4962         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
4963         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
4964         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
4965         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
4966         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
4967         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
4968         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
4969         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
4970         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
4971         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
4972
4973         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
4974         not gettimeofday.
4975         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
4976         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4977         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
4978         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
4979         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4980
4981 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
4982
4983         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
4984         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4985         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4986         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4987         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
4988
4989 2003-03-16  Roland McGrath  <roland@redhat.com>
4990
4991         * tst-fork4.c: Include <string.h>.
4992         * tst-signal2.c: Likewise.
4993         * tst-mutex5.c (do_test): exit -> return.
4994         * tst-mutex2.c: Include <stdlib.h>.
4995
4996 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
4997
4998         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4999         (__lll_mutex_timedlock_wait): Correct expected value after
5000         spurious wakeup.  Otherwise we would never wait again.
5001
5002         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
5003         zone versus inline asm stupidity.  Use correct instructions.
5004
5005         * tst-rwlock6.c: Add some more status output.
5006
5007 2003-03-15  Roland McGrath  <roland@redhat.com>
5008
5009         * sysdeps/pthread/configure.in: New file.
5010         * sysdeps/pthread/configure: New file (generated).
5011
5012 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5013
5014         * allocatestack.c (allocate_stack): Store the exact stack size of
5015         user allocated stacks.
5016
5017 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
5018
5019         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
5020         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
5021         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5022         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
5023         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
5024         Use `header.' prefix.
5025         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5026
5027 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5028
5029         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
5030         __builtin_frame_address, use stack pointer.
5031
5032         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
5033         instead of __builtin_frame_pointer.
5034
5035 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5036
5037         * tst-basic1.c (do_test): Add cast to avoid warning.
5038         * tst-basic2.c (do_test): Likewise.
5039
5040         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
5041         amount of stack correction.
5042
5043         * tst-fork4.c: Use test-skeleton.c.
5044
5045 2003-03-14  Roland McGrath  <roland@redhat.com>
5046
5047         * init.c: Fix typo "#eli" for "#else".
5048
5049 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
5050
5051         * allocatestack.c (__stack_user): Use hidden_data_def.
5052         * pthread_create.c (__pthread_keys): Likewise.
5053
5054         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
5055
5056 2003-03-14  Roland McGrath  <roland@redhat.com>
5057
5058         * tst-fork4.c: New file.
5059         * Makefile (tests): Add it.
5060
5061         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
5062         we always define the padding space.
5063         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
5064         stopped supporting its own extensions fully.
5065         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
5066         struct also called `header', so `header.multiple_threads' is the field
5067         name to use on all machines.
5068         * allocatestack.c (allocate_stack): Use `header.' prefix.
5069         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5070         * pthread_create.c (__pthread_create_2_1): Likewise.
5071         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
5072         (THREAD_SELF): Likewise.
5073         * sysdeps/x86_64/tls.h: Likewise.
5074         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5075         (SINGLE_THREAD_P): Likewise.
5076         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5077         (SINGLE_THREAD_P): Likewise.
5078         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
5079         (SINGLE_THREAD_P): Likewise.
5080
5081         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
5082         value directly.
5083
5084 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5085
5086         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
5087         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
5088
5089         * pthread_create.c (start_thread): setjmp is expected to return 0.
5090
5091         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
5092         (THREAD_GETMEM_NC): Likewise.
5093
5094 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
5095
5096         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
5097         and the size of the stack which must be allocated is a multiple,
5098         allocate one more page.
5099         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
5100         MULTI_PAGE_ALIASING.
5101
5102 2003-03-13  Roland McGrath  <roland@redhat.com>
5103
5104         * pthread_create.c (start_thread): Set EXITING_BIT after the
5105         event-reporting (and destructors), not before.
5106
5107 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
5108
5109         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
5110         lll_futex_wake): Declare register variables as long int instead of
5111         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
5112         Make syscall arguments clobbered by the syscall.
5113         (lll_futex_wait): Define using lll_futex_timed_wait.
5114
5115         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
5116         to void *.
5117
5118         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
5119         PPID if [! NDEBUG].
5120
5121         * allocatestack.c (nptl_ncreated): Only declare if
5122         COLORING_INCREMENT != 0.
5123
5124         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
5125         (__libc_enable_asynccancel_2): Remove prototype.
5126
5127         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
5128         ctid to match kernel.
5129
5130 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5131
5132         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
5133         libc_multiple_threads.
5134         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
5135         __libc_multiple_threads to...
5136         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
5137
5138         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
5139         versioning.
5140         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5141         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5142
5143         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
5144         (__pthread_once_internal): Define.
5145
5146         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
5147         macros instead of .symver directly.
5148         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5149         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
5150
5151         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
5152         * sysdeps/x86_64/tcb-offsets.sym: New file.
5153         * sysdeps/x86_64/Makefile: New file.
5154
5155         * sysdeps/i386/tcb-offsets.sym: Add SELF.
5156         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
5157         to access own pthread_t in TCB.
5158         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5159         Likewise.
5160         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5161         Likewise.
5162         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5163
5164 2003-03-12  Roland McGrath  <roland@redhat.com>
5165
5166         * pthread-errnos.sym: New file.
5167         * Makefile (gen-as-const-headers): New variable, list that file.
5168         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
5169         header <pthread-errnos.h> instead of defining errno values here.
5170         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5171         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5172         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5173         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5174         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5175         Likewise.
5176         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5177         Likewise.
5178         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5179         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5180         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5181         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5182         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5183         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5184         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5185         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5186         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5187         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5188         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5189         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
5190         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
5191         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
5192         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
5193         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5194         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5195         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5196         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5197         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5198         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5199         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5200         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
5201         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
5202         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
5203         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5204         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5205
5206         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
5207         CLONE_CHILD_SETTID worked.
5208
5209 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5210
5211         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
5212         file.
5213         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
5214         file.
5215
5216         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5217         (pthread_cond_t): Add padding.
5218
5219         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
5220         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
5221         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
5222
5223         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
5224         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
5225         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
5226         (__pthread_rwlock_timedrdlock): Likewise.
5227         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
5228         (__pthread_rwlock_wrlock): Likewise.
5229         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
5230         (__pthread_rwlock_rdlock): Likewise.
5231
5232         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
5233
5234         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
5235         result of lock re-get if it fails.
5236
5237 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5238
5239         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
5240         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5241         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5242         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5243         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5244         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5245         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5246         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5247         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5248         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5249
5250         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
5251         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
5252
5253         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
5254         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
5255         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
5256         (create_thread): Likewise.
5257         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
5258         * init.c (__pthread_initialize_minimal_internal): Initialize
5259         __libc_multiple_threads_ptr if necessary.
5260         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
5261         __pthread_multiple_threads and __libc_multiple_threads_ptr.
5262         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
5263         __libc_multiple_threads.
5264         (__libc_pthread_init): Return pointer to __libc_pthread_init if
5265         necessary.
5266
5267         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
5268         (THREAD_SETMEM_NC): Likewise.
5269
5270         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
5271         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
5272         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
5273         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
5274
5275         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
5276         Eliminate one entire instruction.
5277
5278         * cancellation.c (__pthread_enable_asynccancel_2): New function.
5279         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
5280         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5281         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
5282         instead of __pthread_enable_asynccancel.
5283         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5284         (__pthread_cond_wait): Likewise.
5285         * sysdeps/pthread/pthread_cond_timedwait.c
5286         (__pthread_cond_timedwait): Likewise.
5287         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5288
5289         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5290         (__condvar_cleanup): Wake up all waiters in case we got signaled
5291         after being woken up but before disabling asynchronous
5292         cancellation.
5293         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5294         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5295         (__condvar_cleanup): Likewise.
5296
5297         * init.c (__NR_set_tid_address): If already defined, don't redefine.
5298         Make it an error if architecture has no #if case.  Add x86-64.
5299
5300         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
5301         pt-initfini.s generation.
5302
5303         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
5304         (TLS_INIT_TP): Fix typo.
5305
5306 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5307
5308         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
5309         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
5310
5311         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
5312         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
5313         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
5314         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
5315         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
5316         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5317         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5318         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5319
5320 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5321
5322         * sysdeps/pthread/pthread_cond_timedwait.c
5323         (__pthread_cond_timedwait): Return the result of the final
5324         locking.  If it succeeds, the regular function return value.
5325
5326         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
5327         Return result of the final locking.
5328         * version.c (__nptl_main): Work around problems with the strange
5329         INTERNAL_SYSCALL macro on ppc32.
5330         * init.c (__pthread_initialize_minimal_internal): Unblock
5331         SIGCANCEL in case the parent blocked it.
5332         Reported by Paul Mackerras <paulus@samba.org>.
5333
5334         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
5335         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
5336         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
5337
5338 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5339
5340         * sysdeps/pthread/pthread_cond_timedwait.c
5341         (__pthread_cond_timedwait): Unlock and fail if
5342         __pthread_mutex_unlock_internal failed.
5343
5344         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
5345         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
5346         Use ARCH_CLONE.
5347         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
5348         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
5349         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
5350         ALLOCATE_STACK): New macros.
5351         (TLS_TPADJ): New macro.
5352         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
5353         (allocate_stack): Handle TLS_DTV_AT_TP and
5354         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
5355         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
5356         Don't set PD->self.
5357         * init.c [__ia64__] (__NR_set_tid_address): Define.
5358
5359         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
5360         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
5361         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
5362         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
5363         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
5364         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
5365         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
5366         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
5367         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
5368         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
5369         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
5370         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
5371         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
5372         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
5373         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
5374         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
5375         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
5376         * sysdeps/ia64/bits/atomic.h: New file.
5377         * sysdeps/ia64/Makefile: New file.
5378         * sysdeps/ia64/pthread_spin_init.c: New file.
5379         * sysdeps/ia64/pthread_spin_lock.c: New file.
5380         * sysdeps/ia64/pthread_spin_trylock.c: New file.
5381         * sysdeps/ia64/pthread_spin_unlock.c: New file.
5382         * sysdeps/ia64/pthreaddef.h: New file.
5383         * sysdeps/ia64/tcb-offsets.sym: New file.
5384         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
5385         * sysdeps/ia64/tls.h: New file.
5386
5387         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
5388         to syscall instead of no arguments.
5389
5390 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
5391
5392         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
5393         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
5394         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
5395         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
5396
5397         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
5398         unused code.
5399
5400         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
5401
5402         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5403         lowlevelbarrier.sym.
5404         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
5405         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
5406         Include lowlevelbarrier.h and don't define offsets locally.
5407         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
5408
5409         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
5410         (__lll_mutex_lock_wait): Reverse order of first two parameters.
5411         (__lll_mutex_timedlock_wait): Likewise.
5412         (lll_mutex_lock): Adjust asm for that.
5413         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
5414         (lll_lock): Adjust asm for operand order change.
5415         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
5416         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
5417
5418         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
5419         Reverse order of parameters.
5420         (__lll_timedwait_tid): Remove regparms attribute.
5421         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
5422         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
5423
5424         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5425         (__lll_timedwait_tid): Remove one unnecessary instruction.
5426
5427         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
5428         __lll_mutex_timedlock_wait only for NOT_IN_libc.
5429         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
5430         lowlevelmutex.S.
5431
5432         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
5433         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
5434         for NOT_IN_libc.
5435         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
5436         lowlevellock.S.
5437
5438         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
5439         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
5440         for libc.so.
5441         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
5442         define LOCK here (if UP is not defined).  The actual code is in
5443         lowlevelmutex.S.
5444
5445         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
5446         LOCK is already defined.  Don't define lll_unlock_wake_cb and
5447         __lll_timedwait_tid for libc.so.
5448         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
5449         define LOCK here (if UP is not defined).  The actual code is in
5450         lowlevellock.S.
5451
5452         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
5453         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
5454         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
5455         instead of lowlevelsem.h.
5456         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5457         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5458         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5459
5460         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5461         lowlevelrwlock.sym.
5462         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
5463         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
5464         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
5465
5466         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
5467         register loading.
5468         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
5469         last changed.  D'oh.
5470
5471         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
5472
5473         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
5474         of __libc_locking_needed.
5475         (lll_trylock): Initialize %eax to zero.
5476
5477         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
5478         pthread_cond_t definition.
5479
5480 2003-03-10  Roland McGrath  <roland@redhat.com>
5481
5482         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
5483         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
5484         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
5485         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
5486         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
5487
5488         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
5489         Instead of setting PD->multiple_threads, set globals
5490         __pthread_multiple_threads and __libc_multiple_threads.
5491         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5492         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
5493         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
5494
5495         * descr.h (struct pthread): Conditionalize first member on
5496         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
5497         containing an anonymous tcbhead_t.  Move `list' member out.
5498         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
5499         * allocatestack.c: Remove use of `header.data.' prefix.
5500         * pthread_create.c: Likewise.
5501         * init.c (__pthread_initialize_minimal_internal): Likewise.
5502         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5503         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
5504         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
5505         * sysdeps/x86_64/tls.h: Likewise.
5506         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5507         (SINGLE_THREAD_P): Likewise.
5508         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5509         (SINGLE_THREAD_P): Likewise.
5510         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
5511         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
5512
5513 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
5514
5515         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
5516
5517         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
5518         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5519
5520         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
5521         leftovers from the ia32 code.
5522
5523         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
5524         memory load.
5525         (clear_once_control): Don't load %esi.
5526
5527         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
5528         handling.
5529
5530         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5531
5532         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
5533         * sysdeps/unix/sysv/linux/createthread.c: ...here.
5534
5535         * Makefile (tests): Add tst-cond10.
5536         * tst-cond10.c: New file.
5537
5538 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
5539
5540         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
5541         * tst-signal3.c (do_test): Likewise.
5542         * tst-sem5.c (do_test): Likewise.
5543         * tst-kill6.c (do_test): Likewise.
5544         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
5545
5546         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
5547         of inc/dec.
5548         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
5549         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
5550         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5551         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5552         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5553         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5554         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5555         Likewise.
5556         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5557         Likewise.
5558         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5559         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5560         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5561         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5562         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5563         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
5564         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5565         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5566
5567         * allocatestack.c (allocate_stack): If mprotect() fails free the
5568         TLS memory.
5569
5570 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
5571
5572         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
5573
5574         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
5575         lll_wake_tid.  This was used only to work around kernel limits in
5576         the early days.
5577         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
5578         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
5579         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5580         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
5581
5582         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
5583         (__pthread_initialize_minimal_internal): Change initialization of
5584         __static_tls_align_m1 appropriately.
5585         * pthreadP.h (__static_tls_align_m1): Renamed from
5586         __static_tls_align.
5587         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
5588         instead of __static_tls_align-1.
5589
5590 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
5591
5592         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
5593
5594         * pthread_create.c: Define __pthread_keys using nocommon
5595         attribute, not by placing it explicitly in bss.
5596         Remove DEFINE_DEALLOC definition.  Not needed anymore.
5597
5598         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
5599         Use it in mmap call to allocate stacks.
5600
5601         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
5602
5603         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
5604         result of the thread function.
5605
5606 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
5607
5608         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
5609         version is just fine.
5610
5611         * sysdeps/unix/sysv/linux/libc_pthread_init.c
5612         (__pthread_child_handler): Renamed from pthread_child_handler,
5613         exported, and marked hidden.  Change all users.
5614         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
5615         free __pthread_child_handler from child list.
5616
5617 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5618
5619         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
5620
5621         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5622         Fix handling of cancellation and failing pthread_mutex_unlock call.
5623         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5624         (__pthread_cond_wait): Likewise.
5625
5626         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
5627         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
5628         lll_futex_timed_wait call.
5629         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
5630         (pthread_rwlock_timedwrlock): Likewise.
5631
5632         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
5633         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
5634         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
5635
5636         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
5637         check of lll_futex_wake return value.
5638
5639 2003-03-03  Roland McGrath  <roland@redhat.com>
5640
5641         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
5642
5643         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5644         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
5645         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
5646
5647 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
5648
5649         * sysdeps/pthread/timer_create.c (timer_create): Return correct
5650         error for CPU clocks.
5651
5652         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5653         _POSIX_MONOTONIC_CLOCK.
5654         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5655
5656         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
5657         recent kernels.
5658
5659 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
5660
5661         * descr.h (struct pthread): Move cleanup field to the front.
5662
5663 2003-03-01  Roland McGrath  <roland@redhat.com>
5664
5665         * sem_open.c (sem_open): Braino fix.
5666
5667 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
5668
5669         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
5670         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
5671         __pthread_cleanup_pop functionality.
5672         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5673
5674         * descr.h (struct pthread): Move tid field to the front now that
5675         it is often used.
5676
5677         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
5678         (__lll_mutex_timedlock_wait): Remove.
5679         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
5680         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
5681         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
5682         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5683         (lll_unlock_wake_cb): Don't save and restore %esi.
5684         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
5685         %esi.
5686         (__lll_timedwait_tid): Add alignment.
5687         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
5688         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
5689         %esi.
5690         (__lll_timedwait_tid): Removed.
5691         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5692         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
5693         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5694         (pthread_barrier_wait): Don't save, load, and restore %esi for
5695         last thread.
5696         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
5697         (__pthread_cond_signal): Don't save, load, and restore %esi.
5698         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
5699         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
5700         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
5701         Don't save, load, and restore %esi.
5702
5703 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
5704
5705         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
5706         Release lock before waking up the waiters.
5707
5708         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
5709
5710         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
5711         (reader_thread): Likewise.
5712
5713         * sysdeps/pthread/pthread_rwlock_unlock.c
5714         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
5715         to wake up readers if there are none.
5716
5717         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
5718         Release internal lock before wake threads.
5719
5720 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
5721
5722         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
5723         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
5724         predefined.
5725         * tst-rwlock9.c: Likewise.
5726         * tst-rwlock10.c: New file.
5727         * tst-rwlock11.c: New file.
5728
5729         * Makefile (tests): Add tst-dlsym1.
5730         * tst-dlsym1.c: New file.
5731
5732         * init.c (__pthread_initialize_minimal_internal): Set
5733         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
5734         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
5735
5736 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
5737
5738         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
5739
5740         * tst-cond2.c: Fix sychronization with child.
5741
5742         * tst-rwlock8.c (reader_thread): Remove unused variable.
5743
5744         * Makefile: Add rules to build and run tst-tls3.
5745         * tst-tls3.c: New file.
5746         * tst-tls3mod.c: New file.
5747
5748         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
5749         * tst-rwlock8.c: New file.
5750         * tst-rwlock9.c: New file.
5751         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
5752         complete broken rwlock implementation.
5753         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5754         Likewise.
5755         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5756         Likewise.
5757         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5758         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5759         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
5760         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
5761         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
5762         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
5763         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
5764
5765 2003-02-23  Roland McGrath  <roland@redhat.com>
5766
5767         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
5768
5769 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
5770
5771         * Makefile (tests): Add tst-context1.
5772         * tst-context1.c: New file.
5773
5774         * Makefile (tests): Add tst-tls1 and tst-tls2.
5775         * tst-tls1.c: New file.
5776         * tst-tls2.c: New file.
5777
5778         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
5779         for failed cmpxchg.
5780
5781         * pthread_create.c (start_thread): Set EXITING_BIT early.
5782
5783         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
5784         (THREAD_GETMEM_NC): Likewise.
5785
5786 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
5787
5788         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
5789         off 3 more bytes by using offset-less instructions when possible.
5790
5791         * Makefile: Add dependency for $(objpfx)version.d.
5792
5793         * eintr.c (eintr_source): Add unnecessary return but the compiler
5794         insists.
5795
5796         * tst-kill3.c: Include <unistd.h>.
5797
5798 2003-02-21  Roland McGrath  <roland@redhat.com>
5799
5800         * pthread_create.c (start_thread): Call __libc_thread_freeres.
5801
5802 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
5803
5804         * Makefile (tests): Add tst-eintr1.
5805         (distribute): Add eintr.c.
5806         * tst-eintr1.c: New file.
5807         * eintr.c: New file.
5808
5809         * pthread_cancel.c (pthread_cancel): Use tkill directly.
5810
5811         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
5812         Disallow sending SIGCANCEL.
5813
5814         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
5815         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
5816         * tst-kill1.c: New file.
5817         * tst-kill2.c: New file.
5818         * tst-kill3.c: New file.
5819         * tst-kill5.c: New file.
5820         * tst-kill6.c: New file.
5821         * tst-basic7.c: Renamed to...
5822         * tst-kill4.c: ...this.
5823
5824 2003-02-21  Roland McGrath  <roland@redhat.com>
5825
5826         * Makefile (install-lib-ldscripts): New variable.
5827
5828 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
5829
5830         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
5831         * pthread_cancel.c: Use INVALID_TD_P.
5832         * pthread_detach.c: Likewise.
5833         * pthread_getschedparam.c: Likewise.
5834         * pthread_setschedparam.c: Likewise.
5835         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
5836         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5837         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
5838         * pthread_timedjoin.c: Likewise.
5839
5840         * tst-basic7.c: Include <signal.h>.
5841
5842         * pthread_join.c (pthread_join): Limited checking for invalid
5843         descriptors.
5844         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
5845
5846 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
5847
5848         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
5849         beginning of the loop.  Clear the entire first block of TSD.
5850         * Makefile (tests): Add tst-key4.
5851         * tst-key4.c: New file.
5852
5853 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
5854
5855         * Makefile (tests): Add tst-basic7.
5856         * tst-basic7.c: New file.
5857
5858         * pthread_create.c (deallocate_tsd): Mark as internal_function.
5859         Add some more __builtin_expect.
5860
5861         * pthreadP.h: Define dummy version of DEBUGGING_P.
5862
5863 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
5864
5865         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
5866         _POSIX_THREAD_PRIORITY_SCHEDULING.
5867         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
5868         _XOPEN_REALTIME_THREADS.
5869         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
5870
5871         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
5872         kernel returns EINVAL for PID <= 0, work around it.
5873
5874         * Makefile (tests): Add tst-signal5.
5875         * tst-signal5.c: New file.
5876
5877         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
5878         and LOGIN_NAME_MAX.
5879
5880         * tst-cancel1.c (tf): Block all signals.
5881
5882         * Makefile (tests): Add tst-basic6.
5883         * tst-basic6.c: New file.
5884
5885         * tst-basic1.c: Add test for process ID.
5886
5887         * Makefile (tests): Add tst-cancel10.
5888         * tst-cancel10.c: New file.
5889
5890         * Makefile (tests): Add tst-signal4.
5891         * tst-signal4.c: New file.
5892
5893         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
5894         __sigismember instead of sigismember.  Add __builtin_expect.
5895
5896 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
5897
5898         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
5899         pthread_setcancelstate, and pthread_rwlock_setpshared.
5900
5901         * tst-cancel7.c (do_test): Make sure the pid file exists before
5902         canceling the thread.
5903
5904         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
5905         pthread_rwlock_timedrdlock tests.
5906         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
5907         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5908         Check for invalid tv_nsec field.
5909         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5910         Likewise.
5911
5912         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
5913         recursive mutex of overflow.
5914
5915         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
5916
5917         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
5918         going into an endless loop.
5919         * Makefile (tests): Add tst-cancel9.
5920         * tst-cancel9.c: New file.
5921
5922         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
5923
5924 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
5925
5926         * tst-mutex5.c (do_test): Add more timedlock tests.
5927
5928         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
5929         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
5930
5931         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
5932         use INLINE_SYSCALL.  Error number is returned, not -1.
5933
5934         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
5935         and __deallocate_stack with internal_function.
5936         * pthread_create.c: Adjust definitions appropriately.
5937         * allocatestack.c: Likewise.
5938
5939         * pthread_join.c: Add one more __builtin_expect.
5940         * pthread_timedjoin.c: Likewise.
5941
5942         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
5943         not data of sequence number does not match.
5944         Add one __builtin_expect.
5945
5946         * Makefile (tests): Add tst-clock1.
5947         * tst-clock1.c: New file.
5948
5949         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
5950         negative arguments.
5951         * Makefile (tests): Add tst-basic5.
5952         * tst-basic5.c: New file.
5953
5954 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
5955
5956         * Makefile (tests): Add tst-basic4.
5957         * tst-basic4.c: New file.
5958
5959         * pthreadP.h: Add declaraction for __nptl_nthreads.
5960         * pthread_create.c: Define __nptl_nthreads
5961         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
5962         after thread is done.  If then zero, call exit(0).
5963         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5964         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
5965         * init.c (pthread_functions): Initialize ptr_nthreads.
5966         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
5967         (__reclaim_stacks): Decrement __nptl_nthreads.
5968         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
5969         Define.
5970         * Makefile (tests): Add tst-basic3.
5971         * tst-basic3.c: New file.
5972
5973         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
5974         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
5975         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
5976         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
5977         if asynchronous canceling is enabled.
5978         * pthread_join.c (pthread_join): When recognizing circular joins,
5979         take into account the other thread might be already canceled.
5980         * Makefile (tests): Add tst-join5.
5981         * tst-join5.c: New file.
5982
5983         * Makefile (tests): Add tst-join4.
5984         * tst-join4.c: New file.
5985
5986 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
5987
5988         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
5989
5990 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5991
5992         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
5993         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
5994         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
5995         warning.
5996         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
5997         to avoid warning.
5998         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
5999         error if lll_futex_wake failed.
6000
6001 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
6002
6003         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
6004         handling of cancellation and failung pthread_mutex_unlock call.
6005         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6006         * Makefile (tests): Add tst-cond8 and tst-cond9.
6007         * tst-cond8.c: New file.
6008         * tst-cond9.c: New file.
6009
6010         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
6011
6012         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
6013         non-standard initializers with __USE_GNU.
6014
6015         * Makefile (tests): Add tst-cleanup3.
6016         * tst-cleanup3.c: New file.
6017
6018 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
6019
6020         * Makefile (tests): Add tst-attr1 and tst-attr2.
6021         * tst-attr1.c: New file.
6022         * tst-attr2.c: New file.
6023
6024         * Makefile: Add rules to build and run tst-atfork2 test.
6025         * tst-atfork2.c: New file.
6026         * tst-atfork2mod.c: New file.
6027
6028         * sysdeps/unix/sysv/linux/unregister-atfork.c
6029         (__unregister_atfork): Free the memory allocated for the handlers
6030         after removing them from the lists.
6031
6032         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
6033         cleanup function.
6034
6035         * tst-atfork1.c (do_test): Wait for the child we forked.
6036         Report error in child.
6037
6038         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
6039
6040         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
6041
6042 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
6043
6044         * Makefile (tests): Add tst-cancel8.
6045         * tst-cancel8.c: New file.
6046
6047         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
6048         clearing of control variable.
6049         * Makefile (tests): Add tst-once3 and tst-once4.
6050         * tst-once3.c: New file.
6051         * tst-once4.c: New file.
6052
6053 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
6054
6055         * sysdeps/sh/Makefile: New file.
6056         * sysdeps/sh/bits/atomic.h: New file.
6057         * sysdeps/sh/pthread_spin_init.c: New file.
6058         * sysdeps/sh/pthread_spin_lock.c: New file.
6059         * sysdeps/sh/pthread_spin_trylock.S: New file.
6060         * sysdeps/sh/pthread_spin_unlock.S: New file.
6061         * sysdeps/sh/pthreaddef.h: New file.
6062         * sysdeps/sh/tcb-offsets.sym: New file.
6063         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
6064         * sysdeps/sh/tls.h: New file.
6065         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
6066         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
6067         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
6068         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
6069         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
6070         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
6071         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
6072         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
6073         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
6074         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
6075         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
6076         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
6077         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
6078         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
6079         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
6080         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
6081         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
6082         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
6083         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
6084         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
6085         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
6086         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
6087         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
6088         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
6089         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
6090         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
6091         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
6092         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
6093         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
6094         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
6095
6096 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
6097
6098         * tst-cond2.c: Rearrange code to not rely on behavior undefined
6099         according to POSIX.
6100
6101         * tst-basic2.c (do_test): Lock mutex before creating the thread.
6102
6103 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
6104
6105         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
6106         (TLS_GET_FS): New #define.
6107         (TLS_SET_FS): New #define.
6108         Correct value of __NR_set_thread_area.
6109
6110         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
6111
6112 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
6113
6114         * Makefile (tests): Add tst-popen1.
6115         * tst-popen1.c: New file.
6116
6117         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
6118         but inactive generalization.
6119         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6120         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6121         Minor optimization, remove one instruction.
6122         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6123
6124 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6125
6126         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
6127
6128 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6129
6130         * init.c (__NR_set_tid_address): Add #ifdef for s390.
6131         * sysdeps/pthread/pthread_barrier_wait.c: New file.
6132         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
6133         * sysdeps/pthread/pthread_cond_signal.c: New file.
6134         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
6135         * sysdeps/pthread/pthread_cond_wait.c: New file.
6136         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
6137         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
6138         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
6139         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
6140         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
6141         * sysdeps/s390/Makefile: New file.
6142         * sysdeps/s390/bits/atomic.h: New file.
6143         * sysdeps/s390/pthread_spin_init.c: New file.
6144         * sysdeps/s390/pthread_spin_lock.c: New file.
6145         * sysdeps/s390/pthread_spin_trylock.c: New file.
6146         * sysdeps/s390/pthread_spin_unlock.c: New file.
6147         * sysdeps/s390/pthreaddef.h: New file.
6148         * sysdeps/s390/tcb-offsets.sym: New file.
6149         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
6150         * sysdeps/s390/tls.h: New file.
6151         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
6152         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
6153         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
6154         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
6155         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
6156         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
6157         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6158         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
6159         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
6160         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
6161         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
6162         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
6163         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
6164         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
6165         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
6166         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
6167         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
6168         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
6169         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
6170         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
6171         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
6172         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6173         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
6174
6175 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
6176
6177         * atomic.h: Add a couple more default implementations.
6178         (atomic_compare_and_exchange_acq): Use
6179         __arch_compare_and_exchange_32_acq in return value definition.  It
6180         always exists.
6181         (atomic_bit_set): Renamed from atomic_set_bit.
6182         Add missing atomic_ prefixes.
6183
6184         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
6185         thread library is available, use correct value to mark initialized
6186         once variable.
6187
6188 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
6189
6190         * allocatestack.c (allocate_stack): Use __getpagesize instead of
6191         __sysconf to determine pagesize.
6192
6193         * pthread_create.c: Include <atomic.h>.
6194         * allocatestack.c (allocate_stack): Implement coloring of the
6195         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
6196         size minus one.  Adjust users.
6197         * sysdeps/i386/i686/Makefile: New file.
6198
6199 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
6200
6201         * allocatestack.c: Improve comment throughout the file.
6202
6203         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6204         (__lll_lock_wait): Add branch prediction.
6205         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
6206         (__lll_lock_wait): Likewise.
6207         (lll_unlock_wake_cb): Removed.
6208
6209 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
6210
6211         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
6212         _POSIX_THREAD_PRIORITY_SCHEDULING.
6213
6214 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
6215
6216         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6217         Fix return type of ptr___pthread_getspecific.
6218
6219 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
6220
6221         * Makefile (tests): Add tst-umask1.
6222         (tst-umask1-ARGS): Define.
6223         * tst-umask1.c: New file.
6224
6225 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
6226
6227         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
6228         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
6229         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
6230         pthread_rwlock_unlock.
6231         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
6232         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
6233         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
6234         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
6235         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6236         New file.
6237         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
6238         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6239         New file.
6240         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
6241         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
6242         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
6243         New file.
6244         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
6245         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
6246         New file.
6247         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
6248         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
6249         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
6250         New file.
6251         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
6252         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
6253         New file.
6254         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
6255
6256         * Makefile (libpthread-routines): Remove lowlevelcond and
6257         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
6258         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
6259         and pthread_cond_broadcast.
6260         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
6261         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
6262         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
6263         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
6264         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
6265         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
6266         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
6267         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
6268         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
6269         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
6270         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
6271         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
6272         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
6273         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
6274         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
6275         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
6276         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
6277         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
6278         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
6279         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
6280         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
6281         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
6282         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
6283         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
6284         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
6285         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
6286         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
6287         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
6288         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
6289         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
6290         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
6291
6292         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
6293         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
6294         of the code is moved to ...
6295         * sysdeps/pthread/createthread.c: ...here.  New file.
6296
6297 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
6298
6299         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
6300         (__new_sem_post): Clear %eax before returning.
6301         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
6302
6303         * Makefile (tests): Add tst-cleanup2.
6304         * tst-cleanup2.c: New file.
6305
6306         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6307         Interpret first parameter correctly.
6308
6309 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
6310
6311         * Makefile (headers): Add bits/semaphore.h.
6312
6313 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
6314
6315         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
6316         if not SHARED.
6317
6318 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
6319
6320         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
6321         must be used and mapping failed.
6322         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
6323
6324         * Makefile (CFLAGS-pthread_self.os): Define this, not
6325         CFLAGS-pthread_self.c.
6326
6327 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6328
6329         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
6330         lll_unlock_wake_cb.
6331
6332         * Makefile (libpthread-routines): Add version.  Add rules to build
6333         version.os and banner.h.
6334         * version.c: New file.
6335
6336 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
6337
6338         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
6339         the alias unconditional.
6340         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
6341
6342 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6343
6344         * Makefile (CFLAGS-pthread_self.c): New definition.
6345
6346 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6347
6348         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
6349         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
6350         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
6351         * init.c (__pthread_initialize_minimal_internal): Likewise.
6352
6353 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
6354
6355         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
6356
6357         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6358         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6359         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6360         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6361         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6362         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6363
6364 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6365
6366         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
6367         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
6368         * tst-cancel-wrappers.sh: Remove all exceptions.
6369
6370 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
6371
6372         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
6373         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
6374
6375         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
6376         Use __libc_pthread_functions array if SHARED.
6377
6378         * pthreadP.h: Move pthread_cond_2_0_t definition to...
6379         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
6380
6381         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
6382         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
6383         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
6384         __libc_ptf_call instead of __libc_maybe_call.
6385         (PTF): New #define.
6386         (__libc_cleanup_region_start): Wrap function name with PTF call.
6387         (__libc_cleanup_region_end): Likewise.
6388         (__libc_cleanup_end): Likewise.
6389
6390         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
6391         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
6392         * pthread_key_create.c: Add __pthread_key_create_internal alias.
6393         * pthreadP.h: Add prototypes.
6394
6395         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
6396         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
6397         __pthread_rwlock_unlock aliases.
6398         * pthreadP.h: Add prototypes for new aliases.
6399
6400         * pthreadP.h (struct pthead_functions): Moved to...
6401         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
6402         * init.c (pthread_functions): Add initializers for new elements.
6403
6404         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
6405         __pthread_cleanup_pop_restore aliases.
6406         * pthreadP.h: Add prototypes.
6407
6408         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
6409         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
6410         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
6411         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
6412         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
6413         * pthreadP.h: Adjust prototypes and callers.
6414
6415 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
6416
6417         * Makefile (tests): Add tst-cancel7.
6418         (tst-cancel7-ARGS): New variable.
6419         * tst-cancel7.c: New file.
6420
6421         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
6422         around gcc defficiencies.
6423         * old_pthread_cond_signal.c: Likewise.
6424         * old_pthread_cond_timedwait.c: Likewise.
6425         * old_pthread_cond_wait.c: Likewise.
6426
6427         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
6428
6429 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6430
6431         * Makefile (tests): Add tst-cond7.
6432         * tst-cond7.c: New file.
6433
6434         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6435         (condvar_cleanup): Get condvar address from the right place.
6436
6437         * atomic.h: Correct definitions of atomic_full_barrier,
6438         atomic_read_barrier, atomic_write_barrier.
6439
6440         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
6441         race-free.
6442         * old_pthread_cond_signal.c: Likewise.
6443         * old_pthread_cond_timedwait.c: Likewise.
6444         * old_pthread_cond_wait.c: Likewise.
6445
6446 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
6447
6448         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
6449
6450 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6451
6452         * pthreadP.h (pthread_cond_2_0_t): New type.
6453         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
6454         Use new type for the 2.0 condvar function prototypes.
6455         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
6456         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
6457         parameter.
6458         * old_pthread_cond_destroy.c: Likewise.
6459         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
6460         * old_pthread_cond_signal.c: Likewise.
6461         * old_pthread_cond_timedwait.c: Likewise.
6462         * old_pthread_cond_wait.c: Likewise.
6463
6464         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6465         (__pthread_cond_wait): Don't save cancellation mode and seq value
6466         in same location.
6467
6468         * herrno.c (__h_errno_location): Don't define as weak.
6469
6470 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6471
6472         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
6473         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
6474         and pthread_cond_wait.
6475         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
6476         Renamed to...
6477         (__pthread_cond_broadcast_2_0): ... this.
6478         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
6479         Renamed to...
6480         (__pthread_cond_destroy_2_0): ... this.
6481         * old_pthread_cond_init.c (__old_pthread_cond_init):
6482         Renamed to...
6483         (__pthread_cond_init_2_0): ... this.
6484         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
6485         Renamed to...
6486         (__pthread_cond_signal_2_0): ... this.
6487         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
6488         Renamed to...
6489         (__pthread_cond_wait_2_0): ... this.
6490         * pthread_cond_destroy.c: Include shlib-compat.h.
6491         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
6492         * pthread_cond_init.c: Include shlib-compat.h.
6493         (pthread_cond_init): Change strong_alias into versioned_symbol.
6494         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
6495         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
6496         fields.
6497         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
6498         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
6499         __pthread_cond_wait_2_0): New prototypes.
6500         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
6501         __old_pthread_cond_init, __old_pthread_cond_signal,
6502         __old_pthread_cond_wait): Removed.
6503         * init.c: Include shlib-compat.h.
6504         (pthread_functions): Guard ptr___pthread_attr_init_2_0
6505         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
6506         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
6507         ptr___pthread_cond_*_2_0 fields.
6508         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
6509         pthread_cond_*@GLIBC_2.0 compatibility symbols.
6510
6511         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
6512         LIBC_SIGACTION was not yet defined.
6513         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
6514         [!defined LIBC_SIGACTION] (__sigaction): New function and
6515         libc_hidden_weak.
6516         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
6517         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
6518
6519 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6520
6521         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
6522
6523 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
6524
6525         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6526         New, larger type definition.
6527         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
6528         implementation.
6529         * Versions [libpthread]: Add definitions for new pthread_cond_*
6530         interfaces for version GLIBC_2.3.2.
6531         * pthread_cond_init.c: Update initialization for new type definition.
6532         * Makefile (libpthread-routines): Remove pthread_cond_wait,
6533         pthread_cond_timedwait, pthread_cond_signal, and
6534         pthread_cond_broadcast.  Add old_pthread_cond_init,
6535         old_pthread_cond_destroy, old_pthread_cond_wait,
6536         old_pthread_cond_timedwait, old_pthread_cond_signal, and
6537         old_pthread_cond_broadcast.
6538         * old_pthread_cond_broadcast.c: New file.
6539         * old_pthread_cond_destroy.c: New file.
6540         * old_pthread_cond_init.c: New file.
6541         * old_pthread_cond_signal.c: New file.
6542         * old_pthread_cond_timedwait.c: New file.
6543         * old_pthread_cond_wait.c: New file.
6544         * pthreadP.h: Add prototypes for the compatibility interfaces.
6545
6546         * pthread_cond_destroy.c: Don't include <errno.h>.
6547
6548 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
6549
6550         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
6551         unnecessary zero offset when addressing MUTEX.
6552
6553 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6554
6555         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6556         __register_atfork.
6557         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
6558         for __register_atfork.
6559
6560 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6561
6562         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
6563         instead of ASSEMBLER test macro.
6564
6565         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
6566         __libc_current_sigrtmax): Add libc_hidden_def.
6567
6568         * sysdeps/pthread/list.h: Remove assert.h include.
6569
6570 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6571
6572         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
6573         __pthread_initialize_minimal_internal not
6574         __pthread_initialize_minimal.
6575
6576 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
6577
6578         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
6579         __pthread_initialize_minimal as hidden.
6580
6581         * init.c (__pthread_initialize_minimal_internal): Don't mark as
6582         constructor.
6583
6584 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6585
6586         * Makefile ($(inst_libdir)/libpthread.so): Depend on
6587         $(common-objpfx)format.lds, include that into the output script.
6588         Fix comment.
6589         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
6590
6591 2002-12-28  Andreas Jaeger  <aj@suse.de>
6592
6593         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
6594         nsec resolution changes.
6595         (xstat64_conv): Likewise.
6596         (xstat32_conv): Likewise.
6597         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
6598         struct kernel_stat.
6599         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
6600         structs stat and stat64.
6601         * time/time.h (__timespec_defined): Define for __USE_MISC.
6602         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
6603
6604 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
6605
6606         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
6607         argument.
6608         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
6609         (pthread_exit): Use strong_alias to avoid warnings.
6610         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
6611         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
6612         ptr___pthread_attr_init_2_*.
6613         * init.c (pthread_functions): Adjust.
6614
6615 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
6616
6617         * forward.c: Make all functions available by default again.  It
6618         caused too much trouble.
6619
6620         * pt-siglongjmp.c: Removed.
6621
6622 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
6623
6624         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
6625         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
6626         * sysdeps/i386/Makefile: New file.
6627         * sysdeps/i386/tcb-offsets.sym: New file.
6628         * sysdeps/pthread/tcb-offsets.h: New file.
6629         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6630         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
6631
6632         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
6633         __register_atfork...
6634         (GLIBC_2.3.2): ...here.
6635
6636 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
6637
6638         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
6639         pthread_attr_setstackaddr with __attribute_deprecated__.
6640
6641 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
6642
6643         * pt-system.c (system): Remove cancellation handling.
6644         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
6645         cancellation routines.
6646
6647 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
6648
6649         * descr.h: Include <dl-sysdep.h>.
6650         (struct pthread): Move header.data.list to the back of the struct.
6651         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
6652         (MULTIPLE_THREADS_OFFSET): Adjust offset.
6653         (SYSINFO_OFFSEET): Likewise.
6654
6655 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
6656
6657         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
6658         Define.
6659         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
6660         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
6661         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
6662         (USE_DL_SYSINFO): Undef.
6663
6664 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
6665
6666         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
6667         $(common-objpfx)libc.so.
6668         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
6669         it is bigger than pipe buffer size even on arches with bigger
6670         page size.
6671         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
6672
6673 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
6674
6675         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
6676         correct errno access for case that USE___THREAD is not defined.
6677
6678 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
6679
6680         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
6681         Patch by Marijn Ros <marijn@mad.scientist.com>.
6682
6683 2002-12-22  Roland McGrath  <roland@redhat.com>
6684
6685         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
6686
6687 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
6688
6689         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
6690
6691 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
6692
6693         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
6694         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
6695         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
6696
6697         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
6698         of int $0x80.
6699         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6700         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
6701         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
6702         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
6703         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
6704         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
6705         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
6706         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
6707
6708         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
6709         sysenter.
6710         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
6711
6712         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
6713
6714         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
6715         in new TCB.
6716         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
6717         that sysinfo is properly initialized.
6718         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
6719         to 1 only for ld.so.
6720
6721         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
6722         RTLD_CORRECT_DYNAMIC_WEAK.
6723
6724 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
6725
6726         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
6727         Use return 0 as 6th argument to FORWARD4.
6728         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
6729
6730 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
6731
6732         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
6733         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
6734         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
6735         (INIT_SYSINFO): New #define.
6736         (TLS_TP_INIT): Use INIT_SYSINFO.
6737         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6738         At test to make sure SYSINFO_OFFSET value is correct.
6739         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
6740
6741 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
6742
6743         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
6744         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
6745         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
6746         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
6747         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
6748         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
6749         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
6750
6751 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
6752
6753         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
6754         macro instead of using int $0x80 directly.
6755
6756         * sysdeps/pthread/bits/stdio-lock.h: New file.
6757         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
6758         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
6759         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
6760         * Makefile (routines): Add libc-lowlevelmutex.
6761
6762         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
6763         __i686.get_pc_thunk.dx.
6764
6765 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
6766
6767         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
6768         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
6769         ($(objpfx)tst-cancel-wrappers.out): New rule.
6770         * tst-cancel-wrappers.sh: New test.
6771         * tst-locale1.c: Include signal.h.
6772         (uselocale): Test static linking of __libc_current_sigrt*.
6773
6774 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
6775
6776         * Makefile (tests): Add tst-cancel6.
6777         * tst-cancel6.c: New file
6778
6779 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
6780
6781         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
6782         Define meaningfully for assembler as well.
6783         * pthreadP.h (struct pthread_functions): Remove
6784         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
6785         and ptr_pthread_attr_init_2_1 fields.
6786         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
6787         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
6788         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
6789         (FORWARD3): Define using FORWARD4.
6790         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
6791         versions.
6792         * pt-system.c: Remove duplicate stdlib.h include.
6793
6794 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
6795
6796         * sem_init.c: Define sem_init@GLIBC_2.0.
6797         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
6798         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
6799
6800         * flockfile.c: Moved to...
6801         * sysdeps/pthread/flockfile.c: ...here.  New file.
6802         * funlockfile.c: Moved to...
6803         * sysdeps/pthread/funlockfile.c: ...here.  New file.
6804         * ftrylockfile.c: Moved to...
6805         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
6806
6807 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
6808
6809         * libc-cancellation.c: Guard both function with
6810         #if !defined NOT_IN_libc.
6811         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
6812         automatically provided pthread wrappers.
6813         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
6814         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
6815         nor in libpthread.
6816         * pt-open.c: Removed.
6817         * pt-fcntl.c: Removed.
6818         * pt-fsync.c: Removed.
6819         * pt-lseek.c: Removed.
6820         * pt-msgrcv.c: Removed.
6821         * pt-msgsnd.c: Removed.
6822         * pt-msync.c: Removed.
6823         * pt-nanosleep.c: Removed.
6824         * pt-open64.c: Removed.
6825         * pt-pause.c: Removed.
6826         * pt-pread.c: Removed.
6827         * pt-pread64.c: Removed.
6828         * pt-pwrite.c: Removed.
6829         * pt-pwrite64.c: Removed.
6830         * pt-read.c: Removed.
6831         * pt-recv.c: Removed.
6832         * pt-recvfrom.c: Removed.
6833         * pt-recvmsg.c: Removed.
6834         * pt-send.c: Removed.
6835         * pt-sendto.c: Removed.
6836         * pt-sigtimedwait.c: Removed.
6837         * pt-sigwait.c: Removed.
6838         * pt-wait.c: Removed.
6839         * pt-waitpid.c: Removed.
6840         * pt-write.c: Removed.
6841         * pt-accept.c: Removed.
6842         * pt-close.c: Removed.
6843         * pt-connect.c: Removed.
6844         * pt-lseek64.c: Removed.
6845         * pt-sendmsg.c: Removed.
6846         * pt-tcdrain.c: Removed.
6847
6848 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
6849
6850         * init.c (__pthread_initialize_minimal_internal): Renamed from
6851         __pthread_initialize_minimal.  Make old name an alias.  This
6852         converts a normal relocation into a relative relocation.
6853
6854         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
6855
6856         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
6857         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
6858         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
6859         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
6860         pt-sigwaitinfo, pt-waitid, and pt-writev.
6861         * pt-creat.c: Removed.
6862         * pt-poll.c: Removed.
6863         * pt-pselect.c: Removed.
6864         * pt-readv.c: Removed.
6865         * pt-select.c: Removed.
6866         * pt-sigpause.c: Removed.
6867         * pt-sigsuspend.c: Removed.
6868         * pt-sigwaitinfo.c: Removed.
6869         * pt-waitid.c: Removed.
6870         * pt-writev.c: Removed.
6871
6872         * init.c (pthread_functions): New variable.
6873         (__pthread_initialize_minimal): Pass pointer to pthread_functions
6874         (or NULL) to __libc_pthread_init.
6875         * forward.c: Rewrite to use __libc:pthread_functions array to get
6876         function addresses.
6877         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
6878         prototype.
6879         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6880         Take new parameter.  Copy content of variable pointed to by it
6881         to __libc_pthread_init.
6882
6883         * pthreadP.h (struct pthread_functions): New type.
6884         (__libc_pthread_init): Declare.
6885
6886         * pthread_attr_destroy.c: Add namespace protected alias.
6887         * pthread_attr_getdetachstate.c: Likewise.
6888         * pthread_attr_getinheritsched.c: Likewise.
6889         * pthread_attr_getschedparam.c: Likewise.
6890         * pthread_attr_getschedpolicy.c: Likewise.
6891         * pthread_attr_getscope.c: Likewise.
6892         * pthread_attr_setdetachstate.c: Likewise.
6893         * pthread_attr_setinheritsched.c: Likewise.
6894         * pthread_attr_setschedparam.c: Likewise.
6895         * pthread_attr_setschedpolicy.c: Likewise.
6896         * pthread_attr_setscope.c: Likewise.
6897         * pthread_cond_broadcast.c: Likewise.
6898         * pthread_cond_destroy.c: Likewise.
6899         * pthread_cond_init.c: Likewise.
6900         * pthread_cond_signal.c: Likewise.
6901         * pthread_cond_wait.c: Likewise.
6902         * pthread_condattr_destroy.c: Likewise.
6903         * pthread_condattr_init.c: Likewise.
6904         * pthread_equal.c: Likewise.
6905         * pthread_exit.c: Likewise.
6906         * pthread_getschedparam.c: Likewise.
6907         * pthread_self.c: Likewise.
6908         * pthread_setcancelstate.c: Likewise.
6909         * pthread_setschedparam.c: Likewise.
6910         * pthread_mutex_destroy.c: Likewise.
6911         * pthread_mutex_init.c: Likewise.
6912         * pthreadP.h: Add prototypes for the aliases.
6913
6914         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
6915         multiple_threads member in correct TCB to 1.
6916
6917         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
6918         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
6919         member of thread decriptor, otherwise return unconditionally 1.
6920
6921 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
6922
6923         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
6924         regular Linux version.  Remove file.
6925         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
6926         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
6927         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
6928         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
6929         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
6930         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
6931         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
6932         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
6933         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
6934         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
6935         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
6936         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
6937         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
6938         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
6939         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
6940         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
6941         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
6942         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
6943         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
6944         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
6945         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
6946         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
6947         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
6948         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
6949         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
6950         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
6951         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
6952         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
6953         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
6954         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
6955
6956 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
6957
6958         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
6959         * sysdeps/unix/sysv/linux/open.c: Removed.
6960         * sysdeps/unix/sysv/linux/fsync.c: Removed.
6961         * sysdeps/unix/sysv/linux/lseek.c: Removed.
6962         * sysdeps/unix/sysv/linux/msync.c: Removed.
6963         * sysdeps/unix/sysv/linux/read.c: Removed.
6964         * sysdeps/unix/sysv/linux/close.c: Removed.
6965         * sysdeps/unix/sysv/linux/creat.c: Removed.
6966         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
6967         * sysdeps/unix/sysv/linux/pause.c: Removed.
6968         * sysdeps/unix/sysv/linux/select.c: Removed.
6969         * sysdeps/unix/sysv/linux/write.c: Removed.
6970
6971 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
6972
6973         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
6974         element in TCB to see whether locking is needed.
6975
6976         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
6977         MULTIPLE_THREADS_OFFSET value is correct.
6978
6979         * sysdeps/unix/sysv/linux/close.c: New file.
6980         * sysdeps/unix/sysv/linux/connect.S: New file.
6981         * sysdeps/unix/sysv/linux/creat.c: New file.
6982         * sysdeps/unix/sysv/linux/fsync.c: New file.
6983         * sysdeps/unix/sysv/linux/llseek.c: New file.
6984         * sysdeps/unix/sysv/linux/lseek.c: New file.
6985         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
6986         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
6987         * sysdeps/unix/sysv/linux/msync.c: New file.
6988         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
6989         * sysdeps/unix/sysv/linux/open.c: New file.
6990         * sysdeps/unix/sysv/linux/open64.c: New file.
6991         * sysdeps/unix/sysv/linux/pause.c: New file.
6992         * sysdeps/unix/sysv/linux/poll.c: New file.
6993         * sysdeps/unix/sysv/linux/pread.c: New file.
6994         * sysdeps/unix/sysv/linux/pread64.c: New file.
6995         * sysdeps/unix/sysv/linux/pselect.c: New file.
6996         * sysdeps/unix/sysv/linux/pwrite.c: New file.
6997         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
6998         * sysdeps/unix/sysv/linux/readv.c: New file.
6999         * sysdeps/unix/sysv/linux/recv.S: New file.
7000         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
7001         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
7002         * sysdeps/unix/sysv/linux/select.c: New file.
7003         * sysdeps/unix/sysv/linux/send.S: New file.
7004         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
7005         * sysdeps/unix/sysv/linux/sendto.S: New file.
7006         * sysdeps/unix/sysv/linux/sigpause.c: New file.
7007         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
7008         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7009         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7010         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7011         * sysdeps/unix/sysv/linux/system.c: New file.
7012         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
7013         * sysdeps/unix/sysv/linux/wait.c: New file.
7014         * sysdeps/unix/sysv/linux/waitid.c: New file.
7015         * sysdeps/unix/sysv/linux/waitpid.c: New file.
7016         * sysdeps/unix/sysv/linux/writev.c: New file.
7017         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
7018
7019         * pt-readv.c: Fix comment.
7020
7021 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
7022
7023         * tst-cleanup1.c: Include stdlib.h.
7024
7025         * tst-cancel5.c: New test.
7026         * Makefile (tests): Add tst-cancel5.
7027         (tst-cancel5): Link against libc.so libpthread.so in that order.
7028
7029 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
7030
7031         * forward.c (test_loaded): Prevent recursive calls.
7032
7033         * Makefile (routines): Add libc-cancellation.
7034         * libc-cancellation.c: New file.
7035         * descr.h (struct pthread): Add multiple_threads field.
7036         * allocatestack.c (allocate_stack): Initialize multiple_header field of
7037         new thread descriptor to 1.
7038         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
7039         Initialize multiple_thread field after successful thread creation.
7040         * cancellation.c (__do_cancel): Move to pthreadP.h.
7041         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
7042         (__pthread_disable_asynccancel): Add internal_function attribute.
7043         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
7044         * pthread_setcancelstate.c: Likewise.
7045         * pthread_setcanceltype.c: Likewise.
7046         * pthread_exit.c: Likewise.
7047         * pthreadP.h (CANCELLATION_P): Likewise.
7048         (__do_cancel): Define as static inline.
7049         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
7050         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
7051         declarations.
7052         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
7053         fields.  Define MULTIPLE_THREADS_OFFSET.
7054         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
7055         declaration.
7056         * sysdeps/unix/sysv/linux/accept.S: New file.
7057         * sysdeps/unix/sysv/linux/read.c: New file.
7058         * sysdeps/unix/sysv/linux/write.c: New file.
7059         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
7060         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
7061         initialization of __libc_locking_needed.
7062         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
7063         __libc_locking_needed, use multiple_threads field in TCB.
7064         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7065
7066 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7067
7068         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
7069         version.
7070         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
7071
7072         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
7073         access to __libc_locking_needed for PIC.
7074
7075 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
7076
7077         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
7078         declare for libc.so.
7079         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
7080         expression.
7081         (__libc_lock_lock): Put into statement expression.
7082         (__libc_lock_unlock): Remove trailing semicolon.
7083         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
7084
7085 2002-12-12  Roland McGrath  <roland@redhat.com>
7086
7087         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
7088         "m" constraint to refer to __libc_locking_needed.  Declare it here.
7089
7090 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7091
7092         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
7093         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
7094         Initialize __libc_locking_needed.
7095         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
7096         instead of __register_pthread_fork_handler.
7097         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
7098         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
7099         fork-gen with libc_pthread_init.
7100         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
7101         of __register_pthread_fork_handler.
7102         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
7103         of __register_pthread_fork_handler.
7104         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
7105         __libc_locking_needed to determine whether lock prefix can be avoided.
7106         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7107
7108 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
7109
7110         * Makefile (tests): Add tst-cleanup1.
7111         * tst-cleanup1.c: New file.
7112         * cancellation.c (__cleanup_thread): Removed.
7113         (__do_cancel): Remove call to __cleanup_thread.
7114         * pthreadP.h: Remove __cleanup_thread prorotype.
7115
7116         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
7117         Remember function and argument even if cancellation handler
7118         function is not available.
7119         (__libc_cleanup_region_end): Execute registered function directly if
7120         pthread functions are not available.
7121         (__libc_cleanup_end): Likewise.
7122
7123         * init.c (__pthread_initialize_minimal): Fix initialization in
7124         static lib by preventing gcc from being too clever.
7125
7126 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
7127
7128         * init.c (__pthread_initialize_minimal): Remove unneccesary
7129         sigaddset call.
7130
7131         * Makefile (tests): We can run tst-locale2 now.
7132
7133 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
7134
7135         * Versions: Remove duplicated sigwait entry.
7136
7137 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
7138
7139         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
7140         inside libpthread.
7141
7142         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
7143
7144         * pthreadP.h: Declare __pthread_enable_asynccancel and
7145         __pthread_disable_asynccancel.
7146         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
7147         (CANCEL_RESET): Use __pthread_disable_asynccancel.
7148         * cancellation.c (__pthread_enable_asynccancel): New function.
7149         (__pthread_disable_asynccancel): New function.
7150         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
7151         * pt-close.c: Likewise.
7152         * pt-connect.c: Likewise.
7153         * pt-creat.c: Likewise.
7154         * pt-fcntl.c: Likewise.
7155         * pt-fsync.c: Likewise.
7156         * pt-lseek.c: Likewise.
7157         * pt-lseek64.c: Likewise.
7158         * pt-msgrcv.c: Likewise.
7159         * pt-msgsnd.c: Likewise.
7160         * pt-msync.c: Likewise.
7161         * pt-nanosleep.c: Likewise.
7162         * pt-open.c: Likewise.
7163         * pt-open64.c: Likewise.
7164         * pt-pause.c: Likewise.
7165         * pt-poll.c: Likewise.
7166         * pt-pread.c: Likewise.
7167         * pt-pread64.c: Likewise.
7168         * pt-pselect.c: Likewise.
7169         * pt-pwrite.c: Likewise.
7170         * pt-pwrite64.c: Likewise.
7171         * pt-read.c: Likewise.
7172         * pt-readv.c: Likewise.
7173         * pt-recv.c: Likewise.
7174         * pt-recvfrom.c: Likewise.
7175         * pt-recvmsg.c: Likewise.
7176         * pt-select.c: Likewise.
7177         * pt-send.c: Likewise.
7178         * pt-sendmsg.c: Likewise.
7179         * pt-sendto.c: Likewise.
7180         * pt-sigpause.c: Likewise.
7181         * pt-sigsuspend.c: Likewise.
7182         * pt-sigtimedwait.c: Likewise.
7183         * pt-sigwait.c: Likewise.
7184         * pt-sigwaitinfo.c: Likewise.
7185         * pt-system.c: Likewise.
7186         * pt-tcdrain.c: Likewise.
7187         * pt-wait.c: Likewise.
7188         * pt-waitid.c: Likewise.
7189         * pt-waitpid.c: Likewise.
7190         * pt-write.c: Likewise.
7191         * pt-writev.c: Likewise.
7192         * pthread_join.c: Likewise.
7193         * pthread_timedjoin.c: Likewise.
7194
7195         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
7196         (__xpg_sigpause): New function.
7197         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
7198
7199 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
7200
7201         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
7202
7203         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
7204         _GI_pthread_cleanup_pop to pthreadP.h.
7205
7206         * ftrylockfile.c: Use _IO_lock_trylock instead of
7207         pthread_mutex_trylock.
7208
7209         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
7210         (CANCEL_RESET): Likewise.
7211         (__pthread_setcanceltype_): Declare.
7212         (__pthread_mutex_lock_internal): Declare.
7213         (__pthread_mutex_unlock_internal): Declare.
7214         (__pthread_once_internal): Declare.
7215         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
7216         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
7217
7218         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
7219         and pthread_mutex_unlock.
7220         * pthread_cond_wait.c: Likewise.
7221         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
7222         * pthread_mutex_unlock.c: Likewise.
7223
7224         * pthread_setcanceltype.c: Add additional alias
7225         __pthread_setcanceltype.
7226
7227         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
7228         * sem_open.c (sem_open): Likewise.
7229         Use __libc_open, __libc_write, and __libc_close instead of
7230         open, write, and close respectively.
7231
7232         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
7233         Rewrite as statement expression since it must return a value.
7234
7235         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
7236         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
7237         __pthread_kill.
7238
7239         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
7240         alias __pthread_once_internal.
7241
7242         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
7243
7244 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
7245
7246         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
7247         * tst-stdio1.c: New file.
7248         * tst-stdio2.c: New file.
7249
7250         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
7251
7252         * Makefile (tests): Comment out tst-locale2 for now.
7253         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
7254
7255         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
7256         -D_IO_MTSAFE_IO.
7257         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
7258         Use _IO_lock_init instead of explicit assignment.
7259
7260         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
7261         Define __libc_lock_* and __libc_lock_recursive macros with
7262         lowlevellock macros, not pthread mutexes.
7263
7264         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
7265         of pthread_mutex_lock.
7266         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
7267         instead of pthread_mutex_unlock.
7268
7269 2002-12-06  Roland McGrath  <roland@redhat.com>
7270
7271         * allocatestack.c (__stack_user): Use uninitialized defn.
7272         * init.c (__pthread_initialize_minimal): Initialize it here.
7273
7274 2002-12-05  Roland McGrath  <roland@redhat.com>
7275
7276         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
7277         string.
7278         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
7279
7280         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
7281         missing & here too.
7282
7283 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
7284
7285         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7286         lowlevellock.
7287         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
7288         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
7289         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
7290         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
7291         for __libc_lock_* macros.
7292         * Makefile (routines): Add libc-lowlevellock.
7293
7294 2002-10-09  Roland McGrath  <roland@redhat.com>
7295
7296         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
7297         Under [__PIC__], call the function via the pointer fetched for
7298         comparison rather than a call by name that uses the PLT.
7299         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
7300         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
7301         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
7302         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
7303         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
7304
7305 2002-12-04  Roland McGrath  <roland@redhat.com>
7306
7307         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
7308
7309         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
7310         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
7311
7312         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
7313
7314 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7315
7316         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
7317         a completely opaque, non-integer type.
7318         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7319
7320 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
7321
7322         * sysdeps/i386/tls.h: Include stdlib.h.
7323         * sysdeps/x86_64/tls.h: Likewise.
7324
7325 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7326
7327         * Makefile (tests): Add tst-locale2.
7328         (tests-static): Likewise.
7329         * tst-locale2.c: New file.
7330
7331         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
7332         volatile and add memory clobbers to lock operations.
7333
7334 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
7335
7336         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
7337         * sysdeps/i386/i486/bits/atomic.h: New file.
7338         * sysdeps/i386/i586/bits/atomic.h: New file.
7339         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
7340         include i486 version.
7341         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
7342         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
7343         Patch by Marijn Ros <marijn@mad.scientist.com>.
7344
7345         * allocatestack.c (get_cached_stack): Don't crash if we first
7346         found a stack with a larger size then needed.
7347         Reported by Hui Huang <hui.huang@sun.com>.
7348
7349         * Makefile (tests): Add tst-sysconf.
7350         * tst-sysconf.c: New file.
7351
7352         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
7353         PTHREAD_THREADS_MAX.
7354
7355 2002-12-02  Roland McGrath  <roland@redhat.com>
7356
7357         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
7358         Declare using hidden_proto instead of attribute_hidden, so there are
7359         non-.hidden static symbols for gdb to find.
7360         (__pthread_keys): Likewise.
7361         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
7362         * allocatestack.c (__stack_user): Likewise.
7363         * pthread_create.c (__pthread_keys): Likewise.
7364         (__nptl_threads_events, __nptl_last_event): Make these static instead
7365         of hidden.
7366         * pthread_key_create.c (__pthread_pthread_keys_max,
7367         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
7368
7369 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
7370
7371         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
7372         statically.
7373         * tst-locale1.c: New file.
7374
7375         * pthread_cond_timedwait.c: Include <stdlib.h>.
7376
7377         * Makefile (tests): Add tst-fork2 and tst-fork3.
7378         * tst-fork2.c: New file.
7379         * tst-fork3.c: New file.
7380
7381 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
7382
7383         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
7384
7385         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
7386         require it to 200112L.
7387
7388         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
7389         instruction only if HAVE_CMOV is defined.
7390         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
7391
7392         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
7393
7394         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
7395
7396         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
7397
7398         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
7399
7400 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
7401
7402         * sysdeps/x86_64/bits/atomic.h: New file.
7403
7404         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
7405         16-bit operations.
7406
7407         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
7408         possible since gettid cannot fail.
7409
7410         * sysdeps/x86_64/pthreaddef.h: New file.
7411
7412         * sysdeps/i386/pthreaddef.h (gettid): Removed.
7413
7414         * sysdeps/x86_64/pthread_spin_init.c: New file.
7415         * sysdeps/x86_64/pthread_spin_lock.c: New file.
7416         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
7417         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
7418
7419         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
7420         Add missing lock prefix.  Minute optimization.
7421
7422         * tst-spin2.c (main): Also check successful trylock call.
7423
7424         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
7425         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
7426
7427         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
7428         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
7429
7430         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
7431         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
7432         value in case of an error.  Add support for INTERNAL_SYSCALL.
7433
7434         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
7435         value in case of an error.
7436
7437         * sysdeps/x86_64/tls.h: New file.
7438
7439 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7440
7441         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
7442         takes the array member name and the index as parameters.
7443         (THREAD_SETMEM_NC): Likewise.
7444         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
7445         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
7446         interfaces.
7447
7448         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
7449         to decide which code to use.
7450         (THREAD_SETMEM_NC): Likewise.
7451
7452         * allocatestack.c (queue_stack): Don't remove stack from list here.
7453         Do it in the caller.  Correct condition to prematurely terminate
7454         loop to free stacks.
7455         (__deallocate_stack): Remove stack from list here.
7456
7457 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7458
7459         * Makefile (tests): Add tst-stack1.
7460         * tst-stack1.c: New file.
7461
7462         * allocatestack.c (allocate_stack): Initialize the TCB on a user
7463         provided stack.
7464
7465         * pthread_attr_getstack.c: Return bottom of the thread area.
7466
7467 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
7468
7469         * Makefile (libpthread-routines): Add pt-allocrtsig and
7470         pthread_kill_other_threads.
7471         * pt-allocrtsig.c: New file.
7472         * pthread_kill_other_threads.c: New file.
7473         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
7474         all three functions.
7475         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7476         allocrtsig.
7477         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
7478         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
7479         and __libc_allocate_rtsig_private.
7480         * Versions (libpthread): Export pthread_kill_other_threads_np,
7481         __libc_current_sigrtmin, and __libc_current_sigrtmax.
7482
7483 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
7484
7485         * allocatestack.c (allocate_stack): stackaddr in attribute points to
7486         the end of the stack.  Adjust computations.
7487         When mprotect call fails dequeue stack and free it.
7488         * pthread_attr_setstack.c: Store top of the stack in stackaddr
7489         attribute.
7490         * pthread_getattr_np.c: Likewise.
7491
7492         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
7493         surprises.
7494
7495 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
7496
7497         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
7498         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7499
7500 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
7501
7502         * pthread_getspecific.c: Optimize access to first 2nd-level array.
7503         * pthread_setspecific.c: Likewise.
7504
7505 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
7506
7507         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
7508         definitions.  Get them from the official place.
7509         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
7510
7511         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
7512         Use new CLONE_ flags in clone() calls.
7513
7514         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
7515         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
7516
7517         * Versions: Add pthread_* functions for libc.
7518         * forward.c: New file.
7519
7520         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
7521         errno-loc.
7522         * herrno.c: New file.
7523         * res.c: New file.
7524
7525         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
7526         sem_trywait, and sem_timedwait.  Add herrno and res.
7527         * sem_init.c: Don't initialize lock and waiters members.
7528         * sem_open.c: Likewise.
7529         * sem_post.c: Removed.
7530         * sem_wait.c: Removed.
7531         * sem_trywait.c: Removed.
7532         * sem_timedwait.c: Removed.
7533         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
7534         Includes full implementations of sem_post, sem_wait, sem_trywait,
7535         and sem_timedwait.
7536         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
7537         for new implementation.
7538         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
7539         and waiters fields.
7540
7541         * tst-sem3.c: Improve error message.
7542         * tst-signal3.c: Likewise.
7543
7544         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
7545         to tell the kernel about the termination futex and to initialize tid
7546         member.  Don't initialize main_thread.
7547         * descr.h (struct pthread): Remove main_thread member.
7548         * cancelllation.c (__do_cancel): Remove code handling main thread.
7549         The main thread is not special anymore.
7550
7551         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
7552         size of the stacks to stack_cache_actsize.
7553
7554         * pt-readv.c: Add missing "defined".
7555         * pt-sigwait.c: Likewise.
7556         * pt-writev.c: Likewise.
7557
7558 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
7559
7560         * Versions: Export __connect from libpthread.
7561         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7562
7563         * Makefile (libpthread-routines): Add pt-raise.
7564         * sysdeps/unix/sysv/linux/raise.c: New file.
7565         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
7566         * sysdeps/generic/pt-raise.c: New file.
7567
7568         * pthread_cond_init.c: Initialize all data elements of the condvar
7569         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7570
7571         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
7572         * pthread_create.c: Likewise.
7573
7574         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
7575         * tst-key1.c: New file.
7576         * tst-key2.c: New file.
7577         * tst-key3.c: New file.
7578
7579         * Versions: Export pthread_detach for version GLIBC_2.0.
7580         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
7581
7582 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
7583
7584         * pthread_key_create.c: Terminate search after an unused key was found.
7585         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7586
7587         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
7588         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7589
7590 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
7591
7592         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
7593         dynamic lookup for errno in PIC.
7594
7595         * allocatestack.c (get_cached_stack): Rearrange code slightly to
7596         release the stack lock as soon as possible.
7597         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
7598         the static TLS block.
7599         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
7600
7601         * cancellation.c: Renamed from cancelation.c.
7602         * Makefile: Adjust accordingly.
7603         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
7604         * cleanup_defer.c: Use CANCELLATION_P.
7605         * pthread_testcancel.c: Likewise.
7606         * descr.h: Fix spelling in comments.
7607         * init.c: Likewise.
7608         * pthread_getattr_np.c: Likewise.
7609         * pthread_getschedparam.c: Likewise.
7610         * pthread_setschedparam.c: Likewise.
7611         * Versions: Likewise.
7612
7613         * pt-pselect.c: New file.
7614         * Makefile (libpthread-routines): Add pt-pselect.
7615         * Versions: Add pselect.
7616
7617         * tst-cancel4.c: New file.
7618         * Makefile (tests): Add tst-cancel4.
7619
7620 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
7621
7622         * pthread_mutex_lock.c: Always record lock ownership.
7623         * pthread_mutex_timedlock.c: Likewise.
7624         * pthread_mutex_trylock.c: Likewise.
7625
7626         * pt-readv.c: New file.
7627         * pt-writev.c: New file.
7628         * pt-creat.c: New file.
7629         * pt-msgrcv.c: New file.
7630         * pt-msgsnd.c: New file.
7631         * pt-poll.c: New file.
7632         * pt-select.c: New file.
7633         * pt-sigpause.c: New file.
7634         * pt-sigsuspend.c: New file.
7635         * pt-sigwait.c: New file.
7636         * pt-sigwaitinfo.c: New file.
7637         * pt-waitid.c: New file.
7638         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
7639         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
7640         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
7641         * Versions: Add all the new functions.
7642
7643         * tst-exit1.c: New file.
7644         * Makefile (tests): Add tst-exit1.
7645
7646         * sem_timedwait.c: Minor optimization for more optimal fastpath.
7647
7648 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
7649
7650         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
7651
7652         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
7653         call.  pthread_join is an official cancellation point.
7654         * pthread_timedjoin.c: Likewise.
7655
7656         * pthread_cond_wait.c: Revert order in which internal lock are dropped
7657         and the condvar's mutex are retrieved.
7658         * pthread_cond_timedwait.c: Likewise.
7659         Reported by dice@saros.East.Sun.COM.
7660
7661 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
7662
7663         * pthreadP.h: Cut out all type definitions and move them...
7664         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
7665         * pthreadP.h: Include <internaltypes.h>.
7666
7667         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
7668         performance tweaks.
7669
7670         * sem_trywait.c: Shuffle #includes around to get right order.
7671         * sem_timedwait.c: Likewise.
7672         * sem_post.c: Likewise.
7673         * sem_wait.c: Likewise.
7674
7675         * nptl 0.3 released.
7676
7677         * Makefile (tests): Add tst-signal3.
7678         * tst-signal3.c: New file.
7679
7680 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
7681
7682         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
7683         the asms modify the sem object.
7684         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
7685
7686         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
7687         the actual members.
7688         * pthreadP.h (struct sem): New type.  Actual semaphore type.
7689         * semaphoreP.h: Include pthreadP.h.
7690         * sem_getvalue.c: Adjust to sem_t change.
7691         * sem_init.c: Likewise.
7692         * sem_open.c: Likewise.
7693         * sem_post.c: Likewise.
7694         * sem_timedwait.c: Likewise.
7695         * sem_trywait.c: Likewise.
7696         * sem_wait.c: Likewise.
7697
7698 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
7699
7700         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
7701         * tst-basic2.c: New file.
7702         * tst-exec1.c: New file.
7703         * tst-exec2.c: New file.
7704         * tst-exec3.c: New file.
7705
7706         * tst-fork1.c: Remove extra */.
7707
7708         * nptl 0.2 released.  The API for IA-32 is complete.