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