Consistently added return to pthread_exit
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2012-01-10  Ulrich Drepper  <drepper@gmail.com>
2
3         * pthreadP.h: Add noreturn to __pthread_exit.
4         * sysdeps/pthread/pthread-functions.h: Likewise for ptr___pthread_exit.
5
6 2011-12-30  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
7
8         * sysdeps/unix/sysv/linux/aio_misc.h (__aio_create_helper_thread):
9         Call pthread_attr_setstacksize() with result of
10         __pthread_get_minstack() to account for application TLS usage.
11
12 2012-01-08  Marek Polacek  <polacek@redhat.com>
13
14         * sysdeps/unix/sysv/linux/mq_notify.c: Include <nptl/pthreadP.h>.
15
16 2012-01-07  Ulrich Drepper  <drepper@gmail.com>
17
18         [BZ #13553]
19         * pthreadP.h: Use const instead of __const.
20         * semaphore.h: Likewise.
21         * sysdeps/pthread/bits/libc-lock.h: Likewise.
22         * sysdeps/pthread/bits/sigthread.h: Likewise.
23         * sysdeps/pthread/pthread.h: Likewise.
24
25         * Makefile: Remove elf=yes test, only ELF is supported.
26
27         * shlib-versions: Remove entries for ports architectures.
28
29         In case anyone cares, the IA-64 architecture could move to ports.
30         * sysdeps/ia64/*: Removed.
31         * sysdeps/unix/sysv/linux/ia64/*: Removed.
32
33 2011-12-22  Ulrich Drepper  <drepper@gmail.com>
34
35         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread): Use
36         __pthread_get_minstack.
37         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Likewise.
38
39         [BZ #13088]
40         * sysdeps/unix/sysv/linux/timer_routines.c: Get minimum stack size
41         through __pthread_get_minstack.
42         * nptl-init.c (__pthread_initialize_minimal_internal): Get page size
43         directly from _rtld_global_ro.
44         (__pthread_get_minstack): New function.
45         * pthreadP.h: Declare __pthread_get_minstack.
46         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_get_minstack.
47
48 2011-12-21  Ulrich Drepper  <drepper@gmail.com>
49
50         [BZ #13515]
51         * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
52         Correct reading name from file.
53
54 2011-12-14  Carlos O'Donell  <carlos@systemhalted.org>
55
56         * allocatestack.c (allocate_stack): Return errno on failure.
57
58 2011-12-14  Jeff Law  <law@redhat.com>
59
60         [BZ #5245]
61         * pthread_create.c (__pthread_create_2_1): Translate ENOMEM to EAGAIN.
62
63 2011-11-28  Andreas Schwab  <schwab@redhat.com>
64
65         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Handle
66         EAGAIN from FUTEX_WAIT_REQUEUE_PI.
67         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
68
69 2011-11-15  Ulrich Drepper  <drepper@gmail.com>
70
71         * pthread_getattr_np.c (pthread_getattr_np): Set FD_CLOEXEC for
72         /proc/self/maps.
73
74 2011-10-29  Ulrich Drepper  <drepper@gmail.com>
75
76         [BZ #13358]
77         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
78         (__pthread_cond_timedwait): Initialize %r15 correctly also for code
79         path for kernels with FUTEX_CLOCK_REALTIME.
80         Debugged by H.J. Lu <hjl.tools@gmail.com>.
81
82 2011-10-27  Andreas Schwab  <schwab@redhat.com>
83
84         [BZ #13344]
85         * sysdeps/pthread/pthread.h: Use __THREADNL instead of __THREAD
86         for memory synchronization functions.
87         * semaphore.h: Likewise.
88
89 2011-10-24  Ulrich Drepper  <drepper@gmail.com>
90
91         * tst-cancel7.c: Avoid warning.
92         * tst-mutex6.c: Likewise.
93         * tst-mutex9.c: Likewise.
94         * tst-mutexpi6.c: Likewise.
95
96 2011-10-23  Ulrich Drepper  <drepper@gmail.com>
97
98         * sysdeps/i386/tls.h: Remove #include <list.h>.
99
100 2011-10-15  Ulrich Drepper  <drepper@gmail.com>
101
102         * pthread_create.c (start_thread): Call __ctype_init.
103
104 2011-09-15  Andreas Schwab  <schwab@redhat.com>
105
106         * sysdeps/pthread/list.h: Define only list_t if __need_list_t is
107         defined.
108         (list_add): Add atomic_write_barrier.
109         * descr.h: Define __need_list_t before including <list.h>.
110         * nptl-init.c: Include <list.h>
111         * allocatestack.c: Likewise.
112
113 2011-09-11  Ulrich Drepper  <drepper@gmail.com>
114
115         * sysdeps/i386/tls.h: Remove HAVE_TLS_SUPPORT test.
116         * sysdeps/ia64/tls.h: Likewise.
117         * sysdeps/powerpc/tls.h: Likewise.
118         * sysdeps/s390/tls.h: Likewise.
119         * sysdeps/sh/tls.h: Likewise.
120         * sysdeps/sparc/tls.h: Likewise.
121         * sysdeps/x86_64/tls.h: Likewise.
122
123 2011-09-10  Ulrich Drepper  <drepper@gmail.com>
124
125         * sysdeps/pthread/malloc-machine.h: Define MUTEX_INITIALIZER.
126
127         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Don't handle
128         !USE___THREAD.
129         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
130         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
131         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
132         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
133         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
134         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
135         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
136         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
137         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
138         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
139         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
140         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
141
142         * tst-tls1.c: Support for __thread is now mandatory.
143         * tst-tls2.c: Likewise.
144         * tst-tls3.c: Likewise.
145         * tst-tls3mod.c: Likewise.
146         * tst-tls4.c: Likewise.
147         * tst-tls4moda.c: Likewise.
148         * tst-tls4modb.c: Likewise.
149         * tst-tls5.h: Likewise.
150
151 2011-09-08  Ulrich Drepper  <drepper@gmail.com>
152
153         [BZ #12403]
154         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
155         (pthread_rwlock_timedwrlock): Use correct macro in test.
156         Patch by H.J. Lu <hongjiu.lu@intel.com>.
157
158 2011-09-06  Ulrich Drepper  <drepper@gmail.com>
159
160         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait): Don't
161         use gettimeofday vsyscall, just call gettimeofday.
162         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
163         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
164         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
165         Likewise.
166         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
167         Likewise.
168         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
169         Simplify __vdso_clock_gettime use.
170
171 2011-09-05  David S. Miller  <davem@davemloft.net>
172
173         * sysdeps/unix/sysv/linux/sem_timedwait.c (do_futex_timed_wait):
174         New function.
175         (sem_timedwait): Call it to force an exception region around
176         the async cancel enable and the futex operation.
177         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: Likewise.
178         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: Likewise.
179         * sysdeps/unix/sysv/linux/sem_wait.c (do_futex_wait): New function.
180         (__new_sem_wait): Call it to force an exception region around
181         the async cancel enable and the futex operation.
182         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: Likewise.
183         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: Likewise.
184
185 2011-08-31  Andreas Schwab  <schwab@redhat.com>
186
187         * allocatestack.c (setxid_mark_thread): Ensure that the exiting
188         thread is woken up.
189
190 2011-08-20  David S. Miller  <davem@davemloft.net>
191
192         * Makefile (tst-cleanup0.out): Fix typo in output redirection.
193
194 2011-08-14  Roland McGrath  <roland@hack.frob.com>
195
196         * sysdeps/i386/pthreaddef.h (TCB_ALIGNMENT): Set to 64, optimal on Atom.
197         * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Likewise.
198
199 2011-08-08  Andreas Schwab  <schwab@redhat.com>
200
201         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Maintain aligned
202         stack.
203         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
204         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
205
206 2011-07-22  Ulrich Drepper  <drepper@gmail.com>
207
208         * sysdeps/pthread/unwind-forcedunwind.c (_Unwind_Resume): Add read
209         barrier.
210         (__gcc_personality_v0): Likewise.
211         (_Unwind_ForcedUnwind): Likewise.
212         (_Unwind_GetCFA): Likewise.
213
214 2011-07-14  Roland McGrath  <roland@hack.frob.com>
215
216         * allocatestack.c (__reclaim_stacks): Use uintptr_t cast rather than
217         UINTMAX_C.
218
219 2011-06-30  Ulrich Drepper  <drepper@gmail.com>
220
221         * nptl-init.c (__nptl_set_robust): New function.
222         (pthread_functions): Add reference.
223         * npthreadP.h: Declare __nptl_set_robust.
224         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
225         ptr_set_robust member.
226         * sysdeps/unix/sysv/linux/fork.c: Call set_robust_list syscall in
227         child if threads are used.
228
229 2011-06-14  Andreas Jaeger  <aj@suse.de>
230
231         * pthread_rwlock_init.c: Include <string.h> for memset declaration.
232
233 2011-05-11  Ulrich Drepper  <drepper@gmail.com>
234
235         [BZ #386]
236         * allocatestack.c (allocate_stack): Convert ENOMEM error to EAGAIN.
237
238 2011-04-10  Ulrich Drepper  <drepper@gmail.com>
239
240         [BZ #12650]
241         * allocatestack.c (get_cached_stack): Deallocate DTV entries before
242         clearing memory.
243         Patch partly by Robert Rex <robert.rex@exasol.com>.
244
245 2011-01-19  Roland McGrath  <roland@redhat.com>
246
247         * pthread_cond_wait.c (__pthread_cond_wait): Fix comment typo.
248         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
249         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Likewise.
250         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
251         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Likewise.
252         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Likewise.
253
254 2011-01-16  Andreas Schwab  <schwab@linux-m68k.org>
255
256         * Makefile (test-extras): Add tst-cleanup4aux.
257
258 2011-01-14  Ulrich Drepper  <drepper@gmail.com>
259
260         [BZ #10563]
261         * sysdeps/pthread/setxid.h (__SETXID_1): Add cast to assignment.
262         (__SETXID_2): Likewise.
263         (__SETXID_3): Likewise.
264
265 2011-01-13  Ulrich Drepper  <drepper@gmail.com>
266
267         [BZ #10484]
268         * Versions [libc] (GLIBC_PRIVATE): Export __libc_alloca_cutoff.
269         * alloca_cutoff.c: Add libc_hidden_def.
270
271 2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
272
273         [BZ #12113]
274         * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
275         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
276         of "struct pthread".
277
278 2010-09-21  Andreas Schwab  <schwab@redhat.com>
279
280         * sysdeps/pthread/pthread.h (pthread_cleanup_push)
281         [!__EXCEPTIONS]: Mangle local variable not_first_call.
282         (pthread_cleanup_push_defer_np): Likewise.
283
284 2010-09-03  Ulrich Drepper  <drepper@redhat.com>
285
286         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Expect blocks are
287         small.
288
289 2010-08-10  Dinakar Guniguntala  <dino@in.ibm.com>
290             Stefan Hajnoczi  <stefanha@linux.vnet.ibm.com>
291
292         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: If
293         FUTEX_WAKE_OP fails make sure to call FUTEX_WAKE instead.
294
295 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
296
297         * sysdeps/unix/sysv/linux/i386/Makefile: New file.
298
299 2010-05-01  Alan Modra  <amodra@gmail.com>
300
301         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
302         (PSEUDO): Use correct cr save.  Don't use wrong parm save area
303         to save temps.  Correct cfi for possible later frame manipulation.
304         (DOCARGS_1, UNDOCARGS_1): Use the correct parm save area.
305         (DOCARGS_2, UNDOCARGS_2, DOCARGS_3, UNDOCARGS_3): Likewise.
306         (DOCARGS_4, UNDOCARGS_4, DOCARGS_5, UNDOCARGS_5): Likewise.
307         (DOCARGS_6, UNDOCARGS_6): Likewise.
308         (CENABLE, CDISABLE): Add nops for non-shared calls.
309
310 2010-07-06  Andreas Schwab  <schwab@redhat.com>
311
312         * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
313         Fix type mismatch.
314
315 2010-07-03  Ulrich Drepper  <drepper@redhat.com>
316
317         * tst-abstime.c (do_test): Some more cleanups
318
319 2010-07-02  Ulrich Drepper  <drepper@redhat.com>
320
321         * tst-abstime.c: Correct testing and add test for sem_timedwait.
322
323 2010-07-01  Andreas Schwab  <schwab@redhat.com>
324             Ulrich Drepper  <drepper@redhat.com>
325
326         * Makefile (tests): Add tst-abstime.
327         * tst-abstime.c: New file.
328         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
329         (__lll_timedlock_wait): Check for timestamp before the Epoch.
330         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
331         (__lll_timedlock_wait): Likewise.
332         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
333         (__lll_robust_timedlock_wait): Likewise.
334         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
335         (__pthread_cond_timedwait): Likewise.
336         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
337         (pthread_rwlock_timedrdlock): Likewise.
338         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
339         (pthread_rwlock_timedwrlock): Likewise.
340         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
341         Likewise.
342
343 2010-07-01  Ulrich Drepper  <drepper@redhat.com>
344
345         * Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
346
347 2010-06-01  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>
348
349         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
350         location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
351
352 2010-04-09  Ulrich Drepper  <drepper@redhat.com>
353
354         [BZ #11390]
355         * sysdeps/unix/sysv/linux/pthread_getname.c: New file.
356         * sysdeps/unix/sysv/linux/pthread_setname.c: New file.
357         * nptl/sysdeps/pthread/pthread.h: Declare pthread_getname and
358         pthread_setname.
359         * Makefile (libpthread-routines): Add pthread_getname and
360         pthread_setname.
361         * Versions: Export pthread_getname and pthread_setname for GLIBC_2.12.
362
363 2010-04-05  Thomas Schwinge  <thomas@schwinge.name>
364
365         * sysdeps/pthread/unwind-resume.c: Moved to main tree sysdeps/gnu/.
366         * sysdeps/pthread/rt-unwind-resume.c: Likewise.
367         * sysdeps/pthread/Makefile: Remove csu section and rt section's
368         unwind-resume bits, now in main tree sysdeps/gnu/Makefile instead.
369
370 2010-03-23  Luis Machado  <luisgpm@br.ibm.com>
371
372         * pthread_cond_timedwait.c: Add check for
373         HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
374         (pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
375         INTERNAL_SYSCALL.
376
377 2010-03-09  Ulrich Drepper  <drepper@redhat.com>
378
379         * pthread_create.c (__pthread_create_2_1): If priorities are incorrect
380         and the call fails wake eventually waiting setxid threads.  Don't free
381         stack here if we try starting a thread.
382         * sysdeps/pthread/createthread.c (do_clone): Only wake setxid waiter
383         if the clone call failed.
384
385 2010-03-08  Andreas Schwab  <schwab@redhat.com>
386
387         * pthread_create.c (__pthread_create_2_1): Don't set setxid_futex.
388         * allocatestack.c (get_cached_stack): Set setxid_futex.
389         (allocate_stack): Likewise.
390
391 2010-03-05  Andreas Schwab  <schwab@redhat.com>
392             Ulrich Drepper  <drepper@redhat.com>
393
394         * allocatestack.c (setxid_mark_thread): Delay handling of thread if
395         it is creating a thread or it is just being created.
396         * pthread_create.c (start_thread): Wake setxid thread if it is
397         waiting.
398         (__pthread_create_2_1): Initialize setxid_futex.
399         * sysdeps/pthread/createthread.c (do_clone): Wake setxid thread if it
400         is waiting.
401
402 2010-01-15  Ulrich Drepper  <drepper@redhat.com>
403
404         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
405         Fix unwind info.
406         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
407
408 2010-01-15  Michal Schmidt  <mschmidt@redhat.com>
409
410         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
411         Fix pthread_cond_timedwait with requeue-PI.
412         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
413         Fix pthread_cond_wait with requeue-PI.
414
415 2010-01-14  Ulrich Drepper  <drepper@redhat.com>
416
417         * Versions: Add pthread_mutex_consistent, pthread_mutexattr_getrobust,
418         and pthread_mutexattr_setrobust for GLIBC_2.12.
419         * pthread_mutex_consistent.c: Define alias pthread_mutex_consistent.
420         * pthread_mutexattr_getrobust.c: Define alias
421         pthread_mutexattr_getrobust.
422         * pthread_mutexattr_setrobust.c: Define alias
423         pthread_mutexattr_setrobust.
424
425 2010-01-12  Ulrich Drepper  <drepper@redhat.com>
426
427         * sysdeps/pthread/pthread.h: Cleanup.  Fix up for XPG7.
428
429 2010-01-08  Ulrich Drepper  <drepper@redhat.com>
430
431         * sysdeps/pthread/pthread.h: Fix pthread_mutex_consistent declaration.
432
433 2009-12-18  Thomas Schwinge  <thomas@codesourcery.com>
434
435         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
436         call __gmon_start__.
437         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
438
439 2009-12-17  Ulrich Drepper  <drepper@redhat.com>
440
441         * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
442         using memset.
443
444 2009-12-01  Dinakar Guniguntala  <dino@in.ibm.com>
445
446         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
447         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
448         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex
449         is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI.
450         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
451         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex
452         is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
453         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
454
455 2009-12-12  Ulrich Drepper  <drepper@redhat.com>
456
457         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
458         Don't update nwaiters after invalid timeout is recognized.
459
460 2009-11-27  Thomas Schwinge  <thomas@codesourcery.com>
461
462         * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call
463         __gmon_start__.
464
465 2009-11-27  Andreas Schwab  <schwab@redhat.com>
466
467         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
468         THREAD_SELF->cancelhandling after returning from futex call.
469
470 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
471
472         * tst-sem13.c: New file.
473         * Makefile (tests): Add tst-sem13.
474
475 2009-11-22  Roland McGrath  <roland@redhat.com>
476
477         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
478         instead of recapitulating its contents.
479
480 2009-11-18  Ulrich Drepper  <drepper@redhat.com>
481
482         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
483         optimizations and cleanups.
484
485 2009-11-18  Dinakar Guniguntala  <dino@in.ibm.com>
486
487         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
488         Remove redundant code. Fix cfi offsets.
489         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
490         Fix cfi offsets.
491
492 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
493
494         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
495         reduce size of unwind info.
496
497         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
498         cfi directives.
499         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
500         Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
501
502 2009-11-03  Andreas Schwab  <schwab@linux-m68k.org>
503
504         [BZ #4457]
505         * sysdeps/pthread/unwind-resume.c: Include <libgcc_s.h> and use
506         LIBGCC_S_SO.
507         * sysdeps/pthread/unwind-forcedunwind.c: Likewise.
508
509 2009-10-30  Ulrich Drepper  <drepper@redhat.com>
510
511         * tst-sem11.c (main): Rewrite to avoid aliasing problems.
512
513         [BZ #3270]
514         * allocatestack.c (__nptl_setxid): Perform the operation in multiple
515         steps to avoid races with creation and terminations.
516         * nptl-init.c (sighandler_setxid): Adjust.
517         Patch by Daniel Jacobowitz.
518
519 2009-09-07  Andreas Schwab  <schwab@redhat.com>
520
521         * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.
522
523 2009-09-02  Suzuki K P  <suzuki@in.ibm.com>
524             Joseph Myers  <joseph@codesourcery.com>
525
526         [BZ #7094]
527         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
528         Initialize the sigev_notify field for newly created timer to make sure
529         the timer gets deleted from the active timer's list upon timer_delete.
530
531 2009-08-27  Andrew Stubbs  <ams@codesourcery.com>
532
533         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
534         Correct a logic error.
535
536 2009-08-25  Ulrich Drepper  <drepper@redhat.com>
537
538         * sysdeps/x86_64/tls.h (RTLD_ENABLE_FOREIGN_CALL): Store old value
539         of the field in local variables.
540         (RTLD_FINALIZE_FOREIGN_CALL): Restore rtld_must_xmm_save from local
541         variable and don't unconditionally clear it.
542
543 2009-08-24  Ulrich Drepper  <drepper@redhat.com>
544
545         * pthread_create.c (start_thread): Hint to the kernel that memory for
546         the stack can be reused.  We do not mark all the memory.  The part
547         still in use and some reserve are kept.
548
549 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
550
551         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
552
553 2009-08-11  Ulrich Drepper  <drepper@redhat.com>
554
555         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
556         directives.
557
558 2009-08-10  Ulrich Drepper  <drepper@redhat.com>
559
560         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
561         directives.
562         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
563
564 2009-08-10  Andreas Schwab  <schwab@redhat.com>
565
566         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
567         (__pthread_cond_signal): Don't clobber register used for syscall
568         number.
569
570 2009-08-08  Ulrich Drepper  <drepper@redhat.com>
571
572         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
573         Optimize code path used when FUTEX_CLOCK_REALTIME is supported.
574
575         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
576         (__pthread_cond_wait): Optimize by avoiding use of callee-safe
577         register.
578
579 2009-08-07  Ulrich Drepper  <drepper@redhat.com>
580
581         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Little optimizations
582         enabled by the special *_asynccancel functions.
583         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
584         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
585
586         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include lowlevellock.h.
587
588 2009-08-04  Ulrich Drepper  <drepper@redhat.com>
589
590         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: New file.
591         * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: New file.
592         * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: New file.
593         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Optimize
594         since we can assume the special __*_{en,dis}able_asynccancel
595         functions.
596         (PUSHARGS_*, POPARGS_*, SAVESTK_*, RESTSTK_*): Removed.
597         * sysdeps/x86_64/tcb-offsets.sym: Add cancellation-related bits
598         and PTHREAD_CANCELED.
599
600 2009-07-31  Ulrich Drepper  <drepper@redhat.com>
601
602         * descr.h: Better definition of *_BITMASK macros for cancellation.
603
604 2009-07-29  Ulrich Drepper  <drepper@redhat.com>
605
606         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Define explicitly to 32.
607
608         * sysdeps/x86_64/tls.h (tcbhead_t): Add room for SSE registers the
609         dynamic linker might have to save.
610         Define RTLD_CHECK_FOREIGN_CALL, RTLD_ENABLE_FOREIGN_CALL,
611         RTLD_PREPARE_FOREIGN_CALL, and RTLD_FINALIZE_FOREIGN_CALL.  Pretty
612         printing.
613
614         * sysdeps/x86_64/tcb-offsets.sym: Add RTLD_SAVESPACE_SSE.
615
616 2009-07-28  Ulrich Drepper  <drepper@redhat.com>
617
618         * pthread_mutex_lock.c [NO_INCR] (__pthread_mutex_cond_lock_adjust):
619         New function.
620         * pthreadP.h: Declare __pthread_mutex_cond_lock_adjust.
621         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add ROBUST_BIT.
622         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Don't use
623         requeue_pi for robust mutexes.
624         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
625         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
626         Don't only skip __pthread_mutex_cond_lock.  Call instead
627         __pthread_mutex_cond_lock_adjust.
628         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
629
630         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Minor
631         optimization of PI mutex handling.
632
633 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
634
635         [BZ #10418]
636         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
637         instead of of _acq variants of cmpxchg.
638
639 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
640
641         * sysdeps/x86_64/configure.in: New file.
642
643         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
644         path when not using absolute timeout futex.
645
646 2009-07-20  Ulrich Drepper  <drepper@redhat.com>
647
648         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
649         optimizations of last changes.
650         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
651
652 2009-07-19  Ulrich Drepper  <drepper@redhat.com>
653
654         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
655         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
656         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: If mutex
657         is a PI mutex, then use FUTEX_CMP_REQUEUE_PI.
658         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
659         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: If mutex
660         is a PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
661         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
662
663         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
664         (__pthread_cond_timedwait): Make more robust.
665
666 2009-07-18  Ulrich Drepper  <drepper@redhat.com>
667
668         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
669         (__lll_robust_timedlock_wait): If possible use FUTEX_WAIT_BITSET to
670         directly use absolute timeout.
671
672         * tst-sem5.c (do_test): Add test for premature timeout.
673         * Makefile: Linu tst-sem5 with librt.
674
675         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
676         (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
677         directly use absolute timeout.
678         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
679         (pthread_rwlock_timedrdlock): Likewise.
680
681         * tst-cond11.c (run_test): Add test to check that the timeout is
682         long enough.
683
684         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
685         (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to
686         directly use absolute timeout.
687
688         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
689         (__pthread_cond_wait): Convert to using exception handler instead of
690         registered unwind buffer.
691         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
692         (__pthread_cond_timedwait): Likewise.
693
694 2009-07-17  Ulrich Drepper  <drepper@redhat.com>
695
696         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
697         If possible use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME to directly
698         use absolute timeout.
699
700         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Optimize
701         handling of uncontested semaphore.
702
703         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
704         (__condvar_cleanup): Rewrite to use cfi directives instead of
705         hand-coded unwind tables.
706         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S (__pthread_once):
707         Likewise.
708         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
709         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
710         Likewise.
711
712 2009-06-12  Ulrich Drepper  <drepper@redhat.com>
713
714         * Makefile (libpthread-routines): Add pthread_sigqueue.
715         * Versions: Add pthread_sigqueue for GLIBC_2.11.
716         * sysdeps/pthread/bits/sigthread.h: Declare pthread_sigqueue.
717         * sysdeps/unix/sysv/linux/pthread_sigqueue.c: New file.
718
719 2009-06-11  Ulrich Drepper  <drepper@redhat.com>
720
721         [BZ #10262]
722         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
723         (LOAD_FUTEX_WAIT_ABS): Fix futex parameter in case private futexes
724         cannot be assumed.
725         Patch by Bryan Kadzban <bz-glibc@kdzbn.homelinux.net>.
726
727 2009-05-16  Ulrich Drepper  <drepper@redhat.com>
728
729         * libc-cancellation.c: Move __libc_cleanup_routine to...
730         * libc-cleanup.c: ...here.  New file.
731         * Makefile (routines): Add libc-cleanup.
732
733         * cancellation.c (__pthread_disable_asynccancel): Remove unnecessary
734         test.
735         * libc-cancellation.c: Use <nptl/cancellation.c: to define the code.
736         * sysdeps/pthread/librt-cancellation.c: Likewise.
737
738         [BZ #9924]
739         * nptl-init.c: Renamed from init.c.
740         * Makefile: Change all occurences of init.c to nptl-init.c.
741
742 2009-05-15  Ulrich Drepper  <drepper@redhat.com>
743
744         * cancellation.c (__pthread_disable_asynccancel): Correct the bits
745         to test when deciding on the delay.
746         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
747         * pthread_cancel.c: Close race between deciding on sending a signal
748         and setting the CANCELING_BIT bit.
749
750         * cancellation.c (__pthread_disable_asynccancel): Don't return if
751         thread is canceled.
752         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
753
754 2009-04-27  Ulrich Drepper  <drepper@redhat.com>
755
756         * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
757         is available.
758         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
759         * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
760         * sysdeps/i386/tls.h: Likewise.
761         (tcbhead_t): Add __private_tm member.
762
763 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
764
765         * sem_open.c (sem_open): Rewrite initialization of initsem to
766         avoid warnings.
767
768         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
769         Avoid warning by using may_alias attribute on ptrhack.
770
771 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
772
773         [BZ #10090]
774         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
775         Check policy and priority for validity.
776         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
777
778 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
779
780         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
781         (__pthread_cond_timedwait): Change to use cfi directives instead of
782         hand-coded unwind sections.
783
784 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
785
786         * init.c (nptl_freeres): Compile only for SHARED.
787
788 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
789
790         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
791         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
792         FUTEX_BITSET_MATCH_ANY.
793
794 2009-02-27  Roland McGrath  <roland@redhat.com>
795
796         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
797         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
798
799 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
800
801         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
802         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
803         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
804         200112L to 200809L.
805
806 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
807
808         * sysdeps/pthread/pthread.h: The robust mutex functions are in
809         POSIX 2008.
810
811 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
812
813         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
814         Unify name of include protector macro.
815
816 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
817
818         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
819         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
820
821 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
822
823         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
824         pointer variables.
825
826         * allocatestack.c (__free_stacks): Renamed from free_stacks.
827         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
828         * init.c (nptl_freeres): New function.
829         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
830         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
831         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
832         variable.
833         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
834         load DSO.  Assign last.
835         (__unwind_freeres): New function.
836
837         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
838         for better debugging.  No need to use stack_list_add here.
839
840 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
841
842         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
843         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
844         instead of computing relative timeout.
845         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
846         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
847
848 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
849
850         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
851
852 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
853
854         * sysdeps/pthread/list.h (list_add): Initialize new element first.
855         (list_add_tail): Removed.
856
857 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
858
859         * (in_flight_stack): New variable.
860         (stack_list_del): New function.  Use instead of list_del.
861         (stack_list_add): New function.  Use instead of list_add when adding to
862         stack_cache and stack_used lists.
863         (__reclaim_stacks): Complete operations on stack_cache and stack_used lists
864         when the fork call interrupted another thread.
865
866 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
867
868         * init.c (__pthread_initialize_minimal_internal): Optimize test
869         FUTEX_CLOCK_REALTIME a bit.
870
871 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
872
873         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
874         only passing five parameters to FUTEX_WAIT_BITSET call.
875
876         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
877         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
878         instead of computing relative timeout.
879
880 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
881
882         * init.c (__pthread_initialize_minimal_internal): Check for
883         FUTEX_CLOCK_REALTIME flag.
884         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
885         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
886         relative timeout.
887
888         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
889         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
890         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
891         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
892         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
893         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
894
895 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
896
897         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
898         loop body instead of ; to avoid gcc warnings.
899         (pthread_cleanup_pop_restore_np): Likewise.
900         Patch by Caolán McNamara <caolanm@redhat.com>.
901
902 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
903
904         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
905         fast path here, for robust/PI/PP mutexes call
906         __pthread_mutex_lock_full.  Don't use switch, instead use a series
907         of ifs according to their probability.
908         (__pthread_mutex_lock_full): New function.
909         * pthread_mutex_unlock.c: Include assert.h.
910         (__pthread_mutex_unlock_usercnt): Handle only the
911         fast path here, for robust/PI/PP mutexes call
912         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
913         of ifs according to their probability.
914         (__pthread_mutex_unlock_full): New function.
915         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
916         (__pthread_mutex_lock_full): Define.
917
918 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
919
920         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
921         implementation.  Add necessary padding and.
922         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
923         words.
924
925 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
926
927         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
928         and FUTEX_WAKE_BITSET.
929
930 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
931
932         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
933         and FUTEX_WAKE_BITSET.
934         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
935         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
936         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
937         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
938
939 2008-11-25  Roland McGrath  <roland@redhat.com>
940
941         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
942         Subdirectories moved to ports repository as
943         sysdeps/.../nptl subdirectories.
944
945 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
946
947         [BZ #7008]
948         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
949         of old value.
950         * pthread_cond_init.c (__pthread_cond_init): Fix
951         cond->__data.__nwaiters initialization.
952         * Makefile (tests): Add tst-cond23.
953         * tst-cond23.c: New test.
954
955 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
956
957         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
958         arguments.
959         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
960         arguments.
961
962 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
963
964         [BZ #6955]
965         * pthread_mutex_lock.c: Add support for private PI mutexes.
966         * pthread_mutex_timedlock.c: Likewise.
967         * pthread_mutex_trylock.c: Likewise.
968         * pthread_mutex_unlock.c: Likewise.
969         Patch mostly by Ben Jackson <ben@ben.com>.
970
971 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
972
973         [BZ #6843]
974         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
975         Increase stack size for helper thread.
976
977 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
978
979         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
980         assembly with a clobber list for access registers a0 and a1.
981
982 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
983
984         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
985         to force runp->refcntr to be read from memory.
986
987 2008-09-08  Richard Guenther  <rguenther@suse.de>
988
989         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
990         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
991         lll_timedlock, lll_robust_timedlock, lll_unlock,
992         lll_robust_unlock): Promote private to int.
993
994 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
995
996         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
997         ARCH_RETRY_MMAP definitions.
998         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
999         Define MAP_STACK when not defined.
1000         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
1001         handling of ARCH_RETRY_MMAP.
1002
1003 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
1004
1005         * tst-align2.c (f): Print message that f is reached.
1006
1007 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
1008
1009         [BZ #6740]
1010         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
1011         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
1012
1013 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
1014
1015         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
1016         SOCK_CLOEXEC if possible.
1017
1018 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
1019
1020         * Makefile (tests): Add tst-rwlock2a.
1021         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
1022         * tst-rwlock2a.c: New file.
1023
1024 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
1025
1026         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
1027
1028 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
1029
1030         * sysdeps/pthread/pthread.h: Fix typo in comment.
1031
1032 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
1033
1034         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
1035         of CPU set to the kernel.
1036
1037 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
1038
1039         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
1040         cfi directives.
1041         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1042         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1043         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1044         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1045         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1046         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1047
1048 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
1049
1050         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
1051         cfi directives.
1052         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1053         Likewise.
1054         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1055         Likewise.
1056         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1057         Likewise.
1058
1059 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
1060
1061         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
1062
1063 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
1064
1065         David S. Miller  <davem@davemloft.net>
1066
1067         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
1068
1069 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
1070
1071         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
1072         __pshared correctly.
1073         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1074         Likewise.
1075         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1076         Likewise.
1077         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1078         Likewise.
1079         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1080         Likewise.
1081         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
1082
1083 2008-04-14  David S. Miller  <davem@davemloft.net>
1084
1085         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
1086         (__old_sem_wait): Fix argument to lll_futex_wait().
1087
1088 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
1089
1090         * pthread_create.c: Require pthread_mutex_trylock and
1091         pthread_key_delete for libgcc.
1092
1093 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
1094
1095         [BZ #6020]
1096         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
1097         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
1098         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
1099
1100 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
1101
1102         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
1103         <linux/limits.h> has defined it.
1104         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1105         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1106         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
1107         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1108
1109 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
1110
1111         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
1112         of ASSEMBLER.
1113         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
1114         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
1115
1116 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
1117
1118         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
1119         HAVE_DL_DISCOVER_OSVERSION.
1120         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
1121         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
1122
1123 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
1124
1125         [BZ #5778]
1126         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
1127         _POSIX_CHOWN_RESTRICTED value to zero.
1128
1129 2008-01-31  Roland McGrath  <roland@redhat.com>
1130
1131         * Makefile (omit-deps): Variable removed.
1132
1133 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
1134
1135         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
1136         unnecessary addr32 prefix.
1137
1138 2008-01-29  Roland McGrath  <roland@redhat.com>
1139
1140         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
1141
1142 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1143
1144         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
1145
1146 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1147
1148         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
1149         a scratch register.
1150         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1151         (__lll_lock_wait_private): Fix typo.
1152         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
1153         (pthread_barrier_wait): Likewise.  Adjust XADD use.
1154         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
1155         Adjust XADD use.
1156         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
1157         (pthread_rwlock_timedrdlock): Return correct return value.
1158         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
1159         (pthread_rwlock_timedwrlock): Likewise.
1160
1161 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
1162
1163         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
1164         thread returns the program exits with an error code.
1165
1166 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
1167
1168         * pthread-errnos.sym: Add EOVERFLOW.
1169         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
1170         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
1171         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1172         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1173
1174 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
1175
1176         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
1177         parameter.  Passed it as permission to mmap.
1178         * allocatestack.c (allocate_stack): Pass prot as second parameter
1179         to ARCH_RETRY_MMAP.
1180
1181 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
1182
1183         * tst-basic7.c: Allocate memory for the stack.
1184
1185         [BZ #5465]
1186         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
1187         (__pthread_cond_timedwait): Don't use VDSO.
1188         Patch by Michal Januszewski.
1189
1190 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
1191
1192         [BZ #5455]
1193         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
1194         Allow label before pthread_cleanup_pop.
1195         (pthread_cleanup_pop_restore_np): Likewise.
1196
1197 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1198
1199         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
1200         Store 2 before returning ETIMEDOUT.
1201
1202 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
1203
1204         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
1205         Store 2 before returning ETIMEDOUT.
1206         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
1207         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1208         (__lll_lock_wait_private): Optimize.
1209         (__lll_lock_wait): Likewise.
1210
1211 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
1212
1213         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
1214         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
1215         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
1216
1217 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
1218
1219         [BZ #5240]
1220         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
1221         If we time out, try one last time to lock the futex to avoid
1222         losing a wakeup signal.
1223         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1224         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1225
1226         [BZ #5245]
1227         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
1228         if necessary.
1229
1230 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
1231
1232         [BZ #5245]
1233         * allocatestack.c (allocate_stack): Change ENOMEM error in case
1234         mmap failed to EAGAIN.
1235         * Makefile (tests): Add tst-basic7.
1236         * tst-basic7.c: New file.
1237
1238 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
1239
1240         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
1241         Use __linkin_atfork.
1242
1243 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
1244
1245         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
1246         missing line continuations.
1247         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
1248         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
1249
1250 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
1251
1252         [BZ #5220]
1253         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
1254         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
1255         (struct timer): Add next element.
1256         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
1257         enqueue timer structure into __active_timer_sigev_thread list.
1258         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
1259         remove timer struct from __active_timer_sigev_thread.
1260         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1261         Before using timer structure make sure it is still on the
1262         __active_timer_sigev_thread list.  Keep lock until done.
1263         Define __active_timer_sigev_thread and
1264         __active_timer_sigev_thread_lock.
1265
1266 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
1267
1268         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
1269         Redefine thread_atfork for use of ATFORK_MEM.
1270         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
1271         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
1272         function.
1273         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1274         Use atomic operation when removing first element of list.
1275
1276 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
1277
1278         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
1279         routine instead of an alias to __new_sem_post.
1280
1281 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
1282
1283         * init.c (__pthread_initialize_minimal): Initialize word to appease
1284         valgrind.
1285
1286 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
1287
1288         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
1289         libc.so just clear NAME.
1290         (__libc_rwlock_fini): Nop inside of libc.so.
1291         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
1292         all zeros.
1293
1294 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
1295
1296         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1297         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
1298         unlocking failed.
1299         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
1300
1301 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
1302
1303         [BZ #4938]
1304         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
1305         reclaimed stack if necessary.
1306         * Makefile (tests): Add tst-tsd6.
1307         * tst-tsd6.c: New file.
1308
1309 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
1310
1311         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
1312         Add private argument.
1313
1314 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
1315
1316         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1317         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
1318
1319 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
1320
1321         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
1322         (__lll_robust_timedlock): Pass private as last argument to
1323         __lll_robust_timedlock_wait.
1324         (__lll_unlock): Fix a pasto.
1325
1326 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
1327
1328         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
1329         sparc_old_sem): New structs.
1330         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
1331         (__sem_wait_cleanup): New function.
1332         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
1333         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1334         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1335         lll_futex_wait.
1336         (__old_sem_wait): New function.
1337         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
1338         nptl/sysdeps/unix/sysv/linux/sparc version.
1339         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
1340         Likewise.
1341         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
1342         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
1343         (__new_sem_trywait): Use sparc_old_sem structure.
1344         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
1345         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
1346         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1347         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1348         lll_futex_timed_wait.
1349         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
1350         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
1351         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1352         lll_futex_wake.
1353         (__old_sem_post): New function.
1354         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
1355         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
1356         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
1357         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
1358         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
1359         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
1360
1361 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1362
1363         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1364         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1365         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1366         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1367         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
1368         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1369         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1370         Use FUTEX_WAKE_OP.
1371         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1372         kernel-features.h and tcb-offsets.h.
1373         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1374         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1375         process private.
1376         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1377         tcb-offsets.h.
1378         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
1379         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1380         process private.
1381         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
1382         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1383         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1384         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1385         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1386         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1387         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1388
1389 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
1390
1391         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
1392         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1393         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
1394         lll_futex_timed_wait.
1395
1396         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
1397         __lll_robust_unlock): Rewrite as macros instead of inline functions.
1398         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
1399         __lll_robust_unlock, __lll_wait_tid): Likewise.
1400
1401 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1402
1403         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1404         Fix a pasto.
1405         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1406         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1407         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1408         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1409         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1410         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1411         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1412         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
1413         kernel-features.h.
1414         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1415         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1416         process private.  Switch DW_CFA_advance_loc1 and some
1417         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1418         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1419         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
1420         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1421         process private.  Switch DW_CFA_advance_loc{1,2} and some
1422         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1423         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
1424         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1425         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1426         Likewise.
1427         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1428         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1429         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1430         Likewise.
1431         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1432         (__pthread_cond_broadcast): Compare %r8 instead of
1433         dep_mutex-cond_*(%rdi) with $-1.
1434         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1435         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
1436         of oring.
1437
1438 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
1439
1440         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
1441
1442 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1443
1444         * allocatestack.c: Include kernel-features.h.
1445         * pthread_create.c: Likewise.
1446         * pthread_mutex_init.c: Likewise.
1447         * init.c: Likewise.
1448         * pthread_cond_timedwait.c: Likewise.
1449         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1450         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1451         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1452         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1453         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1454         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1455         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1456         Likewise.
1457         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1458         Likewise.
1459         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1460         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1461         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1462         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1463
1464 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
1465
1466         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
1467         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1468         byte elements.  One of them is the new __shared element.
1469         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1470         adjust names of other padding elements.
1471         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
1472         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1473         byte elements.  One of them is the new __shared element.
1474         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1475         adjust names of other padding elements.
1476         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
1477         Renamed __pad1 element to __shared, adjust names of other padding
1478         elements.
1479         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1480         (pthread_rwlock_t): Likewise.
1481         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
1482         typo.
1483
1484 2007-08-09  Anton Blanchard  <anton@samba.org>
1485
1486         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
1487
1488 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
1489
1490         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
1491         <kernel-features.h>.
1492         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1493
1494 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
1495
1496         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
1497         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
1498         dealing with robust mutexes.
1499         * pthread_mutex_timedlock.c: Likewise.
1500         * pthread_mutex_trylock.c: Likewise.
1501         * pthread_mutex_unlock.c: Likewise.
1502         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1503
1504 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
1505
1506         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
1507         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
1508         (PTHREAD_MUTEX_PSHARED): Define.
1509         * pthread_mutex_init.c (__pthread_mutex_init): Set
1510         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
1511         mutexes.
1512         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
1513         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
1514         as second argument to lll_lock.
1515         (LLL_MUTEX_TRYLOCK): Take mutex as argument
1516         instead of its __data.__lock field.
1517         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1518         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1519         to lll_robust_lock.
1520         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1521         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
1522         instead of mutex->__data.__kind directly, pass
1523         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
1524         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
1525         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1526         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
1527         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
1528         to lll_timedlock, lll_robust_timedlock, lll_unlock and
1529         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
1530         of mutex->__data.__kind directly.
1531         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
1532         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
1533         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
1534         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
1535         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
1536         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
1537         and lll_futex_wake.
1538         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
1539         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
1540         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1541         directly.
1542         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
1543         Take mutex as argument instead of its __data.__lock field, pass
1544         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
1545         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
1546         __data.__lock field.
1547         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1548         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1549         to lll_robust_cond_lock.
1550         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
1551         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
1552         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
1553         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
1554         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
1555         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
1556         lll_futex_wait.
1557         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
1558         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
1559         lll_futex_wake.
1560         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
1561         pshared variable, pass it to lll_lock, lll_unlock,
1562         lll_futex_timedwait and lll_futex_wake.
1563         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
1564         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
1565         and lll_futex_wake.
1566         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
1567         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
1568         macro.
1569         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
1570         lll_futex_wake_unlock): Likewise.
1571         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
1572         Likewise.
1573         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
1574         lll_futex_wake_unlock): Likewise.
1575         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
1576         Likewise.
1577         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
1578         lll_futex_wake_unlock): Likewise.
1579         (lll_futex_wake): Fix a typo.
1580         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
1581         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1582         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1583         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1584         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1585         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1586         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1587         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1588         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1589         (__pthread_cond_timedwait): Likewise.
1590         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1591         (__condvar_cleanup, __pthread_cond_wait): Likewise.
1592
1593 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
1594
1595         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1596         Don't use CGOTSETUP and CGOTRESTORE macros.
1597         (CGOTSETUP, CGOTRESTORE): Remove.
1598         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
1599         @local symbol.
1600
1601 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1602
1603         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
1604         definitions for private futexes.
1605         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
1606         kernel-features.h and lowlevellock.h.  Use private futexes if
1607         they are available.
1608         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
1609         (__lll_mutex_lock_wait): Rename to
1610         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
1611         (__lll_mutex_timedlock_wait): Rename to ...
1612         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
1613         Don't compile in for libc.so.
1614         (__lll_mutex_unlock_wake): Rename to ...
1615         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
1616         (__lll_timedwait_tid): Use __NR_gettimeofday.
1617         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
1618         the header from assembler.  Renamed all lll_mutex_* resp.
1619         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1620         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
1621         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
1622         Define.
1623         (__lll_lock_wait_private): Add prototype.
1624         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
1625         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
1626         __lll_unlock_wake): Likewise.
1627         (lll_lock): Add private argument.  Call __lll_lock_wait_private
1628         if private is constant LLL_PRIVATE.
1629         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1630         lll_timedlock, lll_robust_timedlock): Add private argument.
1631         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
1632         if private is constant LLL_PRIVATE.
1633         (lll_robust_unlock, lll_robust_dead): Add private argument.
1634         (lll_lock_t): Remove.
1635         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1636         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1637         lll_cond_wake, lll_cond_broadcast): Remove.
1638         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
1639         kernel-features.h and lowlevellock.h.
1640         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1641         (LOAD_FUTEX_WAIT): Define.
1642         (__lll_robust_mutex_lock_wait): Rename to ...
1643         (__lll_robust_lock_wait): ... this.  Add private argument.
1644         Use LOAD_FUTEX_WAIT macro.
1645         (__lll_robust_mutex_timedlock_wait): Rename to ...
1646         (__lll_robust_timedlock_wait): ... this.    Add private argument.
1647         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
1648         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
1649         lowlevellock.h.
1650         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1651         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
1652         __lll_mutex_{lock,unlock}_*.
1653         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
1654         lowlevellock.h and pthread-errnos.h.
1655         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1656         FUTEX_CMP_REQUEUE, EINVAL): Remove.
1657         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
1658         __lll_mutex_{lock,unlock}_*.
1659         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
1660         lowlevellock.h and pthread-errnos.h.
1661         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
1662         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
1663         __lll_mutex_{lock,unlock}_*.
1664         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1665         lowlevellock.h.
1666         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
1667         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
1668         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1669         (__condvar_tw_cleanup): Likewise.
1670         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1671         lowlevellock.h.
1672         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1673         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
1674         __lll_mutex_{lock,unlock}_*.
1675         ( __condvar_w_cleanup): Likewise.
1676         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
1677         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1678         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
1679         lowlevellock.h.
1680         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1681         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
1682         __lll_mutex_{lock,unlock}_*.
1683         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
1684         lowlevellock.h.
1685         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1686         FUTEX_PRIVATE_FLAG): Remove.
1687         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
1688         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1689         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
1690         lowlevellock.h.
1691         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1692         FUTEX_PRIVATE_FLAG): Remove.
1693         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
1694         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1695         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
1696         lowlevellock.h.
1697         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1698         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
1699         __lll_mutex_{lock,unlock}_*.
1700         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
1701         lowlevellock.h.
1702         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1703         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
1704         __lll_mutex_{lock,unlock}_*.
1705         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
1706         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1707         (__new_sem_post): Use standard initial exec code sequences.
1708         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
1709         lowlevellock.h.
1710         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1711         FUTEX_PRIVATE_FLAG): Remove.
1712         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
1713         exec code sequences.
1714         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
1715         (__new_sem_trywait): Use standard initial exec code sequences.
1716         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
1717         (__new_sem_wait): Use standard initial exec code sequences.
1718
1719 2007-07-31  Anton Blanchard  <anton@samba.org>
1720
1721         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1722         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
1723         atomic_full_barrier.
1724
1725 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1726
1727         * allocatestack.c (stack_cache_lock): Change type to int.
1728         (get_cached_stack, allocate_stack, __deallocate_stack,
1729         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
1730         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
1731         as second argument to lll_lock and lll_unlock macros on
1732         stack_cache_lock.
1733         * pthread_create.c (__find_in_stack_list): Likewise.
1734         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
1735         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
1736         as second argument.
1737         * descr.h (struct pthread): Change lock and setxid_futex field
1738         type to int.
1739         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
1740         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
1741         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
1742         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
1743         Likewise.
1744         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
1745         * pthread_cond_init.c (__pthread_cond_init): Likewise.
1746         * pthreadP.h (__attr_list_lock): Change type to int.
1747         * pthread_attr_init.c (__attr_list_lock): Likewise.
1748         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
1749         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
1750         lll_{,un}lock.
1751         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
1752         also for lll_futex_{wake,wait}.
1753         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
1754         a pointer to const.
1755         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
1756         LLL_SHARED as second argument to lll_{,un}lock.
1757         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
1758         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
1759         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
1760         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
1761         Likewise.
1762         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
1763         as second argument to lll_{,un}lock macros on pd->lock.
1764         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
1765         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
1766         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1767         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
1768         Likewise.
1769         * sysdeps/pthread/createthread.c (do_clone, create_thread):
1770         Likewise.
1771         * pthread_once.c (once_lock): Change type to int.
1772         (__pthread_once): Pass LLL_PRIVATE as second argument to
1773         lll_{,un}lock macros on once_lock.
1774         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
1775         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
1776         rwlock->__data.__shared as second argument to them and similarly
1777         for lll_futex_w*.
1778         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
1779         Likewise.
1780         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
1781         Likewise.
1782         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
1783         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
1784         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
1785         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1786         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
1787         to lll_{,un}lock macros on __sem_mappings_lock.
1788         * sem_open.c (check_add_mapping): Likewise.
1789         (__sem_mappings_lock): Change type to int.
1790         * semaphoreP.h (__sem_mappings_lock): Likewise.
1791         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1792         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
1793         instead of lll_*mutex_*, pass LLL_SHARED as last
1794         argument.
1795         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
1796         pass LLL_SHARED as last argument.
1797         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
1798         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
1799         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
1800         pass LLL_SHARED as last argument.
1801         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1802         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
1803         LLL_SHARED as last argument.
1804         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
1805         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
1806         Similarly.
1807         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
1808         __libc_lock_lock_recursive, __libc_lock_unlock,
1809         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
1810         argument to lll_{,un}lock.
1811         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
1812         _IO_lock_unlock): Likewise.
1813         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
1814         compound literal.
1815         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1816         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
1817         __fork_lock.
1818         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
1819         free_mem): Likewise.
1820         (__fork_lock): Change type to int.
1821         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
1822         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
1823         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
1824         lll_futex_wake.
1825         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1826         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
1827         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
1828         New function.
1829         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
1830         pass it through to lll_futex_*wait, only compile in when
1831         IS_IN_libpthread.
1832         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1833         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
1834         argument and pass it through to lll_futex_*wait.
1835         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
1836         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
1837         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
1838         inline functions to __lll_* resp. __lll_robust_*.
1839         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
1840         (lll_mutex_dead): Add private argument.
1841         (__lll_lock_wait_private): New prototype.
1842         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
1843         __lll_robust_lock_timedwait): Add private argument to prototypes.
1844         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
1845         call __lll_lock_wait_private, otherwise pass private to
1846         __lll_lock_wait.
1847         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
1848         __lll_robust_timedlock): Add private argument, pass it to
1849         __lll_*wait functions.
1850         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
1851         call __lll_unlock_wake_private, otherwise pass private to
1852         __lll_unlock_wake.
1853         (__lll_robust_unlock): Add private argument, pass it to
1854         __lll_robust_unlock_wake.
1855         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
1856         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
1857         argument, pass it through to __lll_* inline function.
1858         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
1859         (lll_lock_t): Remove.
1860         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1861         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1862         lll_cond_wake, lll_cond_broadcast): Remove.
1863         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1864         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1865         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1866         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1867         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
1868         the header from assembler.  Renamed all lll_mutex_* resp.
1869         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1870         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
1871         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1872         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
1873         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
1874         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
1875         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
1876         Remove prototype.
1877         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
1878         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
1879         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
1880         (lll_trylock): Likewise, use __lll_trylock_asm, pass
1881         MULTIPLE_THREADS_OFFSET as another asm operand.
1882         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
1883         MULTIPLE_THREADS_OFFSET as last asm operand, call
1884         __lll_lock_wait_private if private is constant LLL_PRIVATE,
1885         otherwise pass private as another argument to __lll_lock_wait.
1886         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1887         lll_timedlock, lll_robust_timedlock): Add private argument, pass
1888         private as another argument to __lll_*lock_wait call.
1889         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
1890         MULTIPLE_THREADS_OFFSET as another asm operand, call
1891         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
1892         otherwise pass private as another argument to __lll_unlock_wake.
1893         (lll_robust_unlock): Add private argument, pass private as another
1894         argument to __lll_unlock_wake.
1895         (lll_robust_dead): Add private argument, use __lll_private_flag
1896         macro.
1897         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
1898         LLL_MUTEX_LOCK_INITIALIZER.
1899         (lll_lock_t): Remove.
1900         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1901         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1902         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1903         lll_cond_wake, lll_cond_broadcast): Remove.
1904         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1905         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1906         2007-05-2{3,9} changes.
1907         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1908         kernel-features.h and lowlevellock.h.
1909         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1910         (LOAD_FUTEX_WAIT): Rewritten.
1911         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1912         define.
1913         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1914         (__lll_mutex_lock_wait): Rename to ...
1915         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1916         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1917         (__lll_mutex_timedlock_wait): Rename to ...
1918         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1919         contains private argument.  Don't compile in for libc.so.
1920         (__lll_mutex_unlock_wake): Rename to ...
1921         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1922         Don't compile in for libc.so.
1923         (__lll_timedwait_tid): Use __NR_gettimeofday.
1924         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1925         kernel-features.h and lowlevellock.h.
1926         (LOAD_FUTEX_WAIT): Define.
1927         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1928         define.
1929         (__lll_robust_mutex_lock_wait): Rename to ...
1930         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1931         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1932         macro.
1933         (__lll_robust_mutex_timedlock_wait): Rename to ...
1934         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1935         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1936         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1937         lowlevellock.h.
1938         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1939         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1940         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1941         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1942         to __lll_lock_wait in %edx.
1943         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1944         Include lowlevellock.h and pthread-errnos.h.
1945         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1946         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1947         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
1948         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1949         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1950         __lll_unlock_wake.
1951         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1952         Include lowlevellock.h and pthread-errnos.h.
1953         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1954         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1955         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1956         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1957         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1958         __lll_unlock_wake.
1959         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1960         Include lowlevellock.h.
1961         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1962         Don't define.
1963         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1964         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1965         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1966         __lll_unlock_wake.  Use __NR_gettimeofday.
1967         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1968         Include lowlevellock.h.
1969         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1970         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1971         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1972         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1973         and __lll_unlock_wake.
1974         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1975         Include lowlevellock.h.
1976         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1977         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1978         MUTEX(%ebx) address in %edx rather than %ecx to
1979         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1980         and __lll_unlock_wake.  Move return value from %ecx to %edx
1981         register.
1982         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1983         Include lowlevellock.h.
1984         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1985         Don't define.
1986         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1987         MUTEX(%ebp) address in %edx rather than %ecx to
1988         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1989         and __lll_unlock_wake.  Move return value from %ecx to %edx
1990         register.  Use __NR_gettimeofday.
1991         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1992         Include lowlevellock.h.
1993         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1994         Don't define.
1995         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1996         MUTEX(%ebp) address in %edx rather than %ecx to
1997         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1998         and __lll_unlock_wake.  Move return value from %ecx to %edx
1999         register.  Use __NR_gettimeofday.
2000         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
2001         Include lowlevellock.h.
2002         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2003         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
2004         MUTEX(%edi) address in %edx rather than %ecx to
2005         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
2006         and __lll_unlock_wake.
2007         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
2008         Include lowlevellock.h.
2009         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2010         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
2011         MUTEX(%ebx) address in %edx rather than %ecx to
2012         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
2013         and __lll_unlock_wake.  Move return value from %ecx to %edx
2014         register.
2015         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
2016         lowlevellock.h.
2017         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
2018         define.
2019         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
2020         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
2021         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
2022         lowlevellock.h.
2023         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
2024         (sem_timedwait): Use __NR_gettimeofday.
2025         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
2026         lowlevellock.h.
2027         (LOCK): Don't define.
2028         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
2029         lowlevellock.h.
2030         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
2031         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
2032         are waiters.
2033         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
2034         2007-05-2{3,9} changes.
2035         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
2036         kernel-features.h and lowlevellock.h.
2037         (LOAD_PRIVATE_FUTEX_WAIT): Define.
2038         (LOAD_FUTEX_WAIT): Rewritten.
2039         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
2040         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
2041         (__lll_mutex_lock_wait): Rename to ...
2042         (__lll_lock_wait): ... this.  %esi is now private argument.
2043         Don't compile in for libc.so.
2044         (__lll_mutex_timedlock_wait): Rename to ...
2045         (__lll_timedlock_wait): ... this.  %esi contains private argument.
2046         Don't compile in for libc.so.
2047         (__lll_mutex_unlock_wake): Rename to ...
2048         (__lll_unlock_wake): ... this.  %esi contains private argument.
2049         Don't compile in for libc.so.
2050         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
2051         kernel-features.h and lowlevellock.h.
2052         (LOAD_FUTEX_WAIT): Define.
2053         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
2054         (__lll_robust_mutex_lock_wait): Rename to ...
2055         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
2056         Use LOAD_FUTEX_WAIT macro.
2057         (__lll_robust_mutex_timedlock_wait): Rename to ...
2058         (__lll_robust_timedlock_wait): ... this. %esi argument contains
2059         private, use LOAD_FUTEX_WAIT macro.
2060         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
2061         lowlevellock.h.
2062         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2063         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
2064         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
2065         __lll_lock_wait and __lll_unlock_wake.
2066         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
2067         Include lowlevellock.h and pthread-errnos.h.
2068         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
2069         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
2070         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
2071         pass LLL_SHARED in %esi to both __lll_lock_wait and
2072         __lll_unlock_wake.
2073         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
2074         Include lowlevellock.h and pthread-errnos.h.
2075         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
2076         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
2077         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
2078         pass LLL_SHARED in %esi to both __lll_lock_wait and
2079         __lll_unlock_wake.
2080         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
2081         Include lowlevellock.h.
2082         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2083         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
2084         pass LLL_SHARED in %esi to both __lll_lock_wait and
2085         __lll_unlock_wake.
2086         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
2087         Include lowlevellock.h.
2088         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2089         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
2090         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
2091         and __lll_unlock_wake.
2092         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
2093         Include lowlevellock.h.
2094         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2095         Don't define.
2096         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
2097         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
2098         and __lll_unlock_wake.
2099         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2100         Include lowlevellock.h.
2101         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2102         Don't define.
2103         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
2104         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
2105         and __lll_unlock_wake.
2106         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2107         Include lowlevellock.h.
2108         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2109         Don't define.
2110         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
2111         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
2112         and __lll_unlock_wake.
2113         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
2114         Include lowlevellock.h.
2115         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2116         Don't define.
2117         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
2118         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
2119         and __lll_unlock_wake.
2120         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
2121         Include lowlevellock.h.
2122         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2123         Don't define.
2124         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
2125         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
2126         and __lll_unlock_wake.
2127         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
2128         lowlevellock.h.
2129         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
2130         define.
2131         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
2132         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
2133         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
2134         lowlevellock.h.
2135         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
2136         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
2137         lowlevellock.h.
2138         (LOCK): Don't define.
2139         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
2140         lowlevellock.h.
2141         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
2142         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
2143         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
2144         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
2145         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
2146         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
2147         (__lll_lock_wait_private): New function.
2148         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
2149         it to lll_futex_*wait.  Don't compile in for libc.so.
2150         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
2151         Remove.
2152         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
2153         (struct sparc_pthread_barrier): Remove.
2154         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
2155         struct sparc_pthread_barrier.  Pass
2156         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
2157         and lll_futex_wait macros.
2158         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2159         Remove.
2160         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2161         Include sparc pthread_barrier_wait.c instead of generic one.
2162
2163 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
2164
2165         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
2166
2167         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
2168         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
2169         %ecx.
2170         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
2171         (pthread_rwlock_timedwrlock): Likewise.
2172         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
2173         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
2174
2175 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
2176
2177         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
2178
2179 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
2180
2181         * tst-locale2.c (useless): Add return statement.
2182
2183 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
2184
2185         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
2186         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
2187         * pthread_create.c (start_thread): Likewise.
2188         * init.c (sighandler_setxid): Likewise.
2189         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2190         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2191         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2192         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2193         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2194         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2195         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2196         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2197         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
2198         Likewise.
2199         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
2200         Likewise.
2201         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
2202         Likewise.
2203         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
2204         __rtld_notify): Likewise.
2205         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
2206         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
2207         __pthread_once): Likewise.
2208         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
2209         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2210         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2211         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2212         (lll_futex_wait): Add private argument, define as wrapper around
2213         lll_futex_timed_wait.
2214         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2215         use __lll_private_flag macro.
2216         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
2217         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
2218         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
2219         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2220         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2221         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2222         (lll_futex_wait): Add private argument, define as wrapper around
2223         lll_futex_timed_wait.
2224         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2225         use __lll_private_flag macro.
2226         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
2227         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
2228         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
2229         Define.
2230         (lll_futex_timed_wait, lll_futex_wake): Use it.
2231         (lll_private_futex_wait, lll_private_futex_timed_wait,
2232         lll_private_futex_wake): Removed.
2233         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
2234         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2235         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2236         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2237         (lll_futex_wait): Add private argument, define as wrapper around
2238         lll_futex_timed_wait.
2239         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2240         use __lll_private_flag macro.
2241         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
2242         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
2243         to lll_futex_*.
2244         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2245         (lll_private_futex_wait, lll_private_futex_timed_wait,
2246         lll_private_futex_wake): Removed.
2247         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
2248         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
2249         (lll_private_futex_wait, lll_private_futex_timed_wait,
2250         lll_private_futex_wake): Removed.
2251         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
2252         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2253         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2254         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2255         (lll_futex_wait): Add private argument, define as wrapper around
2256         lll_futex_timed_wait.
2257         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2258         use __lll_private_flag macro.
2259         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
2260         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
2261         to lll_futex_*.
2262         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
2263         Define.
2264         (lll_futex_timed_wait, lll_futex_wake): Use it.
2265         (lll_private_futex_wait, lll_private_futex_timed_wait,
2266         lll_private_futex_wake): Removed.
2267
2268 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
2269
2270         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
2271         of the structure for sparc32.
2272
2273 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
2274
2275         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
2276
2277 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
2278
2279         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
2280         code used when private futexes are assumed.
2281         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2282         Likewise.
2283
2284 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
2285
2286         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2287         (__lll_private_flag): Define.
2288         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
2289         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
2290         __lll_private_flag.
2291         (lll_private_futex_wait, lll_private_futex_timedwait,
2292         lll_private_futex_wake): Define as wrapper around non-_private
2293         macros.
2294         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2295         (__lll_private_flag): Define.
2296         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
2297         (lll_private_futex_wait, lll_private_futex_timedwait,
2298         lll_private_futex_wake): Define as wrapper around non-_private
2299         macros.
2300
2301 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
2302
2303         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
2304         parameter to lll_futex_wait call.
2305         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
2306
2307         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2308         Replace lll_futex_wait with lll_private_futex_wait.
2309         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
2310         Add LLL_SHARED parameter to lll_futex_wake().
2311
2312         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
2313         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
2314         lll_private_futex_wake.
2315         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
2316         bit from private parm before syscall.
2317         (lll_futex_timed_wait): Likewise.
2318         (lll_futex_wake): Likewise.
2319         (lll_futex_wake_unlock): Likewise.
2320         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
2321         (lll_robust_mutex_unlock): Likewise.
2322         (lll_mutex_unlock_force): Likewise.
2323         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
2324
2325 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
2326
2327         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
2328         compilation when unconditionally using private futexes.
2329         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2330         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2331         Likewise.
2332         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2333         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2334
2335 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
2336
2337         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
2338         Define.
2339
2340 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2341
2342         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
2343         kernel-features.h.
2344
2345 2007-05-16  Roland McGrath  <roland@redhat.com>
2346
2347         * init.c (__nptl_initial_report_events): New variable.
2348         (__pthread_initialize_minimal_internal): Initialize pd->report_events
2349         to that.
2350
2351 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
2352
2353         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
2354         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
2355
2356 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
2357
2358         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
2359         implementation.
2360
2361 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
2362
2363         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
2364         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
2365         * pthread_mutex_timedlock.c: Likewise.
2366         * pthread_mutex_trylock.c: Likewise.
2367         * pthread_mutex_unlock.c: Likewise.
2368
2369 2007-06-17  Andreas Schwab  <schwab@suse.de>
2370
2371         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
2372         sections.
2373
2374 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
2375
2376         * allocatestack.c (allocate_stack): Make code compile if
2377         __ASSUME_PRIVATE_FUTEX is set.
2378
2379 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2380
2381         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
2382         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
2383         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
2384         (__pthread_rwlock_wrlock): Likewise.
2385         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2386         (pthread_rwlock_timedrdlock): Likewise.
2387         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2388         (pthread_rwlock_timedwrlock): Likewise.
2389         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
2390         (__pthread_rwlock_unlock): Likewise.
2391
2392 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2393
2394         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
2395         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
2396         Split __flags into __flags, __shared, __pad1 and __pad2.
2397         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
2398         futexes if they are available.
2399         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
2400         in libc-lowlevellock.S allow using private futexes.
2401         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
2402         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
2403         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
2404         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
2405         lll_private_futex_timed_wait and lll_private_futex_wake.
2406         (lll_robust_mutex_unlock): Fix typo.
2407         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
2408         field in futex command setup.
2409         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
2410         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
2411         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2412         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
2413         if they are available.  Remove clear_once_control.
2414         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
2415         futexes if they are available.
2416         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2417         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2418         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2419         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2420         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
2421         Wake only when there are waiters.
2422         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
2423         support.  Indicate that there are waiters.  Remove unnecessary
2424         extra cancellation test.
2425         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
2426         left-over duplication of __sem_wait_cleanup.
2427
2428 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
2429
2430         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
2431         parameter to lll_futex_wait, lll_futex_timed_wait, and
2432         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
2433         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
2434         lll_private_futex_wake.
2435         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2436         * allocatestack.c: Adjust use of lll_futex_* macros.
2437         * init.c: Likewise.
2438         * lowlevellock.h: Likewise.
2439         * pthread_barrier_wait.c: Likewise.
2440         * pthread_cond_broadcast.c: Likewise.
2441         * pthread_cond_destroy.c: Likewise.
2442         * pthread_cond_signal.c: Likewise.
2443         * pthread_cond_timedwait.c: Likewise.
2444         * pthread_cond_wait.c: Likewise.
2445         * pthread_create.c: Likewise.
2446         * pthread_mutex_lock.c: Likewise.
2447         * pthread_mutex_setprioceiling.c: Likewise.
2448         * pthread_mutex_timedlock.c: Likewise.
2449         * pthread_mutex_unlock.c: Likewise.
2450         * pthread_rwlock_timedrdlock.c: Likewise.
2451         * pthread_rwlock_timedwrlock.c: Likewise.
2452         * pthread_rwlock_unlock.c: Likewise.
2453         * sysdeps/alpha/tls.h: Likewise.
2454         * sysdeps/i386/tls.h: Likewise.
2455         * sysdeps/ia64/tls.h: Likewise.
2456         * sysdeps/powerpc/tls.h: Likewise.
2457         * sysdeps/pthread/aio_misc.h: Likewise.
2458         * sysdeps/pthread/gai_misc.h: Likewise.
2459         * sysdeps/s390/tls.h: Likewise.
2460         * sysdeps/sh/tls.h: Likewise.
2461         * sysdeps/sparc/tls.h: Likewise.
2462         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2463         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2464         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
2465         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
2466         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2467         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2468         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2469         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2470         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
2471         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
2472         Likewise.
2473         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
2474         * sysdeps/x86_64/tls.h: Likewise.
2475
2476 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
2477
2478         * pthread_getattr_np.c: No need to install a cancellation handler,
2479         this is no cancellation point.
2480         * pthread_getschedparam.c: Likewise.
2481         * pthread_setschedparam.c: Likewise.
2482         * pthread_setschedprio.c: Likewise.
2483         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
2484         lll_unlock_wake_cb.
2485         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2486         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2487         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2488         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2489         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2490         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2491         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2492         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2493         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2494         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
2495         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2496         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2497
2498         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
2499         whether there are more than one thread makes no sense here since
2500         we only call the slow path if the locks are taken.
2501         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
2502
2503         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
2504         COND_NWAITERS_SHIFT.
2505         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
2506         COND_CLOCK_BITS.
2507         * pthread_cond_init.c: Likewise.
2508         * pthread_cond_timedwait.c: Likewise.
2509         * pthread_cond_wait.c: Likewise.
2510         * pthread_condattr_getclock.c: Likewise.
2511         * pthread_condattr_setclock.c: Likewise.
2512         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
2513         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2514         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2515         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2516         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2517
2518 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
2519
2520         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
2521         unistd.h.
2522
2523         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
2524         insn suffix.
2525         (THREAD_GSCOPE_GET_FLAG): Remove.
2526         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
2527         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
2528         changes.
2529         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
2530         (THREAD_GSCOPE_GET_FLAG): Remove.
2531         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
2532         instead of THREAD_GSCOPE_GET_FLAG.
2533         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
2534         it.
2535         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2536         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2537         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2538         THREAD_GSCOPE_WAIT): Define.
2539         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2540         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2541         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2542         THREAD_GSCOPE_WAIT): Define.
2543         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2544         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2545         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2546         THREAD_GSCOPE_WAIT): Define.
2547         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2548         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2549         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2550         THREAD_GSCOPE_WAIT): Define.
2551
2552 2007-05-24  Richard Henderson  <rth@redhat.com>
2553
2554         * descr.h (struct pthread): Add header.gscope_flag.
2555         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2556         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2557         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2558         THREAD_GSCOPE_WAIT): Define.
2559
2560 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
2561
2562         * init.c: Make it compile with older kernel headers.
2563
2564         * tst-initializers1.c: Show through exit code which test failed.
2565
2566         * pthread_rwlock_init.c: Also initialize __shared field.
2567         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
2568         element in rwlock structure into four byte elements.  One of them is
2569         the new __shared element.
2570         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
2571         Likewise.
2572         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
2573         __shared, adjust names of other padding elements.
2574         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2575         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
2576         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
2577         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
2578         FUTEX_PRIVATE_FLAG.
2579         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
2580         futex to use private operations if possible.
2581         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2582         Likewise.
2583         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2584         Likewise.
2585         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2586         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2587         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2588         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2589         Likewise.
2590         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2591         Likewise.
2592         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2593         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2594
2595 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
2596
2597         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
2598         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
2599         * pthread_rwlock_timedrdlock.c: Likewise.
2600         * pthread_rwlock_tryrdlock.c: Likewise.
2601
2602         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
2603         optimization.
2604
2605         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
2606         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
2607         duplication of __sem_wait_cleanup.
2608
2609         * allocatestack.c: Revert last change.
2610         * init.c: Likewise.
2611         * sysdeps/i386/tls.h: Likewise.
2612         * sysdeps/x86_64/tls.h: Likewise.
2613         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
2614         header structure.
2615         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
2616
2617         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
2618         Add private field.
2619         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
2620         * pthread_barrier_init.c: Set private flag if pshared and private
2621         futexes are supported.
2622         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
2623         private field in futex command setup.
2624         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
2625
2626 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2627
2628         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
2629         support.
2630         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2631         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2632         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2633         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2634         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2635
2636         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
2637         * sem_init.c (__new_sem_init): Rewrite to initialize all three
2638         fields in the structure.
2639         (__old_sem_init): New function.
2640         * sem_open.c: Initialize all fields of the structure.
2641         * sem_getvalue.c: Adjust for renamed element.
2642         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
2643         (gen-as-const-headers): Add structsem.sym.
2644         * sysdeps/unix/sysv/linux/structsem.sym: New file.
2645         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
2646         struct new_sem.  Add struct old_sem.
2647         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
2648         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2649         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2650         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
2651         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2652         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2653         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2654         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2655         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2656         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
2657         * tst-sem10.c: New file.
2658         * tst-sem11.c: New file.
2659         * tst-sem12.c: New file.
2660         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
2661         of struct sem.
2662
2663 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2664             Jakub Jelinek  <jakub@redhat.com>
2665
2666         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2667         Move __pthread_enable_asynccancel right before futex syscall.
2668         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2669         Likewise.
2670
2671 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
2672
2673         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
2674         THREAD_COPY_PRIVATE_FUTEX): Define.
2675         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
2676         THREAD_COPY_PRIVATE_FUTEX): Define.
2677         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
2678         * init.c (__pthread_initialize_minimal_internal): Use
2679         THREAD_SET_PRIVATE_FUTEX.
2680
2681         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
2682         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
2683         THREAD_GSCOPE_FLAG_WAIT): Define.
2684         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
2685         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
2686         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
2687         PTR_DEMANGLE.
2688         (THREAD_GSCOPE_GET_FLAG): Define.
2689         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
2690         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
2691         instead of ->header.gscope_flag directly.
2692
2693 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
2694
2695         * init.c (__pthread_initialize_minimal_internal): Check whether
2696         private futexes are available.
2697         * allocatestack.c (allocate_stack): Copy private_futex field from
2698         current thread into the new stack.
2699         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
2700         futexes if they are available.
2701         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
2702         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
2703         in libc-lowlevellock.S allow using private futexes.
2704         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2705         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
2706         FUTEX_PRIVATE_FLAG.
2707         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2708         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
2709         if they are available.
2710         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2711         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
2712         * sysdeps/i386/tcb-offsets.sym: Likewise.
2713         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
2714         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
2715
2716 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
2717
2718         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2719         Remove ptr_wait_lookup_done again.
2720         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
2721         (__pthread_initialize_minimal_internal): Initialize
2722         _dl_wait_lookup_done pointer in _rtld_global directly.
2723         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2724         Remove code to code _dl_wait_lookup_done.
2725         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
2726         encrypted for now.
2727
2728 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
2729
2730         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
2731         pthread_mutex_init failed with ENOTSUP.
2732
2733 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
2734
2735         * allocatestack.c (__wait_lookup_done): New function.
2736         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2737         Add ptr_wait_lookup_done.
2738         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
2739         * pthreadP.h: Declare __wait_lookup_done.
2740         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
2741         Define macros to implement reference handling of global scope.
2742         * sysdeps/x86_64/tls.h: Likewise.
2743         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2744         Initialize GL(dl_wait_lookup_done).
2745
2746 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
2747
2748         [BZ #4512]
2749         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
2750         is detected.
2751         * pthread_mutex_timedlock.c: Likewise.
2752         * pthread_mutex_trylock.c: Likewise.
2753         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
2754
2755         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
2756         * tst-robust9.c: New file.
2757         * tst-robustpi9.c: New file.
2758
2759         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
2760         unnecessary extra cancellation test.
2761
2762 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
2763
2764         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
2765         extra cancellation test.
2766         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2767
2768 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
2769
2770         * descr.h (struct pthread): Rearrange members to fill hole in
2771         64-bit layout.
2772
2773         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2774         (__pthread_setaffinity_new): If syscall was successful and
2775         RESET_VGETCPU_CACHE is defined, use it before returning.
2776         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
2777
2778 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
2779
2780         [BZ #4455]
2781         * tst-align2.c: Include stackinfo.h.
2782         * tst-getpid1.c: Likewise.
2783
2784 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
2785
2786         [BZ #4455]
2787         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
2788         * tst-getpid1.c (do_test): Likewise.
2789
2790         [BZ #4456]
2791         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
2792         (allocate_stack): Likewise.
2793
2794 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
2795
2796         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2797         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
2798         (__lll_robust_timedlock_wait): Likewise.
2799         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
2800
2801 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
2802
2803         [BZ #4465]
2804         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
2805         * tst-cancel4.c (tf_fdatasync): New test.
2806
2807 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
2808
2809         [BZ #4392]
2810         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
2811         check mutexes like normal mutexes.
2812
2813         [BZ #4306]
2814         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
2815         Initialize the whole sigevent structure to appease valgrind.
2816
2817 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
2818
2819         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
2820         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
2821
2822 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
2823
2824         * tst-locale1.c: Avoid warnings.
2825         * tst-locale2.c: Likewise.
2826
2827 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
2828
2829         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2830         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
2831
2832 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
2833
2834         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
2835         __extern_always_inline where appropriate.
2836         * sysdeps/pthread/pthread.h: Likewise.
2837
2838 2007-03-13  Richard Henderson  <rth@redhat.com>
2839
2840         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
2841         separate cfi regions for the two subsections.
2842
2843 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
2844
2845         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
2846         new thread, don't just decrement it.
2847         Patch by Suzuki K P <suzuki@in.ibm.com>.
2848
2849 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
2850
2851         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
2852         PTHFCT_CALL definition.
2853
2854 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
2855
2856         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
2857         available, don't use it.
2858
2859 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
2860
2861         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2862         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
2863         call into the kernel to delay.
2864
2865 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
2866
2867         * tst-initializers1.c: We want to test the initializers as seen
2868         outside of libc, so undefined _LIBC.
2869
2870         * pthread_join.c (cleanup): Avoid warning.
2871
2872 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
2873
2874         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2875         (__lll_timedwait_tid): Add unwind info.
2876
2877         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
2878         function table, mangle the pointers.
2879         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
2880         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
2881         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
2882         demangle pointers before use.
2883         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
2884         demangle pointer.
2885         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2886         * sysdeps/pthread/setxid.h: Likewise.
2887
2888 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
2889
2890         * tst-rwlock7.c: Show some more information in case of correct
2891         behavior.
2892
2893 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
2894
2895         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2896         (lll_futex_timed_wait): Undo part of last change, don't negate
2897         return value.
2898
2899 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2900
2901         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2902         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2903
2904 2006-12-28  David S. Miller  <davem@davemloft.net>
2905
2906         * shlib-versions: Fix sparc64 linux target specification.
2907
2908 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2909
2910         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2911         Adjust include path for pthread_barrier_wait.c move.
2912
2913 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2914
2915         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2916         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2917
2918 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2919
2920         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2921         6 argument cancellable syscalls.
2922         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2923         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2924         6 argument cancellable syscalls.
2925         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2926
2927 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2928
2929         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2930         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2931
2932 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2933
2934         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2935         __sync_lock_release instead of __sync_lock_release_si.
2936
2937 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2938
2939         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2940         Define.
2941         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2942         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2943         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2944         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2945         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2946         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2947         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2948         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2949         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2950         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2951         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2952
2953 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2954
2955         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2956         * pthread_barrier_wait.c: ...here.
2957         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2958         * pthread_cond_broadcast.c: ...here.
2959         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2960         * pthread_cond_signal.c: ...here.
2961         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2962         * pthread_cond_timedwait.c: ...here.
2963         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2964         * pthread_cond_wait.c: ...here.
2965         * sysdeps/pthread/pthread_once.c: Move to...
2966         * pthread_once.c: ...here.
2967         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2968         * pthread_rwlock_rdlock.c: ...here.
2969         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2970         * pthread_rwlock_timedrdlock.c: ...here.
2971         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2972         * pthread_rwlock_timedwrlock.c: ...here.
2973         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2974         * pthread_rwlock_unlock.c: ...here.
2975         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2976         * pthread_rwlock_wrlock.c: ...here.
2977         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2978         * pthread_spin_destroy.c: ...here.
2979         * sysdeps/pthread/pthread_spin_init.c: Move to...
2980         * pthread_spin_init.c: ...here.
2981         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2982         * pthread_spin_unlock.c: ...here.
2983         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2984         * pthread_getcpuclockid.c: ...here.
2985
2986         * init.c: USE_TLS support is now always enabled.
2987         * tst-tls5.h: Likewise.
2988         * sysdeps/alpha/tls.h: Likewise.
2989         * sysdeps/i386/tls.h: Likewise.
2990         * sysdeps/ia64/tls.h: Likewise.
2991         * sysdeps/powerpc/tls.h: Likewise.
2992         * sysdeps/s390/tls.h: Likewise.
2993         * sysdeps/sh/tls.h: Likewise.
2994         * sysdeps/sparc/tls.h: Likewise.
2995         * sysdeps/x86_64/tls.h: Likewise.
2996
2997 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2998
2999         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
3000         __rtld_mrlock_change): Update oldval if atomic compare and exchange
3001         failed.
3002
3003         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3004         Define to THREAD_SELF->header.multiple_threads.
3005         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
3006         Likewise.
3007         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
3008         Likewise.
3009         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
3010         (SINGLE_THREAD_P): Likewise.
3011         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3012         (SINGLE_THREAD_P): Likewise.
3013         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3014         (SINGLE_THREAD_P): Likewise.
3015         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3016         (SINGLE_THREAD_P): Likewise.
3017         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
3018         Likewise.
3019         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
3020         (SINGLE_THREAD_P): Likewise.
3021         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
3022         (SINGLE_THREAD_P): Likewise.
3023         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
3024         Likewise.
3025
3026 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
3027
3028         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
3029         by default rather than 2_3_3.
3030
3031 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
3032
3033         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
3034         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
3035         atomic_* instead of catomic_* macros.
3036
3037 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
3038
3039         [BZ #3285]
3040         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
3041         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
3042         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
3043         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
3044         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
3045         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
3046         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
3047         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
3048         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
3049         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
3050         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
3051         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
3052         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
3053
3054 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
3055
3056         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
3057         cancelable syscalls with six parameters.
3058
3059         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
3060         operations instead of atomic_*.
3061
3062 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
3063
3064         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
3065
3066 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
3067
3068         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
3069         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
3070         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
3071         New file.
3072         * pthread_attr_setstack.c: Allow overwriting the version number of the
3073         new symbol.
3074         * pthread_attr_setstacksize.c: Likewise.
3075         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
3076         it.
3077         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
3078         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
3079
3080 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
3081
3082         [BZ #3251]
3083         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
3084         Patch by Petr Baudis.
3085
3086 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
3087
3088         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
3089
3090         * tst-cancel2.c (tf): Loop as long as something was written.
3091
3092 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3093
3094         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
3095         mutexes wake all mutexes.
3096         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
3097         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
3098         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3099
3100 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
3101
3102         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
3103         to guarantee the thread is always canceled.
3104
3105 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
3106
3107         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
3108         Include stdlib.h.
3109         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
3110         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
3111         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3112         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3113         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3114
3115 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
3116
3117         [BZ #3123]
3118         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
3119         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
3120         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3121         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3122         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3123         * Makefile (tests): Add tst-cond22.
3124         * tst-cond22.c: New file.
3125
3126 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
3127
3128         [BZ #3124]
3129         * descr.h (struct pthread): Add parent_cancelhandling.
3130         * sysdeps/pthread/createthread.c (create_thread): Pass parent
3131         cancelhandling value to child.
3132         * pthread_create.c (start_thread): If parent thread was canceled
3133         reset the SIGCANCEL mask.
3134         * Makefile (tests): Add tst-cancel25.
3135         * tst-cancel25.c: New file.
3136
3137 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
3138             Ulrich Drepper  <drepper@redhat.com>
3139
3140         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
3141         counterp if it is already zero.
3142         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
3143
3144 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
3145             Roland McGrath  <roland@redhat.com>
3146
3147         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3148         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
3149         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
3150         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
3151         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
3152         lll_robust_mutex_timedlock, lll_mutex_unlock,
3153         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
3154         Add _L_*_ symbols around the subsection.
3155         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
3156         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
3157
3158 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
3159             Roland McGrath  <roland@redhat.com>
3160
3161         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3162         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
3163         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
3164         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
3165         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
3166         lll_robust_mutex_timedlock, lll_mutex_unlock,
3167         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
3168         Add _L_*_ symbols around the subsection.
3169         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
3170         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
3171
3172 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
3173
3174         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
3175         change because it can disturb too much existing code.  If real hard
3176         reader preference is needed we'll introduce another type.
3177         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3178         (pthread_rwlock_timedwrlock): Likewise.
3179         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
3180         Likewise.
3181
3182 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
3183
3184         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
3185         reader preference.
3186         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3187         (pthread_rwlock_timedwrlock): Likewise.
3188         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
3189         Likewise.
3190
3191 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
3192
3193         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
3194         Only define ifdef SHARED.
3195
3196 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
3197
3198         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
3199         (free_stacks): ...here.
3200         (__free_stack_cache): New function.
3201         * pthreadP.h: Declare __free_stack_cache.
3202         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
3203         ptr_freeres.
3204         * init.c (pthread_functions): Initialize ptr_freeres.
3205         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
3206         New freeres function.
3207
3208 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
3209
3210         [BZ #3018]
3211         * Makefile (extra-objs): Add modules to extra-test-objs instead.
3212
3213 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
3214
3215         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3216         _XOPEN_REALTIME_THREADS.
3217
3218 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
3219
3220         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
3221         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
3222         HAVE_CLOCK_GETTIME_VSYSCALL.
3223         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
3224
3225 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
3226
3227         * sysdeps/unix/sysv/linux/bits/posix_opt.h
3228         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
3229         * descr.h (struct priority_protection_data): New type.
3230         (struct pthread): Add tpp field.
3231         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
3232         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
3233         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
3234         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
3235         TPP mutexes.
3236         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
3237         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
3238         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
3239         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
3240         * tpp.c: New file.
3241         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
3242         boosted by TPP.
3243         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
3244         * pthread_mutexattr_getprioceiling.c
3245         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
3246         in the SCHED_FIFO priority range.
3247         * pthread_mutexattr_setprioceiling.c
3248         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
3249         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
3250         if mutex is not TPP.  Ceiling is now in __data.__lock.
3251         * pthread_mutex_setprioceiling.c: Include stdbool.h.
3252         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
3253         is now in __data.__lock.  Add locking.
3254         * pthread_create.c (__free_tcb): Free pd->tpp structure.
3255         * Makefile (libpthread-routines): Add tpp.
3256         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
3257         * tst-tpp.h: New file.
3258         * tst-mutexpp1.c: New file.
3259         * tst-mutexpp6.c: New file.
3260         * tst-mutexpp10.c: New file.
3261         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
3262         * tst-mutex6.c (TEST_FUNCTION): Likewise.
3263
3264 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
3265
3266         [BZ #2843]
3267         * pthread_join.c (pthread_join): Account for self being canceled
3268         when checking for deadlocks.
3269         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
3270         (tf1): Don't print anything after pthread_join returns, this would be
3271         another cancellation point.
3272         (tf2): Likewise.
3273         * tst-join6.c: New file.
3274         * Makefile (tests): Add tst-join6.
3275
3276 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
3277
3278         [BZ #2892]
3279         * pthread_setspecific.c (__pthread_setspecific): Check
3280         out-of-range index before checking for unused key.
3281
3282         * sysdeps/pthread/gai_misc.h: New file.
3283
3284 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
3285
3286         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
3287         file.  Don't use sysctl.
3288         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
3289         overwrite the file if this is likely not true.
3290
3291 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
3292
3293         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
3294         * Makefile (tests): Add tst-getpid3.
3295         * tst-getpid3.c: New file.
3296
3297 2006-07-30  Roland McGrath  <roland@redhat.com>
3298
3299         * Makefile (libpthread-routines): Add ptw-sigsuspend.
3300
3301         * sysdeps/unix/sysv/linux/i386/not-cancel.h
3302         (pause_not_cancel): New macro.
3303         (nanosleep_not_cancel): New macro.
3304         (sigsuspend_not_cancel): New macro.
3305         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
3306         nanosleep_not_cancel macro from <not-cancel.h>.
3307         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
3308         macro from <not-cancel.h>.
3309
3310 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
3311             Jakub Jelinek  <jakub@redhat.com>
3312
3313         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
3314         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
3315         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
3316         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
3317         * pthread_mutex_init.c: Add support for priority inheritance mutex.
3318         * pthread_mutex_lock.c: Likewise.
3319         * pthread_mutex_timedlock.c: Likewise.
3320         * pthread_mutex_trylock.c: Likewise.
3321         * pthread_mutex_unlock.c: Likewise.
3322         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
3323         all mutexes.
3324         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
3325         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
3326         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
3327         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
3328         pthread-pi-defines.sym.
3329         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
3330         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
3331         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3332         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
3333         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3334         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3335         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3336         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
3337         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3338         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3339         _POSIX_THREAD_PRIO_INHERIT to 200112L.
3340         * tst-mutex1.c: Adjust to allow use in PI mutex test.
3341         * tst-mutex2.c: Likewise.
3342         * tst-mutex3.c: Likewise.
3343         * tst-mutex4.c: Likewise.
3344         * tst-mutex5.c: Likewise.
3345         * tst-mutex6.c: Likewise.
3346         * tst-mutex7.c: Likewise.
3347         * tst-mutex7a.c: Likewise.
3348         * tst-mutex8.c: Likewise.
3349         * tst-mutex9.c: Likewise.
3350         * tst-robust1.c: Likewise.
3351         * tst-robust7.c: Likewise.
3352         * tst-robust8.c: Likewise.
3353         * tst-mutexpi1.c: New file.
3354         * tst-mutexpi2.c: New file.
3355         * tst-mutexpi3.c: New file.
3356         * tst-mutexpi4.c: New file.
3357         * tst-mutexpi5.c: New file.
3358         * tst-mutexpi6.c: New file.
3359         * tst-mutexpi7.c: New file.
3360         * tst-mutexpi7a.c: New file.
3361         * tst-mutexpi8.c: New file.
3362         * tst-mutexpi9.c: New file.
3363         * tst-robust1.c: New file.
3364         * tst-robust2.c: New file.
3365         * tst-robust3.c: New file.
3366         * tst-robust4.c: New file.
3367         * tst-robust5.c: New file.
3368         * tst-robust6.c: New file.
3369         * tst-robust7.c: New file.
3370         * tst-robust8.c: New file.
3371         * Makefile (tests): Add the new tests.
3372
3373         * pthread_create.c (start_thread): Add some casts to avoid warnings.
3374         * pthread_mutex_destroy.c: Remove unneeded label.
3375
3376 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
3377
3378         * pthread_mutex_init.c (__pthread_mutex_init): Move some
3379         computations to compile time.
3380
3381 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
3382
3383         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
3384
3385 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
3386
3387         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
3388
3389 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
3390
3391         * pthread_key_create.c (__pthread_key_create): Do away with
3392         __pthread_keys_lock.
3393
3394         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3395         (__kernel_cpumask_size): Mark as hidden.
3396         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
3397
3398         * sem_open.c (__sem_mappings_lock): Mark as hidden.
3399         * semaphoreP.h (__sem_mappings_lock): Likewise.
3400
3401 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
3402
3403         * pthread_atfork.c: Mark __dso_handle as hidden.
3404
3405 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
3406
3407         [BZ #2644]
3408         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
3409         the reload problem.  Change the one path in pthread_cancel_init
3410         which causes the problem.  Force gcc to reload.  Simplify callers.
3411         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
3412         (_Unwind_GetBSP): Undo last patch.
3413
3414 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
3415
3416         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
3417         function pointer is reloaded after pthread_cancel_init calls.
3418
3419         [BZ #2644]
3420         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
3421         pointers are reloaded after pthread_cancel_init calls.
3422
3423 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
3424
3425         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
3426         __always_inline.
3427
3428 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
3429
3430         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3431         Allocate new object which is passed to timer_sigev_thread so that
3432         the timer can be deleted before the new thread is scheduled.
3433
3434 2006-04-26  Roland McGrath  <roland@redhat.com>
3435
3436         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
3437
3438 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
3439
3440         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
3441         suffix for conditional jumps.
3442         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3443         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3444         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3445         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3446         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3447         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3448
3449         * init.c (sigcancel_handler): Compare with correct PID even if the
3450         thread is in the middle of a fork call.
3451         (sighandler_setxid): Likewise.
3452         Reported by Suzuki K P <suzuki@in.ibm.com> .
3453
3454 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
3455
3456         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
3457
3458 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
3459
3460         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
3461         fails [Coverity CID 105].
3462
3463 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
3464
3465         * sysdeps/pthread/pthread.h: Add nonnull attributes.
3466
3467 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
3468
3469         [BZ #2505]
3470         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
3471         Define __lll_rel_instr using lwsync.
3472
3473 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
3474
3475         * allocatestack.c (allocate_stack): Always initialize robust_head.
3476         * descr.h: Define struct robust_list_head.
3477         (struct pthread): Use robust_list_head in robust mutex list definition.
3478         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
3479         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
3480         (__pthread_initialize_minimal_internal): Register robust_list with
3481         the kernel.
3482         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
3483         Declare __set_robust_list_avail.
3484         * pthread_create.c (start_thread): Register robust_list of new thread.
3485         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
3486         waiters.
3487         * pthread_mutex_destroy.c: For robust mutexes don't look at the
3488         number of users, it's unreliable.
3489         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
3490         set_robust_list syscall is available.
3491         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
3492         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
3493         Set robust_head.list_op_pending before trying to lock a robust mutex.
3494         * pthread_mutex_timedlock.c: Likewise.
3495         * pthread_mutex_trylock.c: Likewise.
3496         * pthread_mutex_unlock.c: Likewise for unlocking.
3497         * Makefile (tests): Add tst-robust8.
3498         * tst-robust8.c: New file.
3499
3500 2006-03-08  Andreas Schwab  <schwab@suse.de>
3501
3502         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
3503         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
3504
3505 2006-03-05  Roland McGrath  <roland@redhat.com>
3506
3507         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
3508         and $config_os doesn't match *linux*.
3509
3510 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
3511
3512         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
3513         Use __syscall_error.
3514         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3515         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
3516         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
3517         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3518         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
3519         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
3520
3521 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
3522
3523         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
3524
3525 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
3526
3527         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
3528         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
3529         mutex.
3530         (__lll_robust_timedlock_wait): Likewise.
3531         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
3532         (__lll_robust_lock_wait): Likewise.
3533         (__lll_robust_timedlock_wait): Likewise.
3534         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3535         (__lll_robust_lock_wait): Likewise.
3536         (__lll_robust_timedlock_wait): Likewise.
3537
3538 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
3539
3540         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
3541         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3542         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3543         lll_robust_mutex_unlock): Define.
3544         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3545
3546 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
3547
3548         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
3549         instead of <clone.S>.
3550
3551 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
3552
3553         * Makefile (libpthread-routines): Add
3554         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
3555         and pthread_mutex_[sg]etprioceiling.
3556         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
3557         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
3558         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
3559         pthread_mutex_setprioceiling.
3560         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
3561         PTHREAD_PRIO_PROTECT): New enum values.
3562         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
3563         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
3564         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
3565         prototypes.
3566         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
3567         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
3568         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
3569         Define.
3570         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
3571         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
3572         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
3573         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
3574         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
3575         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
3576         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
3577         protocol mutexes.
3578         * pthread_mutex_getprioceiling.c: New file.
3579         * pthread_mutex_setprioceiling.c: New file.
3580         * pthread_mutexattr_getprioceiling.c: New file.
3581         * pthread_mutexattr_setprioceiling.c: New file.
3582         * pthread_mutexattr_getprotocol.c: New file.
3583         * pthread_mutexattr_setprotocol.c: New file.
3584
3585 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
3586
3587         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
3588
3589 2006-02-27  Roland McGrath  <roland@redhat.com>
3590
3591         * sysdeps/pthread/Subdirs: List nptl here too.
3592         * configure (libc_add_on_canonical): New variable.
3593
3594         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
3595
3596         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
3597         self to get main source tree's file.
3598         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
3599         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
3600         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
3601         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
3602         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
3603         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
3604         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
3605         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
3606         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
3607         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
3608         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
3609         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
3610         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
3611
3612         * Makefile: Use $(sysdirs) in vpath directive.
3613
3614         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
3615         (CPPFLAGS-timer_routines.c): Likewise.
3616
3617         * Makeconfig (includes): Variable removed.
3618
3619 2006-02-26  Roland McGrath  <roland@redhat.com>
3620
3621         * sysdeps/generic/pt-raise.c: Moved to ...
3622         * pt-raise.c: ... here.
3623         * sysdeps/generic/lowlevellock.h: Moved to ...
3624         * lowlevellock.h: ... here.
3625
3626 2006-02-23  Roland McGrath  <roland@redhat.com>
3627
3628         * descr.h (struct pthread): Add final member `end_padding'.
3629         (PTHREAD_STRUCT_END_PADDING): Use it.
3630
3631 2006-02-20  Roland McGrath  <roland@redhat.com>
3632
3633         * sysdeps/mips: Directory removed, saved in ports repository.
3634         * sysdeps/unix/sysv/linux/mips: Likewise.
3635
3636 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
3637
3638         * tst-robust1.c: Add second mutex to check that the mutex list is
3639         handled correctly.
3640
3641 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
3642
3643         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
3644         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3645         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3646         lll_robust_mutex_unlock): New macros.
3647         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3648         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3649         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3650         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3651         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
3652
3653 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3654
3655         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
3656         definitions.
3657         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
3658
3659 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
3660
3661         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3662         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
3663         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3664         (lll_robust_mutex_unlock): Likewise.
3665
3666 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
3667
3668         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
3669         Set robust_list.__next rather than robust_list.
3670         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3671         (__pthread_list_t): New typedef.
3672         (pthread_mutex_t): Replace __next and __prev fields with __list.
3673         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3674         (__pthread_list_t): New typedef.
3675         (pthread_mutex_t): Replace __next and __prev fields with __list.
3676         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3677         (__pthread_list_t, __pthread_slist_t): New typedefs.
3678         (pthread_mutex_t): Replace __next and __prev fields with __list.
3679         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
3680         (__pthread_list_t, __pthread_slist_t): New typedefs.
3681         (pthread_mutex_t): Replace __next and __prev fields with __list.
3682         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
3683         (__pthread_list_t, __pthread_slist_t): New typedefs.
3684         (pthread_mutex_t): Replace __next and __prev fields with __list.
3685         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
3686         (__pthread_slist_t): New typedef.
3687         (pthread_mutex_t): Replace __next field with __list.
3688
3689 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
3690
3691         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
3692         PTHREAD_MUTEX_OWNERDEAD.
3693         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
3694         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
3695         * Makefile (libpthread-routines): Add lowlevelrobustlock.
3696         * pthread_create.c (start_thread): Very much simplify robust_list loop.
3697         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
3698         to PTHREAD_MUTEX_INCONSISTENT.
3699         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
3700         * pthread_mutex_lock.c: Reimplement robust mutex handling.
3701         * pthread_mutex_trylock.c: Likewise.
3702         * pthread_mutex_timedlock.c: Likewise.
3703         * pthread_mutex_unlock.c: Likewise.
3704         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
3705         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
3706         lowlevelrobustlock.sym.
3707         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
3708         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
3709         definitions.
3710         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3711         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
3712         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
3713         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
3714         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
3715
3716 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
3717
3718         * allocatestack.c (allocate_stack): Initialize robust_list.
3719         * init.c (__pthread_initialize_minimal_internal): Likewise.
3720         * descr.h (struct xid_command): Pretty printing.
3721         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
3722         robust_list.  Adjust macros.
3723         * pthread_create.c (start_thread): Adjust robust_list handling.
3724         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
3725         but the owner for all robust mutex types.
3726         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3727         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
3728         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3729         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
3730
3731         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
3732         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
3733
3734 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
3735
3736         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
3737         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
3738
3739 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3740
3741         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
3742         Return status.
3743         (lll_futex_timed_wait): Define.
3744
3745 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
3746
3747         * tst-cancel4.c: Test ppoll.
3748
3749 2006-01-18  Andreas Jaeger  <aj@suse.de>
3750
3751         [BZ #2167]
3752         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
3753         (pthread_mutex_t): Follow changes for other archs.  Based on patch
3754         by Jim Gifford <patches@jg555.com>.
3755
3756 2006-01-13  Richard Henderson  <rth@redhat.com>
3757
3758         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
3759
3760 2006-01-10  Roland McGrath  <roland@redhat.com>
3761
3762         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
3763         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3764         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3765         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3766         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3767         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3768         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3769         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3770         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3771         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3772
3773 2006-01-09  Roland McGrath  <roland@redhat.com>
3774
3775         * tst-initializers1-c89.c: New file.
3776         * tst-initializers1-c99.c: New file.
3777         * tst-initializers1-gnu89.c: New file.
3778         * tst-initializers1-gnu99.c: New file.
3779         * Makefile (tests): Add them.
3780         (CFLAGS-tst-initializers1-c89.c): New variable.
3781         (CFLAGS-tst-initializers1-c99.c): New variable.
3782         (CFLAGS-tst-initializers1-gnu89.c): New variable.
3783         (CFLAGS-tst-initializers1-gnu99.c): New variable.
3784
3785         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3786         Use __extension__ on anonymous union definition.
3787         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3788         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3789         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3790         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3791         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3792
3793 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
3794
3795         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3796         Don't give the union a name because it changes the mangled name.
3797         Instead name the struct for __data.
3798         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
3799         Likewise.
3800         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
3801         Likewise.
3802
3803 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
3804
3805         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
3806         stack bias to mc_ftp field.
3807
3808 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
3809
3810         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
3811         being too clever and reloading the futex value where it shouldn't.
3812
3813 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3814
3815         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
3816         correct type.
3817
3818 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
3819
3820         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3821         Add cfi directives.
3822
3823 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3824
3825         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
3826         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
3827         rename in tcbhead_t.
3828
3829         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3830         Don't give the union a name because it changes the mangled name.
3831         Instead name the struct for __data.
3832         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3833         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3834         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3835         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3836         * pthread_create.c (start_thread): Adjust robust mutex free loop.
3837         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
3838
3839 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
3840
3841         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3842         Return status.
3843         (lll_futex_timed_wait): Define.
3844         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3845         * sysdeps/pthread/aio_misc.h: New file.
3846
3847 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
3848
3849         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
3850
3851 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
3852
3853         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3854         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
3855         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3856
3857 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
3858
3859         * tst-cancel24.cc: Use C headers instead of C++ headers.
3860
3861 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
3862
3863         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
3864         sparc-linux configured glibc.
3865         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
3866         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
3867         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
3868         atomic_compare_and_exchange_val_24_acq instead of
3869         atomic_compare_and_exchange_val_acq.
3870         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
3871         instead of atomic_exchange_rel.
3872         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
3873         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
3874         file.
3875         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
3876         file.
3877         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
3878         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
3879         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
3880         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
3881         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
3882         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
3883         New file.
3884         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3885         New file.
3886         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
3887         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
3888         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
3889         file.
3890         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
3891         file.
3892         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
3893
3894 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
3895
3896         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
3897         mutex initializers.
3898
3899 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3900
3901         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3902         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3903         THREAD_COPY_POINTER_GUARD): Define.
3904         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3905         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3906
3907 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3908
3909         * version.c: Update copyright year.
3910
3911 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3912
3913         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3914         .eh_frame section, use cfi_* directives.
3915         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3916
3917 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3918
3919         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3920         now.
3921
3922 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3923
3924         * sysdeps/pthread/sigaction.c: Removed.
3925         * sigaction.c: New file.
3926         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3927
3928 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3929
3930         * Makefile (tests): Add tst-signal7.
3931         * tst-signal7.c: New file.
3932
3933 2005-12-27  Roland McGrath  <roland@redhat.com>
3934
3935         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3936         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3937         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3938         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3939         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3940         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3941         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3942         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3943         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3944         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3945         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3946
3947 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3948
3949         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3950         and __prev field to pthread_mutex_t.
3951         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3952         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3953         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3954         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3955         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3956         to pthread_mutex_t.
3957
3958 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3959
3960         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3961         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3962         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3963         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3964         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3965         and PTHREAD_MUTEXATTR_FLAG_BITS.
3966         * descr.h (struct pthread): Add robust_list field and define
3967         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3968         * pthread_mutexattr_getrobust.c: New file.
3969         * pthread_mutexattr_setrobust.c: New file.
3970         * pthread_mutex_consistent.c: New file.
3971         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3972         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3973         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3974         Adjust pthread_mutex_t initializers.
3975         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3976         field to pthread_mutex_t.
3977         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3978         and __prev field to pthread_mutex_t.
3979         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3980         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3981         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3982         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3983         * pthread_mutexattr_gettype.c: Likewise.
3984         * pthread_mutexattr_setpshared.c: Likewise.
3985         * pthread_mutexattr_settype.c: Likewise.
3986         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3987         Initialize mutex kind according to robust flag.
3988         * pthread_mutex_lock.c: Implement local robust mutex.
3989         * pthread_mutex_timedlock.c: Likewise.
3990         * pthread_mutex_trylock.c: Likewise.
3991         * pthread_mutex_unlock.c: Likewise.
3992         * pthread_create.c (start_thread): Mark robust mutexes which remained
3993         locked as dead.
3994         * tst-robust1.c: New file.
3995         * tst-robust2.c: New file.
3996         * tst-robust3.c: New file.
3997         * tst-robust4.c: New file.
3998         * tst-robust5.c: New file.
3999         * tst-robust6.c: New file.
4000         * tst-robust7.c: New file.
4001         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
4002         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
4003         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
4004         tst-robust5, tst-robust6, and tst-robust7.
4005
4006         * tst-typesizes.c: New file.
4007         * Makefile (tests): Add tst-typesizes.
4008
4009         * tst-once3.c: More debug output.
4010
4011 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
4012
4013         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
4014         missing after last change.
4015
4016         * version.c: Update copyright year.
4017
4018 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
4019
4020         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
4021         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
4022         * pthread_mutex_trylock.c: Likewise.
4023         * pthread_mutex_timedlock.c: Likewise.
4024         * pthread_mutex_unlock.c: Likewise.
4025
4026 2005-12-22  Roland McGrath  <roland@redhat.com>
4027
4028         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
4029         so that #include_next's search location is not reset to the -I..
4030         directory where <nptl/...> can be found.
4031
4032 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
4033
4034         [BZ #1913]
4035         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4036         Fix unwind info.  Remove useless branch prediction prefix.
4037         * tst-cancel24.cc: New file.
4038         * Makefile: Add rules to build and run tst-cancel24.
4039
4040 2005-12-21  Roland McGrath  <roland@redhat.com>
4041
4042         * libc-cancellation.c: Use <> rather than "" #includes.
4043         * pt-cleanup.c: Likewise.
4044         * pthread_create.c: Likewise.
4045         * pthread_join.c: Likewise.
4046         * pthread_timedjoin.c: Likewise.
4047         * pthread_tryjoin.c: Likewise.
4048         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
4049         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
4050         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
4051         * unwind.c: Likewise.
4052
4053 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4054
4055         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
4056         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
4057         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
4058         THREAD_COPY_POINTER_GUARD): Define.
4059
4060 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
4061
4062         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
4063         rather than one.
4064         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
4065         THREAD_COPY_POINTER_GUARD): Define.
4066         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
4067         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
4068         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
4069         THREAD_COPY_POINTER_GUARD): Define.
4070         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
4071         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
4072         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
4073         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
4074         Use PTR_DEMANGLE for B0 if defined.
4075
4076 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
4077
4078         * pthread_create.c (__pthread_create_2_1): Use
4079         THREAD_COPY_POINTER_GUARD if available.
4080         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
4081         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4082         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
4083         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
4084         * sysdeps/x86_64/tls.h: Likewise.
4085
4086 2005-12-15  Roland McGrath  <roland@redhat.com>
4087
4088         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
4089
4090 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
4091
4092         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
4093         sysdeps/generic.
4094         * errno-loc.c: New file.
4095
4096 2005-12-12  Roland McGrath  <roland@redhat.com>
4097
4098         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
4099         adjustments before choosing stack size.  Update minimum stack size
4100         calculation to match allocate_stack change.
4101
4102 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
4103
4104         * allocatestack.c (allocate_stack): Don't demand that there is an
4105         additional full page available on the stack beside guard, TLS, the
4106         minimum stack.
4107
4108 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
4109
4110         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
4111         (__cleanup_fct_attribute): Use __regparm__ not regparm.
4112
4113         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
4114         compiling 32-bit code we must define __cleanup_fct_attribute.
4115
4116 005-11-24  Jakub Jelinek  <jakub@redhat.com>
4117
4118         [BZ #1920]
4119         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
4120         __attribute__ instead of __attribute.
4121         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
4122         (__cleanup_fct_attribute): Likewise.
4123
4124 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
4125
4126         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
4127         a write barrier before writing libgcc_s_getcfa.
4128
4129 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
4130
4131         * sysdeps/unix/sysv/linux/configure: Removed.
4132
4133 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
4134
4135         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
4136         optional init_array/fini_array support.
4137
4138 2005-10-24  Roland McGrath  <roland@redhat.com>
4139
4140         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
4141         versioned_symbol use.
4142
4143 2005-10-16  Roland McGrath  <roland@redhat.com>
4144
4145         * init.c (__pthread_initialize_minimal_internal): Even when using a
4146         compile-time default stack size, apply the minimum that allocate_stack
4147         will require, and round up to page size.
4148
4149 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
4150
4151         * Makefile ($(test-modules)): Remove static pattern rule.
4152
4153 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
4154             Ulrich Drepper  <drepper@redhat.com>
4155
4156         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
4157         alignment in callback function.
4158         * Makefile: Add rules to build and run tst-align3.
4159         * tst-align3.c: New file.
4160
4161 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
4162
4163         * allocatestack.c (setxid_signal_thread): Add
4164         INTERNAL_SYSCALL_DECL (err).
4165
4166 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
4167
4168         * allocatestack.c (setxid_signal_thread): Need to use
4169         atomic_compare_and_exchange_bool_acq.
4170
4171 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
4172             Jakub Jelinek  <jakub@redhat.com>
4173
4174         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
4175         CANCEL_RESTMASK.
4176         (struct pthread): Move specific_used field to avoid padding.
4177         Add setxid_futex field.
4178         * init.c (sighandler_setxid): Reset setxid flag and release the
4179         setxid futex.
4180         * allocatestack.c (setxid_signal_thread): New function.  Broken
4181         out of the bodies of the two loops in __nptl_setxid.  For undetached
4182         threads check whether they are exiting and if yes, don't send a signal.
4183         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
4184         * pthread_create.c (start_thread): For undetached threads, check
4185         whether setxid bit is set.  If yes, wait until signal has been
4186         processed.
4187
4188         * allocatestack.c (STACK_VARIABLES): Initialize them.
4189         * pthread_create.c (__pthread_create_2_1): Initialize pd.
4190
4191 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
4192
4193         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
4194         waiters, awake all waiters on the associated mutex.
4195
4196 2005-09-22  Roland McGrath  <roland@redhat.com>
4197
4198         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
4199         ../sysdeps/x86_64/hp-timing.h).
4200
4201 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
4202
4203         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
4204         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4205         (lll_futex_wake_unlock): Define.
4206         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
4207         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4208         (lll_futex_wake_unlock): Define.
4209         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
4210         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4211         (lll_futex_wake_unlock): Define.
4212         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
4213         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4214         (lll_futex_wake_unlock): Define.
4215         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
4216         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4217         (lll_futex_wake_unlock): Define.
4218         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
4219         lll_futex_wake_unlock.
4220         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4221         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4222         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
4223         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4224         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4225         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
4226
4227 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4228
4229         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4230         Fix typo in register name.
4231
4232 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
4233
4234         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4235         Use __sigfillset.  Document that sigfillset does the right thing wrt
4236         to SIGSETXID.
4237
4238 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
4239
4240         [BZ #1102]
4241         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
4242         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
4243         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
4244         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
4245         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
4246         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
4247         in the structure.
4248         * Makefile (tests): Add tst-initializers1.
4249         (CFLAGS-tst-initializers1.c): Set.
4250         * tst-initializers1.c: New test.
4251
4252 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
4253
4254         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
4255         Make sure __flags are located at offset 48 from the start of the
4256         structure.
4257
4258 2005-07-02  Roland McGrath  <roland@redhat.com>
4259
4260         * Makeconfig: Comment fix.
4261
4262 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
4263
4264         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
4265         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
4266         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
4267         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
4268         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
4269         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4270         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
4271         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
4272         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
4273         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
4274
4275 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
4276
4277         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
4278         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4279         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
4280         fields.
4281         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4282         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
4283         field.  Put in sysinfo field unconditionally.
4284         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4285         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
4286         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4287         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
4288         fields.
4289         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4290         * pthread_create.c (__pthread_create_2_1): Use
4291         THREAD_COPY_STACK_GUARD macro.
4292         * Makefile: Add rules to build and run tst-stackguard1{,-static}
4293         tests.
4294         * tst-stackguard1.c: New file.
4295         * tst-stackguard1-static.c: New file.
4296
4297 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
4298
4299         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
4300         Invoke CGOTSETUP and CGOTRESTORE.
4301         (CGOTSETUP, CGOTRESTORE): Define.
4302
4303 2005-05-29  Richard Henderson  <rth@redhat.com>
4304
4305         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
4306         (tf_write, tf_writev): Use it.
4307         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
4308         the system minimum.
4309
4310 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
4311
4312         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
4313         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
4314         __librt_*_asynccancel@local.
4315
4316 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
4317
4318         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
4319         all occurrences of JUMPTARGET.  Instead append @local to labels.
4320
4321 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
4322
4323         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
4324         size/alignment of struct pthread rather than tcbhead_t.
4325         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4326         Likewise.
4327         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4328         Likewise.
4329         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4330         Likewise.
4331
4332 2005-05-19  Richard Henderson  <rth@redhat.com>
4333
4334         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
4335         __sync_val_compare_and_swap, not explicit _si variant.
4336         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
4337
4338 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
4339
4340         [BZ #915]
4341         * sysdeps/pthread/pthread.h: Avoid empty initializers.
4342
4343 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
4344
4345         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
4346         .eh_frame section, use cfi_* directives.
4347
4348 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
4349
4350         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
4351         of "" includes.
4352
4353 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
4354
4355         [BZ #1075]
4356         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
4357         aio_write blocks.
4358
4359 2005-04-27  Roland McGrath  <roland@redhat.com>
4360
4361         * Makefile (tests): Remove tst-clock2.
4362
4363         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
4364         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
4365         translating to the kernel clockid_t for our own process/thread clock.
4366
4367         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
4368
4369 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
4370
4371         * old_pthread_cond_init.c: Include <errno.h>.
4372         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
4373         process shared or uses clock other than CLOCK_REALTIME.
4374         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
4375
4376 2005-04-13  David S. Miller  <davem@davemloft.net>
4377
4378         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
4379         * sysdeps/sparc/sparc64/clone.S: New file.
4380
4381 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
4382
4383         [BZ #1102]
4384         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
4385         __inline instead of inline.
4386         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
4387
4388 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
4389
4390         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
4391         functionally equivalent, but shorter instructions.
4392         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4393         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4394         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4395         Likewise.
4396         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
4397         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4398         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4399         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4400         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4401         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4402         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4403         Likewise.
4404         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4405         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4406         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4407         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4408         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4409
4410 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
4411
4412         * sysdeps/mips/Makefile: New file.
4413         * sysdeps/mips/nptl-sysdep.S: New file.
4414         * sysdeps/mips/tcb-offsets.sym: New file.
4415         * sysdeps/mips/pthread_spin_lock.S: New file.
4416         * sysdeps/mips/pthread_spin_trylock.S: New file.
4417         * sysdeps/mips/pthreaddef.h: New file.
4418         * sysdeps/mips/tls.h: New file.
4419         * sysdeps/mips/jmpbuf-unwind.h: New file.
4420         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
4421         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
4422         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
4423         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
4424         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
4425         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
4426         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
4427         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
4428         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
4429         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
4430
4431 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
4432
4433         [BZ #1112]
4434         * pthread_create.c (__pthread_create_2_1): Rename syscall error
4435         variable to scerr.
4436
4437 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
4438
4439         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
4440
4441 2005-02-25  Roland McGrath  <roland@redhat.com>
4442
4443         * alloca_cutoff.c: Correct license text.
4444         * tst-unload.c: Likewise.
4445         * sysdeps/pthread/allocalim.h: Likewise.
4446         * sysdeps/pthread/pt-initfini.c: Likewise.
4447         * sysdeps/pthread/bits/libc-lock.h: Likewise.
4448         * sysdeps/pthread/bits/sigthread.h: Likewise.
4449         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
4450         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4451
4452 2005-02-16  Roland McGrath  <roland@redhat.com>
4453
4454         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4455         Use unsigned int * for ptr_nthreads.
4456
4457 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
4458
4459         [BZ #721]
4460         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
4461         gcc4.
4462
4463 2005-02-07  Richard Henderson  <rth@redhat.com>
4464
4465         [BZ #787]
4466         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
4467         argument.
4468
4469 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
4470
4471         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
4472         order of arguments in invocation of atomic_add_zero.
4473
4474 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
4475
4476         [BZ #737]
4477         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
4478         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
4479         at least gotntpoff relocation and addition.
4480         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
4481         Likewise.
4482         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4483         Likewise.
4484         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4485         Likewise.
4486
4487 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
4488
4489         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
4490         entry for static tls deallocation fix.
4491         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
4492         also contains information whether the memory pointed to is static
4493         TLS or not.
4494         * sysdeps/i386/tls.h: Likewise.
4495         * sysdeps/ia64/tls.h: Likewise.
4496         * sysdeps/powerpc/tls.h: Likewise.
4497         * sysdeps/s390/tls.h: Likewise.
4498         * sysdeps/sh/tls.h: Likewise.
4499         * sysdeps/sparc/tls.h: Likewise.
4500         * sysdeps/x86_64/tls.h: Likewise.
4501
4502 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
4503
4504         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
4505
4506 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
4507
4508         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
4509         %esp.
4510         * Makefile (tests): Add tst-align2.
4511         * tst-align2.c: New test.
4512         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
4513         -mpreferred-stack-boundary=4.
4514
4515 2004-12-18  Roland McGrath  <roland@redhat.com>
4516
4517         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
4518         New file removed withdrawn for the moment.
4519
4520 2004-12-17  Richard Henderson  <rth@redhat.com>
4521
4522         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
4523         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
4524
4525 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
4526
4527         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
4528         Increased PTHREAD_STACK_MIN.
4529
4530         * tst-context1.c (stacks): Use bigger stack size.
4531
4532 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
4533
4534         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
4535         * sysdeps/sparc/tcb-offsets.sym: Add TID.
4536
4537 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
4538
4539         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
4540         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
4541         * sysdeps/s390/tcb-offsets.sym (TID): Add.
4542
4543 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
4544
4545         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
4546
4547 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
4548
4549         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
4550         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
4551
4552         * tst-getpid1.c: If child crashes, report this first.  Print which
4553         signal.
4554
4555 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
4556
4557         * init.c (__pthread_initialize_minimal_internal): Also unblock
4558         SIGSETXID.
4559
4560 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4561
4562         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
4563         _POSIX_THREAD_CPUTIME): Define to 0.
4564         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
4565         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
4566         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
4567         __timer_signal_thread_tclk): Remove.
4568         (init_module): Remove their initialization.
4569         (thread_cleanup): Remove their cleanup assertions.
4570         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
4571         __timer_signal_thread_tclk): Remove.
4572         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
4573         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
4574         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
4575
4576 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
4577
4578         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
4579         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
4580
4581         * Makefile (tests): Add tst-getpid2.
4582         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
4583         (do_test): Use it.  Use __clone2 instead of clone on ia64.
4584         * tst-getpid2.c: New test.
4585
4586 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4587
4588         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
4589
4590 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
4591
4592         * Makefile (tests): Add tst-getpid1.
4593         * tst-getpid1.c: New file.
4594         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
4595         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
4596
4597 2004-12-02  Roland McGrath  <roland@redhat.com>
4598
4599         * Makefile (libpthread-nonshared): Variable removed.
4600         ($(objpfx)libpthread_nonshared.a): Target removed.
4601         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
4602         These are now handled by generic magic from
4603         libpthread-static-only-routines being set.
4604
4605 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
4606
4607         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
4608         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
4609         _POSIX_THREAD_PRIO_PROTECT): Define.
4610         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4611         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4612         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4613
4614 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
4615
4616         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
4617         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
4618         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
4619         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
4620         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4621         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4622         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4623
4624 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
4625
4626         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
4627
4628         * Makefile (libpthread-routines): Add pthread_setschedprio.
4629         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
4630         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
4631         * pthread_setschedprio.c: New file.
4632
4633 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
4634
4635         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
4636         * pthread_cancel.c (pthread_create): Likewise.
4637
4638         * Makefile (libpthread-routines): Add vars.
4639         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
4640         * init.c (__default_stacksize, __is_smp): Remove.
4641         * vars.c: New file.
4642         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
4643         and define a wrapper macro.
4644         (PTHREAD_STATIC_FN_REQUIRE): Define.
4645         * allocatestack.c (__find_thread_by_id): Undefine.
4646         * pthread_create (__pthread_keys): Remove.
4647         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
4648         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
4649         PTHREAD_STATIC_FN_REQUIRE.
4650
4651 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4652
4653         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
4654         parameter to REGISTER macro.
4655
4656 2004-11-17  Roland McGrath  <roland@redhat.com>
4657
4658         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
4659         Make sure SIGCANCEL is blocked as well.
4660
4661 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4662
4663         * sysdeps/pthread/setxid.h: New file.
4664         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
4665         (struct xid_command): Add forward decl.
4666         (struct pthread_functions): Change return type of __nptl_setxid hook
4667         to int.
4668         * pthreadP.h (__nptl_setxid): Change return type to int.
4669         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
4670         calling thread, return its return value and set errno on failure.
4671         * descr.h (struct xid_command): Change id type to long array.
4672
4673         * Makefile: Add rules to build and test tst-setuid1 and
4674         tst-setuid1-static.
4675         * tst-setuid1.c: New test.
4676         * tst-setuid1-static.c: New test.
4677
4678 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4679
4680         * Makefile (tests): Add tst-exit3.
4681         * tst-exit3.c: New test.
4682
4683 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
4684
4685         * Makefile (tests): Add tst-exit2.
4686         * tst-exit2.c: New file.
4687
4688 2004-11-09  Roland McGrath  <roland@redhat.com>
4689
4690         [BZ #530]
4691         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
4692         here, before calling clone.
4693         * pthread_create.c (start_thread): Don't do it here.
4694
4695 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
4696
4697         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
4698
4699 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
4700
4701         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4702         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
4703         assembler warning.
4704
4705 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
4706
4707         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
4708         if sched_priority is not between minprio and maxprio.
4709
4710 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4711
4712         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4713         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
4714
4715         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4716         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
4717
4718 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
4719
4720         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
4721         not-cancelable I/O functions.
4722
4723 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4724
4725         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4726         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4727         make sure 2 is stored in the futex and we looked at the old value.
4728         Fix a few other problems to return the correct value.
4729
4730 2004-10-14  Richard Henderson  <rth@redhat.com>
4731
4732         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
4733         make gcc4 happy.
4734
4735 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
4736
4737         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
4738         of pthread-functions.h and pthreaddef.h.
4739         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
4740
4741         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4742         Change __data.__nwaiters from int to unsigned int.
4743
4744         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
4745         sysconf (_SC_THREAD_CPUTIME) returns negative value.
4746
4747         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
4748         before return type.
4749
4750         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
4751         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
4752
4753 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
4754
4755         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
4756         test fails, remove message queue.
4757         (tf_msgsnd): Likewise.
4758
4759 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4760
4761         * tst-clock1.c: Change #ifdef to #if defined.
4762         * tst-clock2.c: Likewise.
4763         * tst-cond11.c: Likewise.
4764
4765         * sysdeps/pthread/timer_create.c (timer_create): Use
4766         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
4767         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
4768         THREAD_CPUTIME.
4769
4770 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4771
4772         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
4773         _POSIX_THREAD_CPUTIME): Define to 0.
4774
4775 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
4776
4777         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
4778         and _POSIX_THREAD_CPUTIME to zero.
4779         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4780         * tst-barrier2.c: Fix testing for POSIX feature.
4781         * tst-clock1.c: Likewise.
4782         * tst-clock2.c: Likewise.
4783         * tst-cond11.c: Likewise.
4784         * tst-cond4.c: Likewise.
4785         * tst-cond6.c: Likewise.
4786         * tst-flock2.c: Likewise.
4787         * tst-mutex4.c: Likewise.
4788         * tst-mutex9.c: Likewise.
4789         * tst-rwlock12.c: Likewise.
4790         * tst-rwlock4.c: Likewise.
4791         * tst-signal1.c: Likewise.
4792         * tst-spin2.c: Likewise.
4793         * sysdeps/pthread/posix-timer.h: Likewise.
4794         * sysdeps/pthread/timer_create.c: Likewise.
4795         * sysdeps/pthread/timer_routines.c: Likewise.
4796
4797 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
4798
4799         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4800         (__lll_mutex_timedlock_wait): Address futex correctly.
4801
4802         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4803         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4804         make sure 2 is stored in the futex and we looked at the old value.
4805         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4806         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
4807         which might very well made the code not working at all before.
4808         [BZ #417]
4809
4810 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
4811
4812         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4813         allow SIGSETXID to be sent.
4814         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
4815         for SIGSETXID to be defined.
4816         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4817         SIGSETXID cannot be blocked.
4818
4819         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4820         Add __extension__ to long long types.
4821         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4822         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4823         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4824         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4825         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4826         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4827         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4828
4829 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4830
4831         * descr.h (struct pthread): Add stopped_start field.
4832         * sysdeps/pthread/createthread.c (create_thread): Set
4833         start_stopped flag in descriptor for new thread appropriately.
4834         * pthread_create.c (start_thread): Only take lock to be stopped on
4835         startup if stopped_start flag says so.
4836
4837 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
4838
4839         * pthread_create.c (__pthread_create_2_1): Remember whether thread
4840         is created detached and if yes, do not try to free the stack in case
4841         the thread creation failed.
4842         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
4843         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
4844         case there has been no error.  [BZ #405]
4845
4846         * pthread_create.c (start_thread): Don't wait for scheduler data
4847         etc to be set at the beginning of the function.  The cancellation
4848         infrastructure must have been set up.  And enable async
4849         cancellation before potentially going to sleep.  [BZ #401]
4850
4851 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
4852
4853         * Versions: Remove exports for pthread_set*id_np functions.
4854         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
4855         for now.
4856         * Makefile: Don't build pthread_set*id code for now.
4857
4858 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
4859
4860         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
4861         internal use.
4862         * allocatestack.c (__nptl_setxid): New function.
4863         * descr.h (struct xid_command): Define type.
4864         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
4865         (sighandler_setxid): New function.
4866         (__pthread_initialize_minimal): Register sighandler_setxid for
4867         SIGCANCEL.
4868         * pt-allocrtsig.c: Update comment.
4869         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
4870         Declare __nptl_setxid.
4871         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
4872         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
4873         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4874         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4875         and pthread_setresuid_np.
4876         * pthread_setgid_np.c: New file.
4877         * pthread_setuid_np.c: New file.
4878         * pthread_setegid_np.c: New file.
4879         * pthread_seteuid_np.c: New file.
4880         * pthread_setregid_np.c: New file.
4881         * pthread_setreuid_np.c: New file.
4882         * pthread_setresgid_np.c: New file.
4883         * pthread_setresuid_np.c: New file.
4884         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
4885         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4886         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4887         and pthread_setresuid_np.
4888         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
4889         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
4890         pthread_setregid, and pthread_setresgid.
4891
4892 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
4893
4894         * allocatestack.c (allocate_stack): Return EAGAIN instead of
4895         ENOMEM when out of memory.
4896
4897 2004-09-10  Roland McGrath  <roland@redhat.com>
4898
4899         [BZ #379]
4900         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4901         code, since we don't try to use the broken CLONE_STOPPED any more.
4902         * pthread_create.c (start_thread): Likewise.
4903
4904 2004-09-15  Richard Henderson  <rth@redhat.com>
4905
4906         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4907
4908 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4909
4910         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4911         (__libc_unwind_longjmp): Delete macro and declare as function.
4912         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4913         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4914         nptl directory.
4915         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4916         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4917         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4918
4919 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4920
4921         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4922         for __USE_XOPEN2K.
4923         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4924         types also for __USE_XOPEN2K.
4925         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4926         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4927         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4928         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4929         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4930         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4931         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4932         [BZ #320]
4933
4934 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4935
4936         * sysdeps/pthread/pthread.h
4937         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4938         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4939         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4940         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4941         [BZ #375]
4942
4943 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4944
4945         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4946         PSEUDO to be used with . prefix.
4947
4948         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4949         Use atomic_increment instead of atomic_exchange_and_add.
4950         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4951         Likewise.
4952         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4953         Likewise.
4954         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4955         Likewise.
4956
4957         * allocatestack.c (allocate_stack): Use atomic_increment_val
4958         instead of atomic_exchange_and_add.
4959         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4960         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4961         Likewise.
4962         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4963         Likewise.
4964
4965         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4966         the initialization function might throw.
4967
4968 2005-09-05  Richard Henderson  <rth@redhat.com>
4969
4970         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4971         Move definition inside libpthread, libc, librt check.  Provide
4972         definition for rtld.
4973
4974 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4975
4976         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4977         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4978         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4979         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4980         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4981         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4982         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4983         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4984         * unwind.c: Use it.
4985
4986         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4987         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4988         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4989         Likewise.
4990         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4991         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4992         this is the last waiter, signal pthread_cond_destroy caller and
4993         avoid using the pthread_cond_t structure after unlock.
4994         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4995         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4996         Read clock type from the least significant bits of __nwaiters instead
4997         of __clock.
4998         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4999         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
5000
5001 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
5002
5003         [BZ #342]
5004         * Makefile (tests): Add tst-cond20 and tst-cond21.
5005         * tst-cond20.c: New test.
5006         * tst-cond21.c: New test.
5007         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
5008         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
5009         it unsigned int.
5010         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
5011         Likewise.
5012         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
5013         (pthread_cond_t): Likewise.
5014         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
5015         Likewise.
5016         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5017         Likewise.
5018         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
5019         Likewise.
5020         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
5021         (cond_nwaiters): New.
5022         (clock_bits): New.
5023         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
5024         if there are waiters not signalled yet.
5025         Wait until all already signalled waiters wake up.
5026         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
5027         __nwaiters.  If pthread_cond_destroy has been called and this is the
5028         last waiter, signal pthread_cond_destroy caller and avoid using
5029         the pthread_cond_t structure after unlock.
5030         (__pthread_cond_wait): Increment __nwaiters in the beginning,
5031         decrement it when leaving.  If pthread_cond_destroy has been called
5032         and this is the last waiter, signal pthread_cond_destroy caller.
5033         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5034         Likewise.  Read clock type from the least significant bits of
5035         __nwaiters instead of __clock.
5036         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
5037         whether clock ID can be encoded in COND_CLOCK_BITS bits.
5038         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
5039         clock type just from the last COND_CLOCK_BITS bits of value.
5040         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
5041         instead of __clock, just from second bit of condattr's value.
5042
5043 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
5044
5045         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
5046         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
5047         != 64.
5048         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5049
5050 2004-08-15  Roland McGrath  <roland@frob.com>
5051
5052         * pthread_atfork.c: Update copyright terms including special exception
5053         for these trivial files, which are statically linked into executables
5054         that use dynamic linking for the significant library code.
5055
5056 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
5057
5058         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
5059         pthread_rwlock_rdlock.
5060         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
5061         Decrease __nr_readers_queued after reacquiring lock.
5062         * sysdeps/pthread/pthread_rwlock_timedrdlock
5063         (pthread_rwlock_timedrdlock): Likewise.
5064         Reported by Bob Cook <bobcook47@hotmail.com>.
5065
5066 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
5067
5068         * tst-rwlock14.c (tf): Read main thread handle from *ARG
5069         before pthread_barrier_wait.
5070
5071 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
5072
5073         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
5074         Remove unnecessary exception handling data.
5075
5076 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
5077
5078         [BZ #284]
5079         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
5080         instead of clockid_t.
5081
5082 2004-07-21  Roland McGrath  <roland@redhat.com>
5083
5084         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
5085
5086 2004-07-19  Roland McGrath  <roland@redhat.com>
5087
5088         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
5089
5090 2004-07-02  Roland McGrath  <roland@redhat.com>
5091
5092         * configure: Don't exit.
5093
5094 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5095
5096         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
5097         (__pthread_cond_timedwait): Check for invalid nanosecond in
5098         timeout value.
5099
5100 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
5101
5102         * Makefile: Add rules to build and run tst-fini1.
5103         * tst-fini1.c: New file.
5104         * tst-fini1mod.c: New file.
5105
5106 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
5107
5108         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
5109         if no cancellation support is needed.
5110         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
5111         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
5112         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
5113         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
5114         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
5115         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
5116         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
5117         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
5118         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
5119
5120         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
5121         only if not already defined.
5122
5123 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
5124
5125         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
5126         constraint "m" instead of "0" for futex.
5127
5128         * shlib-versions: Add powerpc64-.*-linux.*.
5129
5130 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
5131
5132         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
5133         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
5134         for valid tv_nsec.
5135         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
5136         1 billion and 64-bit tv_nsec which is valid when truncated to 32
5137         bits.
5138
5139 2004-06-29  Roland McGrath  <roland@redhat.com>
5140
5141         * Banner: NPTL no longer has its own version number.
5142         * Makefile (nptl-version): Variable removed.
5143         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
5144         using $(version), the glibc version number.
5145
5146 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5147
5148         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5149         Fix branch offset for a PLT entry.
5150         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
5151         Likewise.
5152         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
5153         Likewise.
5154         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
5155         Likewise.
5156         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
5157         Likewise.
5158
5159 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
5160
5161         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
5162         unconditionally.
5163
5164 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
5165
5166         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
5167         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
5168         instead of tv_sec.
5169         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
5170         (pthread_rwlock_timedrdlock): Likewise.
5171
5172 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
5173
5174         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
5175         Set __r7 to val, not mutex.
5176
5177 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
5178
5179         * Makefile: Add rules to build tst-rwlock14.
5180         * tst-rwlock14.c: New file.
5181
5182 2004-06-24  Boris Hu  <boris.hu@intel.com>
5183
5184         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
5185         check.
5186         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
5187
5188 2004-06-19  Andreas Jaeger  <aj@suse.de>
5189
5190         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
5191         assembler in last patch.
5192
5193 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
5194
5195         * sysdeps/pthread/pthread_cond_timedwait.c
5196         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
5197         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5198         (__pthread_cond_timedwait): Check for invalid nanosecond in
5199         timeout value.
5200         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5201         * tst-cond19.c: New file.
5202         * Makefile: Add rules to build and run tst-cond19.
5203
5204 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
5205
5206         * tst-context1.c (GUARD_PATTERN): Defined.
5207         (tst_context_t): Define struct containing ucontext_t & guard words.
5208         (ctx): Declare as an array of tst_context_t.
5209         (fct): Verify uc_link & guard words are still valid.
5210         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
5211
5212 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5213
5214         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5215         Add __data.__futex field, reshuffle __data.__clock.
5216         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
5217         (__pthread_cond_signal): Increment __futex at the same time as
5218         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5219         address of low 32-bits of __wakeup_seq to futex syscall.
5220         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5221         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5222         releasing internal lock to FUTEX_WAIT.
5223         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
5224         (__pthread_cond_timedwait): Likewise.
5225         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5226         (FUTEX_CMP_REQUEUE): Define.
5227         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5228         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5229         Pass __futex value from before the unlock and __futex address instead
5230         of address of low 32-bits of __wakeup_seq to futex syscall.
5231         Fallback to FUTEX_WAKE all on any errors.
5232
5233 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
5234
5235         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
5236         comment typo.
5237         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
5238         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
5239         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
5240         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
5241         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
5242
5243 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5244
5245         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
5246         Add memory clobber to inline assembly.
5247         (__lll_mutex_trylock): Likewise.
5248         (__lll_mutex_cond_trylock): Likewise.
5249
5250 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5251
5252         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
5253         Pass val argument as 6th system call argument in %r7.
5254
5255 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5256
5257         * Makefile (tests): Add tst-cond16.
5258         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
5259         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
5260         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5261         Add __data.__futex field, reshuffle __data.__clock.
5262         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
5263         (__pthread_cond_signal): Increment __futex at the same time as
5264         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5265         address of low 32-bits of __wakeup_seq to futex syscall.
5266         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
5267         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5268         releasing internal lock to FUTEX_WAIT.
5269         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
5270         (__pthread_cond_timedwait): Likewise.
5271         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
5272         (FUTEX_CMP_REQUEUE): Define.
5273         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5274         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5275         Pass __futex value from before the unlock and __futex address instead
5276         of address of low 32-bits of __wakeup_seq to futex syscall.
5277         Fallback to FUTEX_WAKE all on any errors.
5278         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
5279         Define.
5280         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5281         internally.  Return non-zero if error, zero if success.
5282         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5283         Add __data.__futex field, reshuffle __data.__clock.
5284         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
5285         Define.
5286         (lll_futex_requeue): Add val argument, return 1 unconditionally
5287         for the time being.
5288         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
5289         Add __data.__futex field, reshuffle __data.__clock.
5290         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
5291         Define.
5292         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5293         internally.  Return non-zero if error, zero if success.
5294         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
5295         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
5296         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
5297         Define.
5298         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5299         internally.  Return non-zero if error, zero if success.
5300         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
5301         Add __data.__futex field, reshuffle __data.__clock.
5302         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
5303         Define.
5304         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5305         internally.  Return non-zero if error, zero if success.
5306         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
5307         Add __data.__futex field, reshuffle __data.__clock.
5308         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
5309         Add __data.__futex field, reshuffle __data.__clock.
5310         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
5311         Increment __futex at the same time as __wakeup_seq or __total_seq.
5312         Pass address of __futex instead of address of low 32-bits of
5313         __wakeup_seq to futex syscall.
5314         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5315         Pass __futex value from before releasing internal lock
5316         to FUTEX_WAIT.
5317         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5318         Likewise.  Avoid unnecessary shadowing of variables.
5319         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
5320         Set __futex to 2 * __total_seq.  Pass __futex value from before the
5321         unlock and __futex address instead of address of low 32-bits of
5322         __wakeup_seq to futex_requeue macro, adjust for new return value
5323         meaning.
5324         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
5325         (__pthread_cond_signal): Increment __futex at the same time as
5326         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5327         address of low 32-bits of __wakeup_seq to futex syscall.
5328         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5329         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5330         releasing internal lock to FUTEX_WAIT.
5331         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5332         (__pthread_cond_timedwait): Likewise.
5333         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5334         (FUTEX_CMP_REQUEUE): Define.
5335         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5336         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5337         Pass __futex value from before the unlock and __futex address instead
5338         of address of low 32-bits of __wakeup_seq to futex syscall.
5339         Fallback to FUTEX_WAKE all on any errors.
5340
5341 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5342
5343         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
5344         Add nop to align the end of critical section.
5345         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
5346
5347 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5348
5349         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5350         Add __broadcast_seq field.
5351         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
5352         all waiters as woken with woken_seq and bump broadcast counter.
5353         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
5354         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
5355         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5356         Comment typo fixes.  Avoid returning -ETIMEDOUT.
5357
5358 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
5359
5360         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5361         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
5362         Reported by Kaz Kojima.
5363
5364 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
5365
5366         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
5367
5368 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5369
5370         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
5371         __broadcast_seq with bc_seq after acquiring internal lock instead of
5372         before it.
5373
5374 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
5375
5376         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
5377         compilation.
5378         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5379         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
5380         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5381         (pthread_cond_t): Add __data.__broadcast_seq field.
5382         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5383         (FRAME_SIZE): Define.
5384         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
5385         Comment typo fixes.
5386         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
5387         Define.
5388         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
5389         typo fixes.
5390         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5391         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
5392         fixes.
5393
5394 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
5395
5396         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
5397         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5398         Add __broadcast_seq field.
5399         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5400         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5401         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5402         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5403         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5404         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
5405         all waiters as woken with woken_seq and bump broadcast counter.
5406         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
5407         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
5408         __broadcast_seq field.
5409         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5410         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
5411         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5412         * pthread_cond_init.c: Initialize __broadcast_seq field.
5413         * Makefile (tests): Add tst-cond17 and tst-cond18.
5414         Add .NOTPARALLEL goal.
5415         * tst-cond16.c: New file.  From Jakub.
5416         * tst-cond17.c: New file.  From Jakub.
5417         * tst-cond18.c: New file.  From Jakub.
5418
5419 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
5420
5421         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
5422         unwind info.
5423
5424         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
5425         Parametrize frame size.  Correct some unwind info.
5426         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5427
5428 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5429
5430         * tst-stack3.c: Note testing functionality beyond POSIX.
5431
5432 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5433
5434         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
5435         Change conditional from ifdef to if.
5436
5437 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
5438
5439         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
5440         SYSDEP_CANCEL_ERROR): Define.
5441         (PSEUDO): Use it.
5442
5443 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
5444
5445         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
5446
5447 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
5448
5449         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
5450
5451 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5452
5453         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
5454         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5455         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
5456         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5457
5458 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
5459
5460         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
5461         thread has all signals blocked.
5462
5463 2004-04-18  Andreas Jaeger  <aj@suse.de>
5464
5465         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
5466         (SEM_VALUE_MAX): Add missing brace.
5467
5468 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5469
5470         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
5471         in rt subdir.
5472         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
5473         * sysdeps/pthread/tst-mqueue8x.c: New test.
5474         * tst-cancel4.c: Update comment about message queues.
5475
5476         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
5477         return it_value { 0, 0 }.
5478         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
5479         like SIGEV_SIGNAL.
5480         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
5481         assertion for SIGEV_NONE.
5482         (thread_attr_compare): Compare all attributes, not just a partial
5483         subset.
5484
5485 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5486
5487         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
5488
5489 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
5490
5491         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
5492         Just use a plain number.
5493         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
5494         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
5495         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
5496         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
5497         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
5498         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
5499         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5500
5501 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5502
5503         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
5504         frame info.
5505         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5506
5507 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
5508
5509         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
5510         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
5511         of calling sigwaitinfo.
5512
5513 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
5514
5515         * allocatestack.c (allocate_stack): Set reported_guardsize
5516         unconditionally.
5517         * pthread_getattr_np.c (pthread_getattr_np): Use
5518         reported_guardsize instead of guardsize.
5519         * descr.h (struct pthread): Add reported_guardsize field.
5520
5521 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
5522
5523         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
5524
5525 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
5526
5527         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
5528
5529 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5530
5531         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
5532         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
5533         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
5534         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
5535         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
5536         Define.
5537         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
5538         (_POSIX_MESSAGE_PASSING): Define.
5539         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
5540         (_POSIX_MESSAGE_PASSING): Define.
5541         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
5542         (_POSIX_MESSAGE_PASSING): Define.
5543
5544 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
5545
5546         * tst-context1.c (fct): Check whether correct stack is used.
5547
5548 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
5549
5550         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
5551         matching constraints for asm mem parameters.
5552
5553         * tst-clock2.c (tf): Don't define unless needed.
5554
5555 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
5556
5557         * Makefile (link-libc-static): Use $(static-gnulib) instead of
5558         $(gnulib).
5559
5560 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
5561
5562         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
5563         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
5564         * pthreadP.h: Declare __nptl_deallocate_tsd.
5565         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
5566         Adjust caller.
5567
5568         * Makefile (tests): Add tst-tsd5.
5569         * tst-tsd5.c: New file.
5570
5571 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
5572
5573         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5574         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
5575         is SHLIB_COMPAT check.
5576         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5577         (__pthread_attr_getaffinity_old): Likewise.
5578         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5579         (__pthread_getaffinity_old): Likewise.
5580         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5581         (__pthread_setaffinity_old): Likewise.
5582
5583 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
5584
5585         * allocatestack.c (_make_stacks_executable): Call
5586         _dl_make_stack_executable first.
5587
5588 2004-03-24  Roland McGrath  <roland@redhat.com>
5589
5590         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
5591         constraint instead of "0".
5592
5593 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
5594
5595         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5596         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
5597
5598         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
5599         code to avoid warning.
5600
5601 2004-03-24  Andreas Jaeger  <aj@suse.de>
5602
5603         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5604         (__pthread_attr_setaffinity_old): Remove const.
5605
5606 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
5607
5608         * sysdeps/unix/sysv/linux/smp.h: New file.
5609         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
5610         * init.c: Define __is_smp.
5611         (__pthread_initialize_minimal_internal): Call is_smp_system to
5612         initialize __is_smp.
5613         * pthreadP.h: Declare __is_smp.
5614         Define MAX_ADAPTIVE_COUNT is necessary.
5615         * pthread_mutex_init.c: Add comment regarding __spins field.
5616         * pthread_mutex_lock.c: Implement adaptive mutex type.
5617         * pthread_mutex_timedlock.c: Likewise.
5618         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
5619         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
5620         Add __spins field.
5621         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5622         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5623         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5624         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5625         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5626         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5627         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5628         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
5629         lll_mutex_cond_trylock.
5630         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5631         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5632         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5633         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5634         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5635         Define BUSY_WAIT_NOP.
5636         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5637         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5638
5639         * tst-mutex5.c: Add support for testing adaptive mutexes.
5640         * tst-mutex7.c: Likewise.
5641         * tst-mutex5a.c: New file.
5642         * tst-mutex7a.c: New file.
5643         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
5644
5645         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5646         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
5647         vgettimeofday call might destroy the content.
5648
5649         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
5650         @pause in the loop.
5651
5652         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5653         No need to restrict type of ret.  Make it int.  Add comment.
5654
5655         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5656         Remove unnecessary setne instruction.
5657
5658 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
5659
5660         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5661         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
5662         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
5663         If realloc fails, break out of the loop.
5664
5665 2004-03-20  Andreas Jaeger  <aj@suse.de>
5666
5667         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5668         (__pthread_setaffinity_old): Fix interface.
5669         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5670         (__pthread_getaffinity_old): Likewise.
5671
5672         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5673         (__pthread_setaffinity_new): Remove duplicate declaration.
5674
5675 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5676
5677         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
5678         the return value to a safe register.
5679         (CDISABLE): Set the function argument correctly.
5680
5681 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5682
5683         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
5684         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
5685         Rewrite so that only one locked memory operation per round is needed.
5686         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
5687         (pthread_barrier_wait): After wakeup, release lock only when the
5688         last thread stopped using the barrier object.
5689         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5690         (__pthread_cond_wait): Don't store mutex address if the current
5691         value is ~0l.  Add correct cleanup support and unwind info.
5692         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5693         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5694         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
5695         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
5696         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5697         Add correct cleanup support and unwind info.
5698         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
5699         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
5700         information for syscall wrappers.
5701
5702 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
5703
5704         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5705         cpusetsize field, remove next.
5706         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
5707         parameter for size of the CPU set.
5708         (pthread_setaffinity_np): Likewise.
5709         (pthread_attr_getaffinity_np): Likewise.
5710         (pthread_attr_setaffinity_np): Likewise.
5711         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
5712         interface change, keep compatibility code.
5713         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
5714         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
5715         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
5716         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
5717         __pthread_getaffinity_np.
5718         * Versions: Add version for changed interfaces.
5719         * tst-attr3.c: Adjust test for interface change.
5720         * pthread_getattr_np.c: Query the kernel about the affinity mask with
5721         increasing buffer sizes.
5722         * pthread_attr_destroy.c: Remove unused list handling.
5723         * pthread_attr_init.c: Likewise.
5724
5725 2004-03-17  Roland McGrath  <roland@redhat.com>
5726
5727         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
5728         first argument to clock_getres so we ever enable kernel timers.
5729
5730 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
5731
5732         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
5733
5734 2004-03-12  Richard Henderson  <rth@redhat.com>
5735
5736         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
5737         oldvalue from CENABLE to CDISABLE.
5738
5739 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
5740
5741         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
5742         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
5743         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
5744         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
5745
5746 2004-03-11  Richard Henderson  <rth@redhat.com>
5747
5748         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
5749         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
5750         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
5751
5752 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5753
5754         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
5755         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
5756         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
5757
5758 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5759
5760         * forward.c (__pthread_cond_broadcast_2_0,
5761         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
5762         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
5763         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
5764
5765 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5766
5767         * sysdeps/sh/tcb-offsets.sym: Add PID.
5768         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
5769         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
5770
5771 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
5772
5773         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
5774         include <sysdep-cancel.h>, vfork is no cancellation point.
5775         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
5776         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
5777         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
5778
5779 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
5780
5781         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
5782         libc_hidden_def.
5783         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
5784         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
5785         Likewise.
5786         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
5787         Likewise.
5788         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
5789         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
5790         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
5791         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
5792         of DO_CALL_VIA_BREAK.  Work around a gas problem.
5793
5794         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
5795         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
5796         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
5797         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
5798         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
5799         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
5800
5801         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
5802         a local register for saving old PID.  Negate PID in parent upon exit.
5803
5804         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
5805         tcb-offsets.h.
5806         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5807         before syscall, set to the old value in the parent afterwards.
5808         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
5809         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
5810         tcb-offsets.h.
5811         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5812         before syscall, set to the old value in the parent afterwards.
5813         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
5814         * sysdeps/s390/tcb-offsets.sym: Add PID.
5815
5816         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
5817         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
5818         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
5819         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
5820         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
5821         * sysdeps/sparc/tcb-offsets.sym: Add PID.
5822
5823 2004-03-10  Andreas Schwab  <schwab@suse.de>
5824
5825         * sysdeps/ia64/tcb-offsets.sym: Add PID.
5826         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
5827         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
5828
5829 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
5830
5831         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
5832         * tst-cancel21.c (do_one_test): Likewise.
5833         Reported by Gordon Jin <gordon.jin@intel.com>.
5834
5835 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
5836
5837         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
5838         if non-zero and set to INT_MIN if zero.
5839         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
5840         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
5841         (SAVE_PID, RESTORE_PID): Define.
5842         (__vfork): Use it.
5843         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
5844         Use relative path to avoid including NPTL i386/vfork.S.
5845         (SAVE_PID, RESTORE_PID): Define.
5846         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
5847         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
5848         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
5849         tst-vfork2x.
5850         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
5851         * tst-vfork1.c: New test.
5852         * tst-vfork2.c: New test.
5853         * tst-vfork1x.c: New test.
5854         * tst-vfork2x.c: New test.
5855
5856 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
5857
5858         * sysdeps/i386/tcb-offsets.sym: Add PID.
5859         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5860         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
5861         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
5862
5863 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
5864
5865         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
5866
5867 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
5868
5869         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5870         _rtld_global_ro.
5871
5872 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
5873
5874         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5875         _rtld_global_ro.
5876
5877         * tst-once4.c: Remove unnecessary macro definition.
5878
5879         * tst-mutex7.c (do_test): Limit thread stack size.
5880         * tst-once2.c (do_test): Likewise.
5881         * tst-tls3.c (do_test): Likewise.
5882         * tst-tls1.c (do_test): Likewise.
5883         * tst-signal3.c (do_test): Likewise.
5884         * tst-kill6.c (do_test): Likewise.
5885         * tst-key4.c (do_test): Likewise.
5886         * tst-join4.c (do_test): Likewise.
5887         * tst-fork1.c (do_test): Likewise.
5888         * tst-context1.c (do_test): Likewise.
5889         * tst-cond2.c (do_test): Likewise.
5890         * tst-cond10.c (do_test): Likewise.
5891         * tst-clock2.c (do_test): Likewise.
5892         * tst-cancel10.c (do_test): Likewise.
5893         * tst-basic2.c (do_test): Likewise.
5894         * tst-barrier4.c (do_test): Likewise.
5895
5896 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
5897
5898         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
5899
5900 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5901
5902         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5903         (__pthread_cond_timedwait): Optimize wakeup test.
5904         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5905         (__pthread_cond_wait): Likewise.
5906         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5907         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5908         Likewise.
5909
5910 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5911
5912         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5913         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5914         the atomic instruction needed.
5915         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5916         (__lll_mutex_lock_wait): Likewise.
5917
5918 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5919
5920         * Makefile (tests): Add tst-cond14 and tst-cond15.
5921         * tst-cond14.c: New file.
5922         * tst-cond15.c: New file.
5923
5924 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5925
5926         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5927         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5928         needs to be implemented differently to be useful.
5929
5930 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5931
5932         * pthread_attr_setschedparam.c: Don't test priority against limits
5933         here.  Set ATTR_FLAG_SCHED_SET flag.
5934         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5935         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5936         from parent thread to child.  If attribute is used and scheduling
5937         parameters are not inherited, copy parameters from attribute or
5938         compute them.  Check priority value.
5939         * pthread_getschedparam.c: If the parameters aren't known yet get
5940         them from the kernel.
5941         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5942         ATTR_FLAG_POLICY_SET flag for thread.
5943         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5944         and ATTR_FLAG_POLICY_SET.
5945
5946         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5947
5948         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5949         fail if stack address hasn't been set.  Just return 0.
5950
5951 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5952
5953         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5954         libpthread for the files in this list.
5955         (CFLAGS-tst-unload): Removed.
5956         * tst-unload.c (do_test): Don't use complete path for
5957         LIBPHREAD_SO.
5958
5959         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5960         tst-_res1mod2.
5961
5962 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5963
5964         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5965         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5966         operation per round is needed.
5967         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5968         (__lll_mutex_lock_wait): Likewise.
5969
5970 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5971
5972         * tst-cancel9.c (cleanup): Don't print to stderr.
5973
5974 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5975
5976         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5977
5978 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5979
5980         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5981         (__syscall_error_handler2): Call CDISABLE.
5982         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5983         (__syscall_error_handler2): Call CDISABLE.
5984
5985         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5986         Release lock before the loop, don't reacquire it.
5987
5988         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5989
5990 2004-02-19  Andreas Schwab  <schwab@suse.de>
5991
5992         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5993         Fix last change.
5994
5995 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5996
5997         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5998         (pthread_barrier_wait): After wakeup, release lock only when the
5999         last thread stopped using the barrier object.
6000         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
6001         (pthread_barrier_wait): Likewise.
6002         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
6003         Likewise.
6004         * Makefile (tests): Add tst-barrier4.
6005         * tst-barrier4.c: New file.
6006
6007         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6008         (__pthread_cond_timedwait): Perform timeout test while holding
6009         internal lock to prevent wakeup race.
6010         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
6011         * sysdeps/pthread/pthread_cond_timedwait.c
6012         (__pthread_cond_timedwait): Likewise.
6013         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6014         (__pthread_cond_timedwait): Likewise.
6015
6016 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
6017
6018         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
6019         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
6020         * Makefile (tests): Add tst-rwlock13.
6021         * tst-rwlock13.c: New test.
6022
6023 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
6024
6025         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6026         (__condvar_tw_cleanup): Little optimization.
6027         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
6028
6029 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
6030
6031         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
6032         libpthread as "lib" parameter to SHLIB_COMPAT.
6033         (__novmx_siglongjmp): Fix typo in function name.
6034         (__novmx_longjmp): Fix typo in function name.
6035
6036 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
6037
6038         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
6039         __builtin_expect.
6040
6041         * sysdeps/generic/pt-longjmp.c: Moved to...
6042         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
6043
6044 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
6045
6046         * Makefile (libpthread-routines): Add pt-cleanup.
6047         * pt-longjmp.c: Removed.
6048         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
6049         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
6050         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
6051         Version longjmp, siglongjmp for GLIBC_2.3.4.
6052         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
6053
6054 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
6055
6056         * sysdeps/pthread/pthread_cond_timedwait.c
6057         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
6058         Reuse code.  Add __builtin_expects.
6059
6060         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6061         (__pthread_cond_timedwait): Get internal lock in case timeout has
6062         passed before the futex syscall.
6063         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6064
6065 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
6066
6067         * allocatestack.c: Pretty printing.
6068
6069         * sysdeps/pthread/createthread.c (create_thread): Don't add
6070         CLONE_DETACHED bit if it is not necessary.
6071
6072 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
6073
6074         * pthread_getattr_np.c: Include ldsodefs.h.
6075
6076 2004-01-16  Richard Henderson  <rth@redhat.com>
6077
6078         * allocatestack.c: Don't declare __libc_stack_end.
6079         * init.c (__pthread_initialize_minimal_internal): Likewise.
6080         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
6081
6082 2004-01-15  Richard Henderson  <rth@redhat.com>
6083
6084         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
6085         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
6086         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
6087         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
6088         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
6089         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
6090         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
6091         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
6092
6093 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
6094
6095         * init.c (pthread_functions): Make array const.
6096
6097 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
6098
6099         * allocatestack.c (__make_stacks_executable): Change interface.
6100         Check parameters.  Pass parameter on to libc counterpart.
6101         * pthreadP.h: Change declaration.
6102
6103 2004-01-13  Richard Henderson  <rth@redhat.com>
6104
6105         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
6106         prototype form.
6107         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
6108         Likewise.
6109
6110         * sysdeps/alpha/Makefile: New file.
6111         * sysdeps/alpha/tcb-offsets.sym: New file.
6112         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
6113         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
6114
6115         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
6116         on powerpc version.
6117
6118 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
6119
6120         * Makefile (tests): Add tst-backtrace1.
6121         * tst-backtrace1.c: New test.
6122
6123 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
6124
6125         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
6126         register as second parameter to the REGISTER macro.
6127         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
6128         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
6129         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
6130         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
6131         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
6132         of thread register as second parameter to REGISTER macro in 64 case.
6133
6134 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
6135
6136         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
6137         (CFLAGS-getpid.o): Defined.
6138         (CFLAGS-getpid.os): Defined.
6139
6140 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
6141
6142         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
6143         returned for main thread does not overlap with any other VMA.
6144         Patch by Jakub Jelinek.
6145
6146 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
6147
6148         * tst-raise1.c: Include stdio.h.
6149
6150 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
6151
6152         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
6153         setting with __ASSUME_TGKILL || defined __NR_tgkill.
6154         If pid is 0, set it to selftid.
6155         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
6156         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
6157         != 0, return self->tid without doing a syscall.
6158         * descr.h (struct pthread): Move pid field after tid.
6159
6160         * Makefile (tests): Add tst-raise1.
6161         * tst-raise1.c: New file.
6162
6163 2003-12-23  Roland McGrath  <roland@redhat.com>
6164
6165         * tst-oddstacklimit.c: New file.
6166         * Makefile (tests): Add it.
6167         (tst-oddstacklimit-ENV): New variable.
6168
6169         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
6170         value up to page size for __default_stacksize.
6171
6172 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
6173
6174         * Makefile (tests): Add tst-eintr5.
6175         * tst-eintr5.c: New file.
6176
6177         * eintr.c (eintr_source): Prevent sending signal to self.
6178
6179         * tst-eintr2.c (tf1): Improve error message.
6180
6181 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
6182
6183         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
6184         * sysdeps/unix/sysv/linux/getpid.c: New file.
6185         * pthread_cancel.c: Add comment explaining use of PID field.
6186         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6187         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
6188         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
6189         temporarily to signal the field must not be relied on and updated
6190         by getpid().
6191         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
6192         temporarily negative.
6193         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6194
6195 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
6196
6197         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
6198         (eintr_source): If ARG != NULL, use pthread_kill.
6199         * tst-eintr1.c: Adjust for this change.
6200         * tst-eintr2.c: Likewise.
6201         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
6202         * tst-eintr3.c: New file.
6203         * tst-eintr4.c: New file.
6204
6205 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
6206
6207         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
6208         if CANCELSTATE_BITMASK is set.
6209         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
6210         Likewise.
6211
6212         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
6213         (tests-reverse): Add tst-cancel23.
6214         * tst-cancel22.c: New test.
6215         * tst-cancel23.c: New test.
6216
6217 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
6218
6219         * tst-eintr1.c: Better error messages.
6220
6221         * Makefile (tests): Add tst-eintr2.
6222         * tst-eintr2.c: New file.
6223
6224 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
6225
6226         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
6227         (CFLAGS-tst-cancelx21.c): Set.
6228         * tst-cancel21.c: New test.
6229         * tst-cancelx21.c: New test.
6230
6231         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
6232         comparison operand.
6233         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
6234         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
6235         * pt-longjmp.c: Include jmpbuf-unwind.h.
6236         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
6237         _JMPBUF_UNWINDS.  Adjust compared pointers.
6238         * init.c (__pthread_initialize_minimal_internal): Initialize
6239         pd->stackblock_size.
6240         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
6241         * sysdeps/alpha/jmpbuf-unwind.h: New file.
6242         * sysdeps/i386/jmpbuf-unwind.h: New file.
6243         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
6244         * sysdeps/s390/jmpbuf-unwind.h: New file.
6245         * sysdeps/sh/jmpbuf-unwind.h: New file.
6246         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
6247         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
6248         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
6249         (_JMPBUF_CFA_UNWINDS): Remove.
6250         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
6251
6252 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
6253
6254         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
6255         (CFLAGS-tst-cancelx20.c): Set.
6256         * tst-cancel20.c: New test.
6257         * tst-cancelx20.c: New test.
6258
6259 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
6260
6261         * init.c (__pthread_initialize_minimal_internal): Don't treat
6262         architectures with separate register stack special here when
6263         computing default stack size.
6264
6265 2003-12-17  Roland McGrath  <roland@redhat.com>
6266
6267         * Makefile (tst-cancelx7-ARGS): New variable.
6268         Reportd by Greg Schafer <gschafer@zip.com.au>.
6269
6270 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
6271
6272         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
6273         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
6274         (tst-stack3-ENV): Set.
6275         ($(objpfx)tst-stack3-mem): New.
6276         * tst-stack3.c: New test.
6277
6278 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
6279
6280         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
6281         Add unwind directives.  Drop unused .regstk directive.
6282         (_fini_EPILOG_BEGINS): Add unwind directives.
6283
6284 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
6285
6286         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
6287         Assume parameter is a pointer.
6288         (lll_futex_wake): Likewise.
6289         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
6290         Likewise.
6291         (lll_futex_wake): Likewise.
6292         Reported by Boris Hu.
6293         * sysdeps/unix/sysv/linux/unregister-atfork.c
6294         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
6295
6296         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
6297
6298 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
6299
6300         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
6301         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
6302         __rtld_lock_initialize for ld.so lock.
6303         Patch in part by Adam Li <adam.li@intel.com>.
6304
6305 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
6306
6307         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
6308         in $(gnulib).  Also, remove stale comment.
6309
6310 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
6311
6312         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
6313         advantage of new syscall stub and optimize accordingly.
6314
6315         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
6316         from SYS_futex, to match expectations of
6317         sysdep.h:DO_INLINE_SYSCALL.
6318         (lll_futex_clobbers): Remove.
6319         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
6320         (lll_futex_wake): Likewise.
6321         (lll_futex_requeue): Likewise.
6322         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
6323         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
6324         Jelinek).
6325         (__lll_mutex_lock): Likewise.
6326         (__lll_mutex_cond_lock): Likewise.
6327         (__lll_mutex_timed_lock): Likewise.
6328         (__lll_mutex_unlock): Likewise.
6329         (__lll_mutex_unlock_force): Likewise.
6330
6331         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
6332         comes before the include of <sysdep.h>.
6333         (THREAD_SELF_SYSINFO): New macro.
6334         (THREAD_SYSINFO): Likewise.
6335         (INIT_SYSINFO): New macro.
6336         (TLS_INIT_TP): Call INIT_SYSINFO.
6337
6338         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
6339
6340         * sysdeps/pthread/createthread.c (create_thread): Use
6341         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
6342         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
6343         THREAD_SELF_SYSINFO instead of open code.
6344         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
6345         (THREAD_SYSINFO): Likewise.
6346
6347         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
6348
6349         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
6350
6351 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
6352
6353         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
6354         instead of .init.  Patch by David Mosberger.
6355
6356 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
6357
6358         * sysdeps/pthread/configure.in: Remove broken declaration in C
6359         cleanup handling check.
6360
6361 2003-11-30  Andreas Jaeger  <aj@suse.de>
6362
6363         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
6364         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
6365         Likewise.
6366
6367 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
6368
6369         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
6370         * pthread_attr_destroy.c: Include shlib-compat.h.
6371         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
6372         is set in iattr->flags.
6373         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
6374
6375 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
6376
6377         * Makefile (distribute): Add tst-cleanup4aux.c.
6378
6379         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
6380         include.
6381
6382 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
6383
6384         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
6385         pthread_cond_signal.
6386
6387         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
6388         store mutex address if the current value is ~0l.
6389         * sysdeps/pthread/pthread_cond_timedwait.c
6390         (__pthread_cond_timedwait): Likewise.
6391         * sysdeps/pthread/pthread_cond_broadcast.c
6392         (__pthread_cond_broadcast): Don't use requeue for pshared
6393         condvars.
6394
6395         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
6396         (__pthread_cond_wait): Don't store mutex address if the current
6397         value is ~0l.
6398         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6399         (__pthread_cond_timedwait): Likewise.
6400         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
6401         (__pthread_cond_broadcast): Don't use requeue for pshared
6402         condvars.
6403
6404         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
6405         element with ~0l for pshared condvars, with NULL otherwise.
6406
6407         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6408         (__pthread_cond_wait): Don't store mutex address if the current
6409         value is ~0l.
6410         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6411         (__pthread_cond_timedwait): Likewise.
6412         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6413         (__pthread_cond_broadcast): Don't use requeue for pshared
6414         condvars.
6415
6416         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
6417         * tst-cond12.c: New file.
6418         * tst-cond13.c: New file.
6419
6420 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
6421
6422         * sysdeps/pthread/configure.in: Make missing forced unwind support
6423         fatal.
6424
6425 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
6426
6427         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
6428
6429 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
6430
6431         * Makefile: Add magic to clean up correctly.
6432
6433 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
6434
6435         * unwind.c (FRAME_LEFT): Define.
6436         (unwind_stop): Handle old style cleanups here.
6437         (__pthread_unwind): Handle old style cleanups only if
6438         !HAVE_FORCED_UNWIND.
6439         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
6440         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
6441         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
6442         ($(objpfx)tst-cleanupx4): Likewise.
6443         * tst-cleanup4.c: New test.
6444         * tst-cleanup4aux.c: New.
6445         * tst-cleanupx4.c: New test.
6446
6447 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
6448
6449         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
6450         lll_mutex_*lock macros to skip atomic operations on some archs.
6451
6452 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
6453
6454         * sysdeps/pthread/tst-timer.c (main): Initialize
6455         sigev2.sigev_value as well.
6456
6457 2003-10-15  Roland McGrath  <roland@redhat.com>
6458
6459         * sysdeps/pthread/configure.in: Barf if visibility attribute support
6460         is missing.
6461         * sysdeps/pthread/configure: Regenerated.
6462
6463 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6464
6465         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
6466         locking macros.  No distinction between normal and mutex locking
6467         anymore.
6468         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
6469         Merge bits from lowlevelmutex.S we still need.
6470         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
6471         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
6472         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
6473         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
6474         new mutex implementation.
6475         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
6476         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6477         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6478         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6479         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
6480         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6481         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6482         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
6483         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6484         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
6485         symbol for entry point to avoid cancellation.
6486
6487 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
6488
6489         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
6490         changes.
6491         (SAVE_OLDTYPE_0): Fix a typo.
6492
6493 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
6494
6495         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6496         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
6497
6498 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6499
6500         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
6501         correct offset.
6502
6503 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
6504
6505         * Makefile (tests): Add tst-cancel19.
6506         * tst-cancel19.c: New test.
6507
6508 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6509
6510         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
6511         restoring of the old cancellation type.
6512
6513 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
6514
6515         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
6516
6517 2003-09-27  Wolfram Gloger  <wg@malloc.de>
6518
6519         * sysdeps/pthread/malloc-machine.h: New file
6520
6521 2003-09-24  Roland McGrath  <roland@redhat.com>
6522
6523         * allocatestack.c (__make_stacks_executable): Don't ignore return
6524         value from _dl_make_stack_executable.
6525
6526 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
6527
6528         * allocatestack.c (__make_stacks_executable): Also change
6529         permission of the currently unused stacks.
6530
6531         * allocatestack.c (change_stack_perm): Split out from
6532         __make_stacks_executable.
6533         (allocate_stack): If the required permission changed between the time
6534         we started preparing the stack and queueing it, change the permission.
6535         (__make_stacks_executable): Call change_stack_perm.
6536
6537         * Makefile: Build tst-execstack-mod locally.
6538         * tst-execstack-mod.c: New file.
6539
6540 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
6541
6542         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
6543
6544 2003-09-23  Roland McGrath  <roland@redhat.com>
6545
6546         * tst-execstack.c: New file.
6547         * Makefile (tests): Add it.
6548         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
6549         (LDFLAGS-tst-execstack): New variable.
6550
6551         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
6552         whether to use PROT_EXEC for stack mmap.
6553         (__make_stacks_executable): New function.
6554         * pthreadP.h: Declare it.
6555         * init.c (__pthread_initialize_minimal_internal): Set
6556         GL(dl_make_stack_executable_hook) to that.
6557
6558 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6559
6560         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
6561         recommendation from AMD re avoidance of lock prefix.
6562
6563 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
6564
6565         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
6566         lll_futex_timed_wait instead of lll_futex_wait.
6567         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
6568         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
6569         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
6570         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
6571         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
6572         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
6573         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
6574         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
6575         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
6576         Completely revamp the locking macros.  No distinction between
6577         normal and mutex locking anymore.
6578         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
6579         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
6580         __lll_lock_timedwait): Fix prototypes.
6581         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
6582         __lll_lock_timedwait): Likewise.
6583         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
6584         macros, add __builtin_expect.
6585         (lll_mutex_timedlock): Likewise.  Fix return value.
6586         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
6587         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
6588         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
6589         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
6590         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
6591         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
6592         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
6593         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
6594
6595 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6596
6597         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6598         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
6599         operation if possible.
6600
6601         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
6602         like jumping over the lock prefix.
6603
6604 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
6605
6606         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
6607         locking macros.  No distinction between normal and mutex locking
6608         anymore.
6609         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6610         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6611         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
6612         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
6613         locking.  Merge bits from lowlevelmutex.S we still need.
6614         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
6615         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
6616         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
6617         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
6618         * Makefile (routines): Remove libc-lowlevelmutex.
6619         (libpthread-rountines): Remove lowlevelmutex.
6620         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
6621         for new mutex implementation.
6622         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6623         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6624         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6625         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6626         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6627         Likewise.
6628         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6629         Likewise.
6630         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6631         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6632         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
6633         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6634         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6635         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6636         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6637         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6638         Likewise.
6639         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6640         Likewise.
6641         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
6642         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6643         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6644         Don't use requeue.
6645         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6646         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
6647
6648 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
6649
6650         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
6651         in parameters of asm with output parameters.
6652
6653         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
6654         type of DECR parameter to int.
6655         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
6656
6657 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
6658
6659         * tst-attr3.c (tf, do_test): Print stack start/end/size and
6660         guardsize for each thread.
6661
6662 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6663
6664         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
6665         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6666         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
6667
6668         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
6669         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
6670         NULL.
6671         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
6672         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
6673         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6674         (pthread_getaffinity_np): Add hidden_def.
6675
6676         * Makefile (tests): Add tst-attr3.
6677         * tst-attr3.c: New test.
6678
6679         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
6680
6681 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6682
6683         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
6684         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
6685
6686 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6687
6688         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
6689         * tst-align.c: Include tst-stack-align.h.
6690         (tf, do_test): Use TEST_STACK_ALIGN macro.
6691
6692 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
6693
6694         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
6695         variable.
6696
6697 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
6698
6699         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
6700         stack-related values for the initial thread.
6701
6702 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6703
6704         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
6705
6706 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
6707
6708         * pthread_mutex_lock.c: Minor code rearrangements.
6709
6710 2003-09-05  Roland McGrath  <roland@redhat.com>
6711
6712         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
6713         Instead, include ../nptl_db/db_info.c to do its magic.
6714         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
6715         (__pthread_pthread_key_2ndlevel_size): Likewise.
6716         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
6717         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
6718         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
6719         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
6720         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
6721         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
6722         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
6723         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
6724         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
6725         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
6726         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
6727         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
6728         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
6729         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
6730         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
6731         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
6732         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
6733
6734 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
6735
6736         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
6737         of pthread_t to be compatible with LT.
6738         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6739         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6740         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6741         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6742         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
6743         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6744         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6745
6746 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
6747
6748         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
6749
6750 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
6751
6752         * unwind-forcedunwind.c: Move to...
6753         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
6754         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
6755         * sysdeps/pthread/jmpbuf-unwind.h: New file.
6756         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
6757         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
6758         * unwind.c: Include jmpbuf-unwind.h.
6759         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
6760
6761 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
6762
6763         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
6764         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
6765         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
6766         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
6767         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6768         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
6769         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
6770         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
6771         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
6772         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
6773         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
6774         function.
6775         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
6776         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
6777         * Makefile (tests): Add tst-stack2.
6778         * tst-stack2.c: New test.
6779         * tst-stack1.c: Include limits.h and sys/param.h.
6780         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
6781
6782         * pthread_condattr_setpshared.c: Include errno.h.
6783         (pthread_condattr_setpshared): Return EINVAL if pshared
6784         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
6785
6786         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
6787         defined symbol for entry point to avoid cancellation.
6788         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6789         Likewise.
6790         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
6791         Likewise.
6792         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6793         Likewise.
6794         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
6795         Likewise.
6796         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
6797         Likewise.
6798         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
6799         __close_nocancel, __read_nocancel, __write_nocancel,
6800         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
6801         libpthread.so or librt.so, define to corresponding function
6802         without _nocancel suffix.
6803         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
6804         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
6805         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
6806
6807         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
6808
6809 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
6810
6811         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
6812         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
6813
6814         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
6815         in subsections has a symbol associated with it.
6816
6817         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
6818         defined symbol for entry point to avoid cancellation.
6819         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
6820
6821 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6822
6823         * Makefile (tests): Add tst-tls5.
6824         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
6825         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
6826         ($(objpfx)tst-tls5): New.
6827         ($(objpfx)tst-tls6.out): Likewise.
6828         (tests): Depend on $(objpfx)tst-tls6.out.
6829         * tst-tls3.c: Include stdint.h and pthreaddef.h.
6830         (do_test): Check pthread_self () return value alignment.
6831         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
6832         (tf): Check pthread_self () return value alignment.
6833         * tst-tls5.c: New test.
6834         * tst-tls5.h: New.
6835         * tst-tls5mod.c: New.
6836         * tst-tls5moda.c: New.
6837         * tst-tls5modb.c: New.
6838         * tst-tls5modc.c: New.
6839         * tst-tls5modd.c: New.
6840         * tst-tls5mode.c: New.
6841         * tst-tls5modf.c: New.
6842         * tst-tls6.sh: New test.
6843
6844         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
6845         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
6846         * init.c (pthread_functions): Initialize them.
6847         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
6848         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
6849         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
6850         pthread_cond_timedwait@@GLIBC_2.3.2.
6851
6852 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6853
6854         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
6855         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
6856         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
6857         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
6858         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
6859         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6860
6861         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
6862
6863         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
6864         _POSIX_THREAD_PRIORITY_SCHEDULING.
6865         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
6866
6867 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
6868
6869         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
6870         nested function, use static inline function from libio.h.
6871         Code by Richard Henderson.
6872
6873         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
6874         weak.
6875
6876 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
6877
6878         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
6879         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
6880         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
6881         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
6882         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
6883         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
6884         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
6885         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
6886         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
6887         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
6888         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
6889         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
6890         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
6891         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
6892         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
6893         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
6894         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
6895         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
6896         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
6897         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
6898         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
6899         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
6900         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6901         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6902         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6903         * sysdeps/sparc/tls.h: New file.
6904         * sysdeps/sparc/tcb-offsets.sym: New file.
6905         * sysdeps/sparc/Makefile: New file.
6906         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6907         * init.c [__sparc__] (__NR_set_tid_address): Define.
6908
6909 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6910
6911         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6912         _IO_release_lock): Define.
6913
6914 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6915
6916         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6917         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6918
6919 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6920
6921         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6922         (__pthread_cleanup_class): Add missing return types of member
6923         functions.
6924
6925 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6926
6927         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6928         (lll_mutex_unlock_force): Add memory barrier between store and futex
6929         syscall.
6930
6931 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6932
6933         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6934         tempmsg in first loop.
6935
6936 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6937
6938         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6939         _POSIX_THREAD_PRIORITY_SCHEDULING.
6940         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6941
6942 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6943
6944         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6945         (__rtld_lock_default_lock_recursive,
6946         __rtld_lock_default_unlock_recursive): Define.
6947         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6948         __rtld_lock_unlock_recursive): Define using
6949         GL(_dl_rtld_*lock_recursive).
6950         * init.c (__pthread_initialize_minimal_internal): Initialize
6951         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6952         Lock GL(_dl_load_lock) the same number of times as
6953         GL(_dl_load_lock) using non-mt implementation was nested.
6954
6955         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6956         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6957
6958 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6959
6960         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6961         PIPE_BUF.
6962
6963 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6964
6965         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6966
6967 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6968
6969         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6970         to first syscall error check.  Move syscall error check for tkill
6971         into __ASSUME_CLONE_STOPPED #ifdef.
6972
6973 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6974
6975         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6976         is not defined, do explicit synchronization.
6977         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6978         is not defined also unlock pd->lock for non-debugging case in case
6979         it is necessary.
6980         * pthread_create.c (start_thread): Always get and release pd->lock
6981         if __ASSUME_CLONE_STOPPED is not defined.
6982         (start_thread_debug): Removed.  Adjust users.
6983         * allocatestack.c (allocate_stack): Always initialize lock if
6984         __ASSUME_CLONE_STOPPED is not defined.
6985         * Makefile (tests): Add tst-sched1.
6986         * tst-sched1.c: New file.
6987
6988         * sysdeps/pthread/createthread.c (do_clone): Only use
6989         sched_setschduler and pass correct parameters.
6990
6991 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6992
6993         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6994         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6995         PTHREAD_STACK_MIN in comments.
6996
6997 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6998
6999         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7000         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
7001         argument.
7002         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
7003         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
7004         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
7005         (__pthread_cleanup_upto): Fix prototype.
7006         (_longjmp_unwind): Adjust caller.
7007         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
7008         Change second argument to const struct pointer.
7009         * tst-sem8.c (main): Remove unused s2 and s3 variables.
7010         * tst-sem9.c (main): Likewise.
7011         * unwind.c: Include string.h for strlen prototype.
7012
7013 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
7014
7015         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7016         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
7017         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
7018         Define HAVE_CMOV.
7019         Patch by Nicholas Miell <nmiell@attbi.com>.
7020
7021 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
7022
7023         * init.c (__pthread_initialize_minimal_internal): Initialize
7024         GL(dl_init_static_tls).
7025         * pthreadP.h (__pthread_init_static_tls): New prototype.
7026         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
7027         New functions.
7028         * Makefile (tests): Add tst-tls4.
7029         (modules-names): Add tst-tls4moda and tst-tls4modb.
7030         ($(objpfx)tst-tls4): Link against libdl and libpthread.
7031         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
7032         tst-tls4modb.so.
7033         * tst-tls4.c: New file.
7034         * tst-tls4moda.c: New file.
7035         * tst-tls4modb.c: New file.
7036
7037 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
7038
7039         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
7040         before __timer_dealloc.
7041         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
7042         Don't call list_unlink.
7043
7044 2003-07-29  Roland McGrath  <roland@redhat.com>
7045
7046         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
7047
7048 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
7049
7050         * tst-cancel17.c (do_test): Check if aio_cancel failed.
7051         Don't reuse struct aiocb A if it failed.
7052         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
7053         not just one byte, as that does not block.
7054
7055 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
7056
7057         * sysdeps/pthread/unwind-resume.c: New file.
7058         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
7059         unwind-resume in csu subdir.
7060         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
7061         exceptions.
7062         (librt-sysdep_routines, librt-shared-only-routines): Add
7063         rt-unwind-resume.
7064         * sysdeps/pthread/rt-unwind-resume.c: New file.
7065         * unwind-forcedunwind.c: New file.
7066         * Makefile (libpthread-routines): Add unwind-forcedunwind.
7067         (libpthread-shared-only-routines): Likewise.
7068         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
7069         * pthreadP.h (pthread_cancel_init): New prototype.
7070         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
7071
7072         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
7073         attr argument const struct pthread_attr *.
7074
7075         * res.c (__res_state): Return __resp.
7076         * descr.h: Include resolv.h.
7077         (struct pthread): Add res field.
7078         * pthread_create.c: Include resolv.h.
7079         (start_thread): Initialize __resp.
7080         * Makefile (tests): Add tst-_res1.
7081         (module-names): Add tst-_res1mod1, tst-_res1mod2.
7082         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
7083         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
7084         libpthread.
7085         * tst-_res1.c: New file.
7086         * tst-_res1mod1.c: New file.
7087         * tst-_res1mod2.c: New file.
7088
7089 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
7090
7091         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
7092
7093         * Makefile: Define various *-no-z-defs variables for test DSOs
7094         which has undefined symbols.
7095
7096 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
7097
7098         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
7099         Retry if the stwcx fails to store once_control.
7100
7101 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
7102
7103         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
7104         pthread_attr_setaffinity.
7105         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
7106         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
7107         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
7108         * pthread_attr_destroy.c: Free cpuset element if allocated.
7109         * pthread_create.c: Pass iattr as additional parameter to
7110         create_thread.
7111         * sysdeps/pthread/createthread.c: If attribute is provided and
7112         a new thread is created with affinity set or scheduling parameters,
7113         start thread with CLONE_STOPPED.
7114         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
7115         pthread_attr_setaffinity.
7116         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
7117         cpuset element.
7118
7119 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
7120
7121         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
7122
7123 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
7124
7125         * sysdeps/pthread/configure.in: Require CFI directives also for
7126         ppc and s390.
7127
7128 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
7129
7130         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
7131         Add cfi directives.
7132
7133 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7134
7135         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
7136         CLEANUP_JMP_BUF.
7137         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
7138         registers as variables.  Call __pthread_mutex_unlock_usercnt.
7139         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7140         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
7141         not self pointer in __writer.  Compare with TID to determine
7142         deadlocks.
7143         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7144         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
7145         Likewise.
7146         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
7147         Likewise.
7148         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
7149         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7150         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
7151         macros also when compiling librt.
7152
7153 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
7154
7155         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
7156         -fasynchronous-unwind-tables.
7157         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
7158         (PSEUDO): Add cfi directives.
7159         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
7160         Likewise.
7161         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
7162         Likewise.
7163
7164 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
7165
7166         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
7167         __pthread_unregister_cancel): Add prototypes and hidden_proto.
7168         * unwind.c (__pthread_unwind_next): Add hidden_def.
7169         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
7170         Likewise.
7171         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
7172         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
7173         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
7174         Likewise.
7175         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
7176         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
7177         Likewise.
7178         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
7179         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
7180         __pthread_unregister_cancel and __pthread_unwind_next.
7181
7182 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
7183
7184         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
7185         different symbol for the cancellation syscall wrapper and
7186         non-cancellation syscall wrapper.
7187         (PSEUDO_END): Define.
7188
7189 2003-07-05  Richard Henderson  <rth@redhat.com>
7190
7191         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
7192         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
7193         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7194         return actual return value from the syscall, not 0.
7195
7196 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
7197
7198         * descr.h (struct pthread): Add pid field.
7199         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
7200         (__reclaim_stacks): Likewise.
7201         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
7202         also check for PID of the signal source.
7203         (__pthread_initialize_minimal_internal): Also initialize pid field
7204         of initial thread's descriptor.
7205         * pthread_cancel.c: Use tgkill instead of tkill if possible.
7206         * sysdeps/unix/sysv/linux/fork.c: Likewise.
7207         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
7208         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
7209         * sysdeps/unix/sysv/linux/raise.c: Likewise.
7210
7211 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
7212
7213         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
7214         Fix use of parameter.
7215         (__libc_cleanup_pop): Likewise.
7216
7217 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
7218
7219         * init.c (sigcancel_handler): Change parameters to match handler
7220         for SA_SIGACTION.  Check signal number and code to recognize
7221         invalid invocations.
7222
7223 2003-07-03  Roland McGrath  <roland@redhat.com>
7224
7225         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
7226         Apply sizeof (struct pthread) bias to r13 value.
7227
7228 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
7229
7230         * sysdeps/pthread/configure.in: Require CFI directives.
7231
7232         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
7233         definition.
7234         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
7235         libpthread compilation.
7236         * unwind.c (__pthread_unwind): Add hidden_def.
7237         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
7238
7239 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
7240
7241         * libc-cancellation.c (__libc_cleanup_routine): Define.
7242         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
7243         (__pthread_cleanup_pop): Define.
7244
7245 2003-07-01  Richard Henderson  <rth@redhat.com>
7246
7247         * sysdeps/alpha/elf/pt-initfini.c: New file.
7248         * sysdeps/alpha/pthread_spin_lock.S: New file.
7249         * sysdeps/alpha/pthread_spin_trylock.S: New file.
7250         * sysdeps/alpha/pthreaddef.h: New file.
7251         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
7252         * sysdeps/alpha/tls.h: New file.
7253         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
7254         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
7255         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
7256         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
7257         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
7258         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
7259         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
7260         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
7261         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
7262         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
7263
7264 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
7265
7266         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
7267         cleanup support and unwind info.
7268
7269 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
7270
7271         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
7272         Use correct cleanup handler registration.  Add unwind info.
7273         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
7274         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
7275         * tst-once3.c: Add cleanup handler and check it is called.
7276         * tst-once4.c: Likewise.
7277         * tst-oncex3.c: New file.
7278         * tst-oncex4.c: New file.
7279         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
7280
7281 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
7282
7283         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
7284
7285 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
7286
7287         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
7288         (tf_msgsnd): Likewise.
7289
7290         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
7291         premature returns a bit more.
7292
7293 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
7294
7295         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
7296         definition to the front.
7297
7298         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
7299         the cleanup functions to make the names unique.  Fix dwarf opcode
7300         un unwind table.
7301         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
7302         functions to make the names unique.  Fix CFA offset for two blocks.
7303
7304 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
7305
7306         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
7307         missing closing braces.
7308         Patch by Christophe Saout <christophe@saout.de>.
7309
7310 2003-06-24  Roland McGrath  <roland@redhat.com>
7311
7312         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
7313
7314 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
7315
7316         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
7317         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
7318
7319         * pthreadP.h: Declare __find_thread_by_id.
7320         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
7321         * pthread_clock_gettime.c: Allow using other thread's clock.
7322         * pthread_clock_settime.c: Likewise.
7323         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
7324         * Makefile: Add rules to build and run tst-clock2.
7325         * tst-clock2.c: New file.
7326
7327 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
7328
7329         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
7330         to use exception-based cleanup handler.
7331         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7332
7333         * tst-cond8.c (ch): Announce that we are done.
7334
7335         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
7336
7337         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
7338         Also test aio_suspend with timeout value.
7339
7340 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
7341
7342         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
7343         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
7344         attribute_hidden.
7345
7346         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
7347         (__pthread_mutex_lock_internal): Likewise.
7348         (__pthread_mutex_unlock_internal): Likewise.
7349         (__pthread_mutex_unlock_usercnt): Declare.
7350         * pthread_mutex_destroy.c: Always fail if used in any way.
7351         * pthread_mutex_init.c: Update comment.
7352         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
7353         * pthread_mutex_timedlock.c: Adjust __nusers.
7354         * pthread_mutex_trylock.c: Adjust __nusers.
7355         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
7356         and public interfaces are wrapper with pass additional parameter.
7357         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
7358         parameter zero.
7359         * tst-mutex8.c: New file.
7360         * Makefile (tests): Add tst-mutex8.
7361         * sysdeps/pthread/pthread_cond_timedwait.c: Call
7362         __pthread_mutex_unlock_usercnt.
7363         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7364         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7365         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7366         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7367         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7368         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
7369         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7370         Add __nusers.
7371         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7372         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7373         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7374         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7375         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7376
7377         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
7378         * pthread_mutex_timedlock.c: Likewise.
7379         * pthread_mutex_trylock.c: Adjust __nusers.
7380         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
7381         * tst-mutex9.c: New file.
7382         * Makefile (tests): Add tst-mutex9.
7383         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
7384         * sysdeps/ia64/tls.h: Likewise.
7385         * sysdeps/powerpc/tls.h: Likewise.
7386         * sysdeps/s390/tls.h: Likewise.
7387         * sysdeps/sh/tls.h: Likewise.
7388         * sysdeps/x86_64/tls.h: Likewise.
7389         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7390         Change type of __owner.
7391         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7392         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7393         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7394         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7395         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7396
7397 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
7398
7399         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
7400         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
7401
7402         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
7403         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
7404         instead of nr to lll_futex_wake.  Only set errno and return -1
7405         if err < 0.
7406
7407         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
7408         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7409         return actual return value from the syscall, not 0.
7410
7411 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
7412
7413         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
7414         find a random value.
7415         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
7416         errno==EIDRM.
7417
7418         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
7419         compat_timer_settime.
7420         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
7421         compat_timer_gettime.
7422         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
7423         compat_timer_getoverrun.
7424         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
7425         compat_timer_delete.
7426
7427         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
7428         error-checking mutex detect busy mutexes.
7429
7430 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7431
7432         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
7433         Add ax to clobber list.
7434         (lll_mutex_cond_lock): Likewise.
7435         (lll_mutex_unlock): Likewise.
7436         (lll_lock): Likewise.
7437         (lll_unlock): Likewise.
7438
7439         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
7440         * tst-cancel18.c: New file.
7441         * tst-cancelx18.c: New file.
7442
7443         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
7444         and tcdrain.
7445
7446         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
7447         * tst-cancel17.c: New file.
7448         * tst-cancelx17.c: New file.
7449
7450         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7451         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7452         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7453
7454         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
7455
7456 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
7457
7458         * sysdeps/pthread/createthread.c (create_thread): Set
7459         header.multiple_threads unconditionally.
7460         * allocatestack.c (allocate_stack): Likewise.
7461         * descr.h (struct pthread): Add header.multiple_threads
7462         unconditionally.
7463         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
7464         Define for librt.  #error if neither libpthread, libc nor librt.
7465         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
7466         Likewise.
7467         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
7468         CDISABLE): Likewise.
7469         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
7470         CDISABLE): Likewise.
7471         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
7472         CDISABLE): Likewise.
7473         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
7474         CDISABLE): Likewise.  Access header.multiple_threads outside of
7475         libc and libpthread.
7476         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
7477         Likewise.
7478         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
7479         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
7480
7481 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7482
7483         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
7484         Also test early cancellation before the thread reaches the cancellation
7485         point.
7486
7487         * Makefile: Compile forward.c with exceptions.
7488
7489         * sysdeps/unix/sysv/linux/sleep.c: New file.
7490
7491 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
7492
7493         * Makefile: Add CFLAGS definition to compile function wrappers
7494         duplicated from libc with exceptions.
7495         * tst-cancel4.c: Also check cancellation handlers.
7496
7497         * Makefile: Add rules to build and run tst-cancel16 and
7498         tst-cancelx16.  Add missing CFLAGS definitions.
7499         * tst-cancel16.c: New file.
7500         * tst-cancelx16.c: New file.
7501
7502 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
7503
7504         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7505         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
7506         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
7507         (DL_SYSINFO_IMPLEMENTATION): Likewise.
7508
7509         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
7510         (LIBC_CANCEL_RESET): Likewise.
7511         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
7512         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
7513         librt-cancellation.
7514         (CFLAGS-libcrt-cancellation.c): Define.
7515         * sysdeps/pthread/librt-cancellation.c: New file.
7516         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
7517         macros also when compiling librt.
7518         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
7519         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
7520         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
7521         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
7522         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
7523         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
7524         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7525
7526         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
7527         compat_timer_create.
7528
7529 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
7530
7531         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
7532
7533         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7534         __register_atfork.
7535         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
7536         Add libc_hidden_def.
7537
7538 2003-06-13  Roland McGrath  <roland@redhat.com>
7539
7540         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
7541         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
7542
7543 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
7544
7545         * allocatestack.c (queue_stack): Always inline.
7546         * ptreadhP.h (__do_cancel): Likewise.
7547
7548 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
7549
7550         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
7551         a typo.
7552
7553 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
7554
7555         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7556         (__pthread_cond_signal): Remove incorrect second addition for
7557         cond_lock!=0.
7558
7559 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
7560
7561         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7562         (__pthread_cond_signal): Use correct futex pointer in
7563         __lll_mutex_lock_wait call.
7564
7565         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7566         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
7567
7568 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
7569
7570         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
7571         cancelable.
7572         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7573         Likewise.
7574
7575         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
7576         hand-written CFI generation code.  Since ENTRY/END also initiated
7577         CFI frames this caused two CFI sets to be generated.
7578
7579 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
7580
7581         * cleanup_routine.c: New file.
7582         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
7583         * sysdeps/pthread/pthread.h: Add support for fully exception-based
7584         cleanup handling.
7585         * Makefile (libpthread-routines): Add cleanup_routine.
7586         Add more CFLAGS variables to compile with exceptions.  Add comments
7587         why which file needs unwind tables.
7588         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
7589         tests.
7590         * tst-cancelx1.c: New file.
7591         * tst-cancelx2.c: New file.
7592         * tst-cancelx3.c: New file.
7593         * tst-cancelx4.c: New file.
7594         * tst-cancelx5.c: New file.
7595         * tst-cancelx6.c: New file.
7596         * tst-cancelx7.c: New file.
7597         * tst-cancelx8.c: New file.
7598         * tst-cancelx9.c: New file.
7599         * tst-cancelx10.c: New file.
7600         * tst-cancelx11.c: New file.
7601         * tst-cancelx12.c: New file.
7602         * tst-cancelx13.c: New file.
7603         * tst-cancelx14.c: New file.
7604         * tst-cancelx15.c: New file.
7605         * tst-cleanupx0.c: New file.
7606         * tst-cleanupx0.expect: New file.
7607         * tst-cleanupx1.c: New file.
7608         * tst-cleanupx2.c: New file.
7609         * tst-cleanupx3.c: New file.
7610
7611         * tst-cleanup0.c: Make standard compliant.
7612         * tst-cleanup1.c: Likewise.
7613
7614         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
7615         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7616         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7617         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7618         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7619         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7620         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
7621         CLEANUP_JMP_BUF.
7622         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7623         * tst-cancel12.c: New file.
7624         * tst-cancel13.c: New file.
7625         * tst-cancel14.c: New file.
7626         * tst-cancel15.c: New file.
7627         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
7628         and tst-cancel15.
7629
7630         * tst-cancel1.c: Add some comments.
7631
7632         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
7633         timeout correctly.
7634
7635 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
7636
7637         * Makefile (CFLAGS-pthread_cancel.c): Define.
7638
7639 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
7640
7641         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
7642         Change type of __writer element to int.
7643         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7644         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7645         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7646         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7647         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7648         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
7649         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7650         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
7651         Compare with TID to determine deadlocks.
7652         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
7653         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7654         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
7655         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7656         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7657         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7658         Likewise.
7659         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7660         Likewise.
7661         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7662         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7663         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
7664         Likewise.
7665         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
7666         Likewise.
7667         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7668         * Makefile (tests): Add tst-rwlock12.
7669         * tst-rwlock12.c: New file.
7670
7671 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
7672
7673         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
7674         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
7675         Remove bogus hidden_proto.
7676         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
7677         Likewise.
7678         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
7679         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
7680         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
7681         ___lll_mutex_timedlock): Likewise.
7682
7683 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
7684
7685         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7686         (__pthread_cond_signal): Add some code to eventually handle
7687         cond_lock!=0.
7688
7689 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
7690
7691         * Makefile (tests): Add tst-exec4.
7692         (tst-exec4-ARGS): Define.
7693         * tst-exec4.c: New file.
7694
7695 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
7696
7697         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7698         Also fail if tv_nsec < 0.
7699         (__lll_timedwait_tid): Likewise.
7700         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
7701         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
7702         Likewise.
7703         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
7704         Likewise.
7705         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
7706         Likewise.
7707         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7708         Likewise.
7709         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
7710         Likewise.
7711         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
7712         Likewise.
7713
7714         * Makefile (tests): Add tst-sem8 and tst-sem9.
7715         * tst-sem8.c: New file.
7716         * tst-sem9.c: New file.
7717         * sem_open.c: Fix creation of in_use record if the file exists but
7718         no internal record.
7719
7720         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
7721         definitions.
7722
7723         * sysdeps/pthread/timer_create.c (timer_create): In case
7724         evp==NULL, assign timer ID to sival_ptr.
7725
7726         * descr.h (struct pthread_unwind_buf): Change type of prev element to
7727         struct pthread_unwind_buf *.
7728         (struct pthread): Likewise for cleanup_jmp_buf element.
7729
7730         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
7731         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
7732         * unwind.c (__pthread_unwind_next): Likewise.
7733
7734 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
7735
7736         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7737         (lll_futex_timed_wait): Use int for futex value parameter.
7738         (lll_futex_wake): Likewise.
7739         (lll_futex_requeue): Likewise.
7740
7741         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7742         Replace one memory operation with one register operation.
7743
7744         * tst-join4.c (do_test): Fix error message.
7745
7746         * tst-rwlock6.c (do_test): Use correct format specifier.
7747
7748         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7749         (__lll_mutex_lock_wait): Replace one memory operation with one
7750         register operation.
7751         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
7752         (__lll_mutex_lock_wait): Likewise.
7753
7754         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7755         (__lll_mutex_cond_lock): Add one to value parameter of
7756         __lll_lock_wait to reflect reality in the futex syscall.
7757         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7758         (lll_mutex_cond_lock): Likewise.
7759
7760 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7761
7762         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
7763         New function.
7764         (lll_mutex_cond_lock): Define.
7765
7766 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
7767
7768         * Makefile (tests): Add tst-signal6.
7769         * tst-signal6.c: New file.
7770
7771         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
7772         (__lll_mutex_unlock_force): New function
7773         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7774
7775         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7776         (__lll_mutex_unlock_force): New function.
7777         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7778
7779         * tst-rwlock7.c (do_test): Use correct format specifier.
7780
7781         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
7782         Find break parameter in correct asm argument.
7783
7784 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
7785
7786         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
7787         Remove out4.
7788         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
7789         error occured.
7790         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7791         Add __mutex.
7792         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
7793         lll_futex_requeue, lll_mutex_unlock_force): Define.
7794
7795 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7796
7797         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7798         (pthread_cond_t): Add __mutex.
7799         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
7800         lll_futex_requeue, lll_mutex_unlock_force): Define.
7801
7802 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7803
7804         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
7805         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
7806         Add __mutex field.
7807         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
7808         Define.
7809         (lll_futex_wait, lll_futex_wake): Define.
7810         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
7811         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
7812         FUTEX_REQUEUE instead of FUTEX_WAIT.
7813         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7814         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
7815         mutex which was used in condvar structure.  Call
7816         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
7817         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7818
7819         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
7820         include tcb-offsets.h.  Read wakeup value in locked region.
7821         Use the value of gbr register as THREAD_ID.
7822         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7823         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7824         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7825
7826         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
7827         macros.
7828
7829 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
7830
7831         * sysdeps/pthread/pthread_cond_broadcast.c
7832         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
7833
7834 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
7835
7836         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
7837         typo in register name.
7838         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
7839         correctly.  Actually use requeue.  Little optimization.
7840         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
7841         mutex address early.  Handle cancellation state as 32-bit value.
7842         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7843         Remove unnecessary label.
7844
7845 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
7846
7847         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
7848         instead of FUTEX_WAIT.
7849         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
7850         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7851         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7852         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7853         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7854         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
7855         used in condvar structure.  Call __pthread_mutex_cond_lock instead
7856         of __pthread_mutex_lock_internal.
7857         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7858         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7859         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7860         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
7861         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7862         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7863         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
7864         Add pthread_mutex_cond_lock.
7865         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
7866         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
7867         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
7868         lll_mutex_cond_lock.
7869         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
7870         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7871         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7872         Add __mutex field.
7873         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7874         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7875
7876         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
7877         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7878
7879         * pthreadP.h: Declare __pthread_mutex_cond_lock.
7880         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
7881         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
7882         macro don't define aliases.
7883
7884         * cancellation.c: Remove __pthread_enable_asynccancel_2.
7885         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
7886         * sysdeps/pthread/pthread_cond_timedwait.c: Use
7887         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
7888         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7889         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7890         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7891         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7892         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7893
7894 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
7895
7896         * sem_open.c: Fix one endless loop.  Implement correct semantics
7897         wrt opening the same semaphore more then once.
7898         * sem_close.c: Adjust for sem_open change.
7899         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
7900         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7901         * Makefile (tests): Add tst-sem7.
7902         * tst-sem7.c: New file.
7903
7904 2003-05-16  Roland McGrath  <roland@redhat.com>
7905
7906         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7907         uninitialized variable braino.
7908
7909 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7910
7911         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7912         test for syscall availability.
7913
7914         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7915         __no_posix_timers to -1 if the syscalls don't exist.
7916
7917         * pthread_join.c (pthread_join): Set tid field of the joined
7918         thread to -1.  This isn't necessary but helps to recognize some
7919         error conditions with almost no cost.
7920
7921         * allocatestack.c (FREE_P): Also negative values indicate an
7922         unused stack.
7923
7924         * unwind.c: Include <unistd.h>.
7925
7926 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7927
7928         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7929
7930 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7931
7932         * Makefile (crti-objs, crtn-objs): New variables.
7933         (omit-deps, extra-objs): Add crtn.
7934         ($(objpfx)libpthread.so): Depend on both crti and crtn
7935         and links to them in multidir.
7936         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7937
7938 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7939
7940         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7941         (lll_mutex_unlock): Use atomic_exchange_rel.
7942
7943 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7944
7945         * cond-perf.c (cons): Add missing locking around setting of alldone.
7946
7947 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7948
7949         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7950         related macros.
7951         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7952
7953 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7954
7955         * tst-sem6.c: New file.
7956         * Makefile (tests): Add tst-sem6.
7957
7958         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7959         Use atomic_exchange_rel instead of atomic_exchange.
7960         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7961         Likewise.
7962
7963         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7964         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7965         vsyscall is possible.
7966
7967         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7968         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7969         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7970         pthread_setaffinity_np.
7971         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7972         and pthread_setaffinity_np.
7973         * Makefile (libpthread-routines): Add pthread_getaffinity and
7974         pthread_setaffinity.
7975
7976         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7977         use it in case mmap to allocate the stack fails.
7978         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7979         ARCH_MAP_FLAGS here.
7980         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7981         ARCH_RETRY_MMAP.
7982
7983 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7984
7985         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7986         handler implementation.  It is now lockless in fork().
7987         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7988         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7989         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7990         declare the __fork_*_lists.
7991         (struct fork_handler): Include pointers to all three functions.
7992         Add next, refcntr and need_signal elements.
7993         (__fork_handlers): New declaration.
7994         (__register_atfork_malloc): Remove declaration.
7995         (HAVE_register_atfork_malloc): Remove definition.
7996         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7997         __pthread_child_handler variable.
7998         (__libc_pthread_init): Use __register_atfork instead of explicitly
7999         adding to the list.
8000         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
8001         and lll_futex_wake.
8002         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8003
8004         * unwind.c (unwind_cleanup): Print error message and then abort.  This
8005         function must never be reached.
8006
8007         * cond-perf.c: New file.
8008
8009 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
8010
8011         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
8012
8013 2003-05-04  Roland McGrath  <roland@redhat.com>
8014
8015         * Makefile ($(objpfx)../libc.so): New target.
8016
8017 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
8018
8019         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
8020         (pthread_condattr_t): Size is only an int, don't use long for
8021         alignment.
8022         (pthread_mutexattr_t): Likewise.
8023         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8024         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
8025         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8026
8027 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
8028
8029         * sysdeps/i386/tls.h: Define THREAD_ID.
8030         * sysdeps/ia64/tls.h: Likewise.
8031         * sysdeps/powerpc/tls.h: Likewise.
8032         * sysdeps/s390/tls.h: Likewise.
8033         * sysdeps/sh/tls.h: Likewise.
8034         * sysdeps/x86_64/tls.h: Likewise.
8035         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
8036         record ownership.
8037         * pthread_mutex_timedlock.c: Likewise.
8038         * pthread_mutex_trylock.c: Likewise.
8039         * pthread_mutex_unlock.c: Likewise.
8040         * pthread_rwlock_trywrlock.c: Likewise.
8041         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
8042         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8043         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8044         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8045
8046         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
8047         flag.
8048
8049 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
8050
8051         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8052         (__SIZEOF_PTHREAD_COND_T): Define to 48.
8053         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
8054         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
8055         Make __align long long instead of long.
8056         (pthread_rwlock_t): Formatting.
8057         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
8058         (pthread_rwlock_t): Formatting.
8059         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
8060         (pthread_cond_t): Make __align long long instead of long.
8061         (pthread_rwlock_t): Move __flags field to the same position as in
8062         linuxthreads.
8063
8064 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
8065
8066         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
8067         * tst-rwlock7.c (do_test): Likewise.
8068
8069 2003-04-26  Roland McGrath  <roland@redhat.com>
8070
8071         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
8072
8073 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
8074
8075         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
8076         sizeof (struct pthread).
8077         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
8078         1 struct pthread.
8079         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
8080         to 0.
8081         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
8082         struct pthread.
8083         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
8084         to 32-bit bytes.
8085         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
8086         tcbp.
8087         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
8088         unneccessarily.
8089         (NO_TLS_OFFSET): Define.
8090         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
8091         add TLS_TCB_SIZE unnecessarily.
8092
8093 2003-04-22  Roland McGrath  <roland@redhat.com>
8094
8095         * Makeconfig (shared-thread-library): Reverse link order to work
8096         around linker bug.
8097
8098 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
8099
8100         * semaphore.h: Fix typo in comment.
8101
8102 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
8103
8104         * sysdeps/pthread/sigfillset.c: New file.
8105
8106         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
8107         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
8108         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
8109         * sysdeps/pthread/sigaction.c: Likewise.
8110         * sysdeps/pthread/sigprocmask.c: New file.
8111         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
8112         __SIGRTMIN+1.
8113         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
8114         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
8115         in this case.
8116
8117 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
8118
8119         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
8120         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
8121
8122         * sysdeps/unix/sysv/linux/unregister-atfork.c
8123         (__unregister_atfork): Don't free memory not allocated dynamically.
8124
8125         * semaphore.h: Remove __THROW marker from cancellation points.
8126         * nptl/sysdeps/pthread/pthread.h: Likewise.
8127
8128 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
8129
8130         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
8131         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
8132         __THROW.
8133
8134 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
8135
8136         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
8137
8138 2003-04-15  Roland McGrath  <roland@redhat.com>
8139
8140         * forward.c (__pthread_unwind): Tweak to avoid warning.
8141
8142 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
8143
8144         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
8145
8146 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
8147
8148         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
8149         overflow CFA advance instructions.
8150         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8151
8152 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
8153
8154         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
8155         * sysdeps/i386/pthread_spin_lock.c: Likewise.
8156         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
8157         defined.
8158
8159         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
8160         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
8161         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
8162         DW_CFA_advance_loc for .Laddl-.Lsubl.
8163
8164 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
8165
8166         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
8167         position-independent unwind data for static libraries.
8168         Add missing unwind info.  Add comments.
8169
8170         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
8171         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8172         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8173         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8174
8175 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
8176
8177         * Makefile: Make sure all cancellation points are compiled with
8178         exception and asynchronous unwind tables.
8179
8180         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
8181         which mishandles loading of global object addresses in PIC.
8182         (THREAD_SETMEM_NC): Likewise.
8183
8184 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
8185
8186         * pthread.h: Define new data structure for cleanup buffer.  Declare
8187         new cleanup handler interfaces.
8188         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
8189         (struct pthread): Add cleanup_jmp_buf pointer.  Define
8190         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
8191         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
8192         it.  Declare old cleanup handler installation functions.
8193         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
8194         handling.
8195         * cleanup_defer.c: Likewise.
8196         * cleanup_compat.c: New file.  Old cleanup code.
8197         * cleanup_def_compat.c: New file.  Old cleanup code.
8198         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
8199         if own thread descriptor.
8200         * unwind.c: New file.
8201         * forward.c: Add __pthread_unwind.
8202         * init.c (pthread_functions): Add __pthread_unwind.
8203         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
8204         Add ptr___pthread_unwind.
8205         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
8206         and unwind function.
8207         * Makefile (libpthread-routines): Add cleanup_compat,
8208         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
8209         table generation if necessary.
8210         * version.c: Record whether unwind support is compiled in.
8211         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
8212         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
8213         handler interfaces.
8214         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
8215         complication to generate unwind information for syscall wrappers.
8216         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
8217         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
8218         __cleanup_fct_attribute.
8219
8220         * Makefile: Add rules to build and run tst-cleanup0.
8221         * tst-cleanup0.c: New file.
8222         * tst-cleanup0.expect: New file.
8223
8224         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
8225         caller.  Optimize to avoid often unecessary local variable.
8226
8227 2003-04-11  Roland McGrath  <roland@redhat.com>
8228
8229         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
8230         sets variable `multidir'; include that.
8231         (generated): Add it.
8232         ($(objpfx)$(multidir)/crti.o): New target.
8233         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
8234
8235 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
8236
8237         * tst-attr2.c (do_test): Add cast to avoid warning.
8238         * tst-mutex4.c (do_test): Likewise.
8239
8240 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
8241
8242         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
8243         in child.
8244
8245 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
8246
8247         * Makefile (tests): Add tst-detach1.
8248         * tst-detach1.c: New file.
8249
8250 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
8251
8252         * sysdeps/pthread/pthread.h: Remove duplicate
8253         pthread_cleanup_{push,pop} definitions.
8254
8255         * tst-barrier2.c: Eliminate warnings.
8256         * tst-cancel4.c: Likewise.
8257         * tst-cond4.c: Likewise.
8258         * tst-cond6.c: Likewise.
8259         * tst-detach1.c: Likewise.
8260         * tst-rwlock4.c: Likewise.
8261         * tst-rwlock6.c: Likewise.
8262         * tst-rwlock7.c: Likewise.
8263         * tst-sem3.c: Likewise.
8264         * tst-spin2.c: Likewise.
8265         * tst-umask1.c: Likewise.
8266
8267 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
8268
8269         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
8270
8271 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
8272
8273         * descr.h (struct pthread): Move cancelhandling member to the front.
8274
8275 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
8276
8277         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
8278         malloc_parent, and malloc_child statically.
8279         (__register_atfork_malloc): New function.
8280         (free_mem): Don't free any of the malloc_* variables on the list.
8281         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
8282         Define HAVE_register_atfork_malloc.
8283
8284 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
8285
8286         * sysdeps/pthread/createthread.c (create_thread): Add some more
8287         comments explaining when to set multiple_threads and when not.
8288
8289         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
8290         THREAD_ATOMIC_BIT_SET if not already defined.
8291         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
8292         THREAD_ATOMIC_BIT_SET:
8293         * sysdeps/x86_64/tls.h: Likewise.
8294         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
8295         THREAD_ATOMIC_CMPXCHG_VAL.
8296         (_pthread_cleanup_pop_restore): Likewise.
8297         * cancellation.c (__pthread_enable_asynccancel): Likewise.
8298         (__pthread_enable_asynccancel_2): Likewise.
8299         (__pthread_disable_asynccancel): Likewise.
8300         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8301         (__libc_disable_asynccancel): Likewise.
8302         * init.c (sigcancel_handler): Likewise.
8303         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
8304         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
8305
8306 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
8307
8308         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
8309         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8310         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
8311         * Makefile (tests): Add tst-cancel11.
8312         * tst-cancel11.c: New file.
8313
8314 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
8315
8316         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
8317         round, not the first.  Use specific_used flag instead of local
8318         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
8319         (__free_tcb): Don't call deallocate_tsd here.
8320         (start_thread): Call deallocate_tsd here.
8321         * pthread_setspecific.c: Set specific_used flag really only when
8322         needed.
8323         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
8324         * tst-tsd3.c: New file.
8325         * tst-tsd4.c: New file.
8326
8327 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8328
8329         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
8330         Use atomic_exchange_and_add instead of __lll_add.
8331         (__lll_mutex_timedlock): Likewise.
8332         Patch by Ian Wienand.
8333
8334 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
8335
8336         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8337         (SINGLE_THREAD_P): Fix typo.
8338         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
8339
8340 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8341
8342         * Makefile (tests): Add tst-align.
8343         * tst-align.c: New file.
8344         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
8345
8346         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
8347         function correctly.
8348
8349         * tst-tsd2.c: Add casts to avoid warnings.
8350
8351 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
8352
8353         * descr.h (struct pthread): Move most often used elements to the front.
8354
8355 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
8356
8357         * Makefile (libpthread-routines): Add pthread_atfork.
8358         (libpthread-static-only-routines): Add pthread_atfork.
8359
8360 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
8361
8362         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
8363         of TLS_DTV_AT_TP.
8364         (INSTALL_DTV): Add parens.
8365         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
8366         Use passed descr instead of THREAD_SELF.
8367         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
8368         (__lll_mutex_timedlock_wait): Correct expected value after
8369         spurious wakeup.
8370         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
8371         Release lock before waking up the waiters.
8372         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
8373         criteria.  Reorderstruct passed to cleanup handler.  Fix
8374         handling of cancellation and failung pthread_mutex_unlock call.
8375         Use __pthread_enable_asynccancel_2 instead of
8376         __pthread_enable_asynccancel.
8377         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8378         Return result of lock re-get if it fails.
8379         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
8380         for __pthread_cleanup_push.
8381         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
8382         completely broken rwlock implementation.
8383         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8384         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8385         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8386         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
8387         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8388         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
8389         versioned_symbol macro.
8390         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
8391         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8392
8393 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
8394
8395         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
8396         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
8397         and __helper_tid.
8398         (struct timer): Remove th and bar field.
8399         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
8400         debugging code.  Create only one helper thread.
8401         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
8402         helper thread.
8403         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
8404         Renamed.  Define statically.  Use thread info from siginfo.
8405         (__helper_once): New variable.
8406         (__helper_tid): New variable.
8407         (__reset_helper_control): New function.
8408         (__start_helper_thread): New function.
8409
8410         * pthread_create.c (start_thread): Don't use setjmp inside
8411         __builtin_expect to work around gcc bug.
8412
8413         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
8414         timer_delete syscall fails, but not with ENOSYS, set
8415         __no_posix_timers.
8416
8417         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
8418         (timer_settime): Fix typo.
8419         * sysdeps/unix/sysv/linux/timer_getoverr.c
8420         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
8421
8422 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
8423
8424         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
8425         offset of cleanupbuf.__prev.
8426
8427 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
8428
8429         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
8430         of included file.
8431
8432 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
8433
8434         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
8435         NULL provide default definition to syscall.
8436
8437 2003-03-25  Roland McGrath  <roland@redhat.com>
8438
8439         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
8440         (timer_id2ptr): Fix typo.
8441
8442 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
8443
8444         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
8445         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
8446         * sysdeps/ia64/pthreaddef.h: Likewise.
8447         * sysdeps/powerpc/pthreaddef.h: Likewise.
8448         * sysdeps/s390/pthreaddef.h: Likewise.
8449         * sysdeps/sh/pthreaddef.h: Likewise.
8450         * sysdeps/x86_64/pthreaddef.h: Likewise.
8451         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
8452         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
8453         being changed.
8454         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
8455         SIGTIMER is not unblocked.
8456         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
8457         RT signal taken.
8458         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
8459         be send.
8460         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
8461         pass pointer through as ID.
8462         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
8463         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
8464         * sysdeps/unix/sysv/linux/timer_create.c: New file.
8465         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
8466         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
8467         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
8468         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
8469         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
8470         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
8471         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
8472         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
8473         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
8474         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
8475         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
8476         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
8477         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
8478         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
8479         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
8480         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
8481         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
8482         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
8483         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
8484         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
8485         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
8486         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
8487         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
8488         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
8489         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
8490         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
8491         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
8492         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
8493         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
8494         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
8495
8496         * pthreadP.h: Remove FRAME_LEFT definition.
8497         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
8498         already left frame.  Programs which have this problem are not POSIX
8499         compliant.
8500         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
8501
8502 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
8503
8504         * sysdeps/pthread/tst-timer.c: Check return values of the
8505         functions we test.
8506
8507 2003-03-23  Roland McGrath  <roland@redhat.com>
8508
8509         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
8510         * tst-tls3mod.c: Likewise.
8511         * tst-tls1.c: Likewise.
8512         * tst-tls2.c: Likewise.
8513
8514         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
8515         undefined behavior.
8516
8517         * tst-join5.c (tf1, tf2): Add a cast.
8518
8519         * Makeconfig (includes): Append -I$(..)nptl to this variable.
8520
8521         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
8522         Don't test anything.
8523         * tst-cond4.c: Likewise.
8524         * tst-cond6.c: Likewise.
8525         * tst-flock2.c: Likewise.
8526         * tst-mutex4.c: Likewise.
8527         * tst-rwlock4.c: Likewise.
8528         * tst-signal1.c: Likewise.
8529         * tst-spin2.c: Likewise.
8530         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
8531
8532         * tst-mutex4.c: Use test-skeleton.c.
8533         * tst-spin2.c: Likewise.
8534         * tst-sysconf.c: Likewise.
8535         * tst-barrier2.c: Likewise.
8536         * tst-cond4.c: Likewise.
8537         * tst-cond6.c: Likewise.
8538         * tst-rwlock4.c: Likewise.
8539         * tst-unload.c: Likewise.
8540         * tst-flock2.c (do_test): Use return instead of exit.
8541
8542 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
8543
8544         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
8545
8546 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
8547
8548         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8549         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
8550         instead of __lll_compare_and_swap.
8551         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
8552         Likewise.
8553         Removed definition if __lll_compare_and_swap.
8554
8555         * cancellation.c: Adjust for new form of compare&exchange macros.
8556         * cleanup_defer.c: Likewise.
8557         * init.c: Likewise.
8558         * libc-cancellation.c: Likewise.
8559         * old_pthread_cond_broadcast.c: Likewise.
8560         * old_pthread_cond_signal.c: Likewise.
8561         * old_pthread_cond_timedwait.c: Likewise.
8562         * old_pthread_cond_wait.c: Likewise.
8563         * pthread_cancel.c: Likewise.
8564         * pthread_create.c: Likewise.
8565         * pthread_detach.c: Likewise.
8566         * pthread_join.c: Likewise.
8567         * pthread_key_delete.c: Likewise.
8568         * pthread_setcancelstate.c: Likewise.
8569         * pthread_setcanceltype.c: Likewise.
8570         * pthread_timedjoin.c: Likewise.
8571         * pthread_tryjoin.c: Likewise.
8572         * sysdeps/pthread/createthread.c: Likewise.
8573
8574 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
8575
8576         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
8577         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
8578         definitions.  Replace uses with calls to atomic_* functions.
8579         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
8580         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
8581         __lll_test_and_set calls with atomic_exchange_and_add and
8582         atomic_exchange calls respectively.
8583         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
8584         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
8585         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
8586         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
8587         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
8588         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
8589         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
8590
8591         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
8592         returns the old value.
8593
8594 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
8595
8596         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
8597         int for variable OLDVAL and correct inline assembler contraint.
8598         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
8599         type int for variable OLD.
8600
8601         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
8602         only for s390-32.
8603         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8604         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
8605         instead of multiple_threads field in the TCB.
8606
8607 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
8608
8609         * sysdeps/i386/i686/bits/atomic.h: Removed.
8610         * sysdeps/i386/i586/bits/atomic.h: Removed.
8611         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
8612         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
8613         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
8614         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
8615         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
8616         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
8617         * atomic.h: Removed.  Moved to glibc.
8618
8619         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
8620         support for clock selection.
8621
8622         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
8623         signalling waiters.
8624
8625 2003-03-18  Roland McGrath  <roland@redhat.com>
8626
8627         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8628         Add __lll_rel_instr first.  Add memory clobber.
8629         (lll_mutex_unlock): Use __lll_test_and_set.
8630         From Paul Mackerras <paulus@samba.org>.
8631
8632         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
8633         unconditionally.
8634         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8635         (SINGLE_THREAD_P):  Add `header.' prefix.
8636         From Paul Mackerras <paulus@samba.org>.
8637
8638         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
8639         pthread_timedjoin_np to ...
8640         (libpthread: GLIBC_2.3.3): ... here.
8641         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
8642
8643         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8644         Avoid shadowing VAL variable.
8645
8646         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8647         New macro.
8648
8649 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
8650
8651         * Makefile (tests): Add tst-cond11.
8652         * tst-cond11.c: New file.
8653
8654         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
8655         struct passed to cleanup handler to eliminate one more
8656         instruction.
8657         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8658
8659         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8660         (pthrad_cond_t): Replace __unused field with __clock.
8661
8662         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
8663         waken all waiters in cleanup handler.
8664         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8665         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8666
8667         * pthread_condattr_getclock.c: New file.
8668         * pthread_condattr_setclock.c: New file.
8669         * sysdeps/pthread/pthread.h: Declare these new functions.
8670         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
8671         * Makefile (libpthread-routines): Add the new functions.
8672         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
8673         Renamed field to value.  Document use of the bits.
8674         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
8675         change.
8676         * pthread_condattr_setpshared.c: Likewise.
8677         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
8678         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
8679         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8680         Add __clock field.
8681         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8682         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8683         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8684         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8685         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
8686         Implement clock selection.
8687         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8688         * pthread-errnos.sym: Add ENOSYS.
8689         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8690         _POSIX_CLOCK_SELECTION.
8691         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8692
8693         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
8694         invalid .size directive.
8695
8696 2003-03-17  Roland McGrath  <roland@redhat.com>
8697
8698         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
8699         Formatting tweaks.
8700
8701 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8702
8703         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
8704         Use __lll_add instead of spelling it out.  Use protected symbol names.
8705         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
8706         Use __lll_add.
8707         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
8708         Renamed from lll_compare_and_swap.  Use new name where necessary.
8709         (__lll_add): Defined.
8710         (__lll_dec_if_positive): Defined.
8711         (__lll_test_and_set): Defined.
8712         * sysdeps/ia64/pthread_spin_init.c: Removed.
8713         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
8714         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
8715         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
8716         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
8717         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
8718         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
8719         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
8720         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
8721         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
8722         __sync_lock_release_si.
8723         Patch by Jakub Jelinek.
8724
8725         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
8726         Fix timeout handling.
8727         (__lll_timedwait_tid): Likewise.
8728         (lll_unlock_wake_cb): Wake up other waiters if necessary.
8729         Patch by Jakub Jelinek.
8730
8731         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
8732
8733 2003-03-17  Roland McGrath  <roland@redhat.com>
8734
8735         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
8736         * sysdeps/pthread/pthread_spin_init.c: New file.
8737         * sysdeps/pthread/pthread_spin_unlock.c: New file.
8738         * sysdeps/powerpc/Makefile: New file.
8739         * sysdeps/powerpc/pthread_spin_lock.c: New file.
8740         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
8741         * sysdeps/powerpc/pthreaddef.h: New file.
8742         * sysdeps/powerpc/tcb-offsets.sym: New file.
8743         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
8744         * sysdeps/powerpc/tls.h: New file.
8745         * sysdeps/powerpc/bits/atomic.h: New file.
8746         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
8747         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
8748         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
8749
8750         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
8751         * sysdeps/unix/sysv/linux/sem_post.c: New file.
8752         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
8753         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
8754         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
8755         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
8756         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
8757         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
8758         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
8759         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
8760         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
8761         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
8762         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
8763         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
8764         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
8765
8766         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
8767         not gettimeofday.
8768         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
8769         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8770         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
8771         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
8772         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8773
8774 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8775
8776         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
8777         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8778         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8779         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8780         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
8781
8782 2003-03-16  Roland McGrath  <roland@redhat.com>
8783
8784         * tst-fork4.c: Include <string.h>.
8785         * tst-signal2.c: Likewise.
8786         * tst-mutex5.c (do_test): exit -> return.
8787         * tst-mutex2.c: Include <stdlib.h>.
8788
8789 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
8790
8791         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8792         (__lll_mutex_timedlock_wait): Correct expected value after
8793         spurious wakeup.  Otherwise we would never wait again.
8794
8795         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
8796         zone versus inline asm stupidity.  Use correct instructions.
8797
8798         * tst-rwlock6.c: Add some more status output.
8799
8800 2003-03-15  Roland McGrath  <roland@redhat.com>
8801
8802         * sysdeps/pthread/configure.in: New file.
8803         * sysdeps/pthread/configure: New file (generated).
8804
8805 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8806
8807         * allocatestack.c (allocate_stack): Store the exact stack size of
8808         user allocated stacks.
8809
8810 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
8811
8812         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
8813         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
8814         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8815         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
8816         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
8817         Use `header.' prefix.
8818         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8819
8820 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8821
8822         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
8823         __builtin_frame_address, use stack pointer.
8824
8825         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
8826         instead of __builtin_frame_pointer.
8827
8828 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8829
8830         * tst-basic1.c (do_test): Add cast to avoid warning.
8831         * tst-basic2.c (do_test): Likewise.
8832
8833         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
8834         amount of stack correction.
8835
8836         * tst-fork4.c: Use test-skeleton.c.
8837
8838 2003-03-14  Roland McGrath  <roland@redhat.com>
8839
8840         * init.c: Fix typo "#eli" for "#else".
8841
8842 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
8843
8844         * allocatestack.c (__stack_user): Use hidden_data_def.
8845         * pthread_create.c (__pthread_keys): Likewise.
8846
8847         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
8848
8849 2003-03-14  Roland McGrath  <roland@redhat.com>
8850
8851         * tst-fork4.c: New file.
8852         * Makefile (tests): Add it.
8853
8854         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
8855         we always define the padding space.
8856         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
8857         stopped supporting its own extensions fully.
8858         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
8859         struct also called `header', so `header.multiple_threads' is the field
8860         name to use on all machines.
8861         * allocatestack.c (allocate_stack): Use `header.' prefix.
8862         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8863         * pthread_create.c (__pthread_create_2_1): Likewise.
8864         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
8865         (THREAD_SELF): Likewise.
8866         * sysdeps/x86_64/tls.h: Likewise.
8867         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8868         (SINGLE_THREAD_P): Likewise.
8869         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8870         (SINGLE_THREAD_P): Likewise.
8871         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8872         (SINGLE_THREAD_P): Likewise.
8873
8874         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
8875         value directly.
8876
8877 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8878
8879         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
8880         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
8881
8882         * pthread_create.c (start_thread): setjmp is expected to return 0.
8883
8884         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
8885         (THREAD_GETMEM_NC): Likewise.
8886
8887 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
8888
8889         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
8890         and the size of the stack which must be allocated is a multiple,
8891         allocate one more page.
8892         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
8893         MULTI_PAGE_ALIASING.
8894
8895 2003-03-13  Roland McGrath  <roland@redhat.com>
8896
8897         * pthread_create.c (start_thread): Set EXITING_BIT after the
8898         event-reporting (and destructors), not before.
8899
8900 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8901
8902         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8903         lll_futex_wake): Declare register variables as long int instead of
8904         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8905         Make syscall arguments clobbered by the syscall.
8906         (lll_futex_wait): Define using lll_futex_timed_wait.
8907
8908         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8909         to void *.
8910
8911         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8912         PPID if [! NDEBUG].
8913
8914         * allocatestack.c (nptl_ncreated): Only declare if
8915         COLORING_INCREMENT != 0.
8916
8917         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8918         (__libc_enable_asynccancel_2): Remove prototype.
8919
8920         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8921         ctid to match kernel.
8922
8923 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8924
8925         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8926         libc_multiple_threads.
8927         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8928         __libc_multiple_threads to...
8929         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8930
8931         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8932         versioning.
8933         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8934         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8935
8936         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8937         (__pthread_once_internal): Define.
8938
8939         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8940         macros instead of .symver directly.
8941         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8942         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8943
8944         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8945         * sysdeps/x86_64/tcb-offsets.sym: New file.
8946         * sysdeps/x86_64/Makefile: New file.
8947
8948         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8949         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8950         to access own pthread_t in TCB.
8951         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8952         Likewise.
8953         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8954         Likewise.
8955         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8956
8957 2003-03-12  Roland McGrath  <roland@redhat.com>
8958
8959         * pthread-errnos.sym: New file.
8960         * Makefile (gen-as-const-headers): New variable, list that file.
8961         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8962         header <pthread-errnos.h> instead of defining errno values here.
8963         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8964         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8965         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8966         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8967         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8968         Likewise.
8969         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8970         Likewise.
8971         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8972         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8973         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8974         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8975         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8976         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8977         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8978         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8979         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8980         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8981         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8982         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8983         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8984         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8985         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8986         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8987         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8988         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8989         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8990         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8991         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8992         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8993         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8994         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8995         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8996         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8997         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8998
8999         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
9000         CLONE_CHILD_SETTID worked.
9001
9002 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
9003
9004         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
9005         file.
9006         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
9007         file.
9008
9009         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
9010         (pthread_cond_t): Add padding.
9011
9012         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
9013         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
9014         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
9015
9016         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
9017         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
9018         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
9019         (__pthread_rwlock_timedrdlock): Likewise.
9020         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
9021         (__pthread_rwlock_wrlock): Likewise.
9022         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
9023         (__pthread_rwlock_rdlock): Likewise.
9024
9025         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
9026
9027         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
9028         result of lock re-get if it fails.
9029
9030 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
9031
9032         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
9033         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
9034         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
9035         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
9036         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
9037         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9038         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
9039         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
9040         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
9041         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
9042
9043         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
9044         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
9045
9046         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
9047         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
9048         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
9049         (create_thread): Likewise.
9050         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
9051         * init.c (__pthread_initialize_minimal_internal): Initialize
9052         __libc_multiple_threads_ptr if necessary.
9053         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
9054         __pthread_multiple_threads and __libc_multiple_threads_ptr.
9055         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
9056         __libc_multiple_threads.
9057         (__libc_pthread_init): Return pointer to __libc_pthread_init if
9058         necessary.
9059
9060         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
9061         (THREAD_SETMEM_NC): Likewise.
9062
9063         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
9064         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
9065         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
9066         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
9067
9068         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
9069         Eliminate one entire instruction.
9070
9071         * cancellation.c (__pthread_enable_asynccancel_2): New function.
9072         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
9073         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
9074         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
9075         instead of __pthread_enable_asynccancel.
9076         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
9077         (__pthread_cond_wait): Likewise.
9078         * sysdeps/pthread/pthread_cond_timedwait.c
9079         (__pthread_cond_timedwait): Likewise.
9080         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
9081
9082         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
9083         (__condvar_cleanup): Wake up all waiters in case we got signaled
9084         after being woken up but before disabling asynchronous
9085         cancellation.
9086         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
9087         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
9088         (__condvar_cleanup): Likewise.
9089
9090         * init.c (__NR_set_tid_address): If already defined, don't redefine.
9091         Make it an error if architecture has no #if case.  Add x86-64.
9092
9093         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
9094         pt-initfini.s generation.
9095
9096         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
9097         (TLS_INIT_TP): Fix typo.
9098
9099 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
9100
9101         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
9102         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
9103
9104         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
9105         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
9106         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
9107         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
9108         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
9109         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
9110         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
9111         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
9112
9113 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
9114
9115         * sysdeps/pthread/pthread_cond_timedwait.c
9116         (__pthread_cond_timedwait): Return the result of the final
9117         locking.  If it succeeds, the regular function return value.
9118
9119         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
9120         Return result of the final locking.
9121         * version.c (__nptl_main): Work around problems with the strange
9122         INTERNAL_SYSCALL macro on ppc32.
9123         * init.c (__pthread_initialize_minimal_internal): Unblock
9124         SIGCANCEL in case the parent blocked it.
9125         Reported by Paul Mackerras <paulus@samba.org>.
9126
9127         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
9128         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
9129         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
9130
9131 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
9132
9133         * sysdeps/pthread/pthread_cond_timedwait.c
9134         (__pthread_cond_timedwait): Unlock and fail if
9135         __pthread_mutex_unlock_internal failed.
9136
9137         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
9138         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
9139         Use ARCH_CLONE.
9140         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
9141         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
9142         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
9143         ALLOCATE_STACK): New macros.
9144         (TLS_TPADJ): New macro.
9145         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
9146         (allocate_stack): Handle TLS_DTV_AT_TP and
9147         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
9148         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
9149         Don't set PD->self.
9150         * init.c [__ia64__] (__NR_set_tid_address): Define.
9151
9152         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
9153         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
9154         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
9155         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
9156         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
9157         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
9158         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
9159         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
9160         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
9161         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
9162         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
9163         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
9164         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
9165         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
9166         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
9167         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
9168         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
9169         * sysdeps/ia64/bits/atomic.h: New file.
9170         * sysdeps/ia64/Makefile: New file.
9171         * sysdeps/ia64/pthread_spin_init.c: New file.
9172         * sysdeps/ia64/pthread_spin_lock.c: New file.
9173         * sysdeps/ia64/pthread_spin_trylock.c: New file.
9174         * sysdeps/ia64/pthread_spin_unlock.c: New file.
9175         * sysdeps/ia64/pthreaddef.h: New file.
9176         * sysdeps/ia64/tcb-offsets.sym: New file.
9177         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
9178         * sysdeps/ia64/tls.h: New file.
9179
9180         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
9181         to syscall instead of no arguments.
9182
9183 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
9184
9185         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
9186         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
9187         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
9188         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
9189
9190         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
9191         unused code.
9192
9193         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
9194
9195         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
9196         lowlevelbarrier.sym.
9197         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
9198         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
9199         Include lowlevelbarrier.h and don't define offsets locally.
9200         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
9201
9202         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
9203         (__lll_mutex_lock_wait): Reverse order of first two parameters.
9204         (__lll_mutex_timedlock_wait): Likewise.
9205         (lll_mutex_lock): Adjust asm for that.
9206         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
9207         (lll_lock): Adjust asm for operand order change.
9208         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
9209         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
9210
9211         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
9212         Reverse order of parameters.
9213         (__lll_timedwait_tid): Remove regparms attribute.
9214         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
9215         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
9216
9217         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9218         (__lll_timedwait_tid): Remove one unnecessary instruction.
9219
9220         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
9221         __lll_mutex_timedlock_wait only for NOT_IN_libc.
9222         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
9223         lowlevelmutex.S.
9224
9225         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
9226         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
9227         for NOT_IN_libc.
9228         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
9229         lowlevellock.S.
9230
9231         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
9232         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
9233         for libc.so.
9234         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
9235         define LOCK here (if UP is not defined).  The actual code is in
9236         lowlevelmutex.S.
9237
9238         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
9239         LOCK is already defined.  Don't define lll_unlock_wake_cb and
9240         __lll_timedwait_tid for libc.so.
9241         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
9242         define LOCK here (if UP is not defined).  The actual code is in
9243         lowlevellock.S.
9244
9245         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
9246         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
9247         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
9248         instead of lowlevelsem.h.
9249         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
9250         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
9251         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
9252
9253         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
9254         lowlevelrwlock.sym.
9255         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
9256         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
9257         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
9258
9259         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
9260         register loading.
9261         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
9262         last changed.  D'oh.
9263
9264         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
9265
9266         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
9267         of __libc_locking_needed.
9268         (lll_trylock): Initialize %eax to zero.
9269
9270         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
9271         pthread_cond_t definition.
9272
9273 2003-03-10  Roland McGrath  <roland@redhat.com>
9274
9275         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
9276         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
9277         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
9278         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
9279         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
9280
9281         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
9282         Instead of setting PD->multiple_threads, set globals
9283         __pthread_multiple_threads and __libc_multiple_threads.
9284         * sysdeps/pthread/createthread.c (create_thread): Likewise.
9285         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
9286         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
9287
9288         * descr.h (struct pthread): Conditionalize first member on
9289         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
9290         containing an anonymous tcbhead_t.  Move `list' member out.
9291         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
9292         * allocatestack.c: Remove use of `header.data.' prefix.
9293         * pthread_create.c: Likewise.
9294         * init.c (__pthread_initialize_minimal_internal): Likewise.
9295         * sysdeps/pthread/createthread.c (create_thread): Likewise.
9296         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
9297         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
9298         * sysdeps/x86_64/tls.h: Likewise.
9299         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
9300         (SINGLE_THREAD_P): Likewise.
9301         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
9302         (SINGLE_THREAD_P): Likewise.
9303         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
9304         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
9305
9306 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
9307
9308         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
9309
9310         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
9311         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9312
9313         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
9314         leftovers from the ia32 code.
9315
9316         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
9317         memory load.
9318         (clear_once_control): Don't load %esi.
9319
9320         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
9321         handling.
9322
9323         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9324
9325         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
9326         * sysdeps/unix/sysv/linux/createthread.c: ...here.
9327
9328         * Makefile (tests): Add tst-cond10.
9329         * tst-cond10.c: New file.
9330
9331 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
9332
9333         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
9334         * tst-signal3.c (do_test): Likewise.
9335         * tst-sem5.c (do_test): Likewise.
9336         * tst-kill6.c (do_test): Likewise.
9337         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
9338
9339         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
9340         of inc/dec.
9341         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9342         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
9343         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
9344         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
9345         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9346         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9347         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9348         Likewise.
9349         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9350         Likewise.
9351         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
9352         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9353         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9354         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9355         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9356         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9357         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9358         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9359
9360         * allocatestack.c (allocate_stack): If mprotect() fails free the
9361         TLS memory.
9362
9363 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
9364
9365         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
9366
9367         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
9368         lll_wake_tid.  This was used only to work around kernel limits in
9369         the early days.
9370         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
9371         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
9372         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
9373         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
9374
9375         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
9376         (__pthread_initialize_minimal_internal): Change initialization of
9377         __static_tls_align_m1 appropriately.
9378         * pthreadP.h (__static_tls_align_m1): Renamed from
9379         __static_tls_align.
9380         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
9381         instead of __static_tls_align-1.
9382
9383 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
9384
9385         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
9386
9387         * pthread_create.c: Define __pthread_keys using nocommon
9388         attribute, not by placing it explicitly in bss.
9389         Remove DEFINE_DEALLOC definition.  Not needed anymore.
9390
9391         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
9392         Use it in mmap call to allocate stacks.
9393
9394         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
9395
9396         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
9397         result of the thread function.
9398
9399 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
9400
9401         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
9402         version is just fine.
9403
9404         * sysdeps/unix/sysv/linux/libc_pthread_init.c
9405         (__pthread_child_handler): Renamed from pthread_child_handler,
9406         exported, and marked hidden.  Change all users.
9407         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
9408         free __pthread_child_handler from child list.
9409
9410 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9411
9412         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
9413
9414         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
9415         Fix handling of cancellation and failing pthread_mutex_unlock call.
9416         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
9417         (__pthread_cond_wait): Likewise.
9418
9419         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
9420         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
9421         lll_futex_timed_wait call.
9422         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
9423         (pthread_rwlock_timedwrlock): Likewise.
9424
9425         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
9426         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
9427         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
9428
9429         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
9430         check of lll_futex_wake return value.
9431
9432 2003-03-03  Roland McGrath  <roland@redhat.com>
9433
9434         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
9435
9436         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9437         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
9438         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
9439
9440 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
9441
9442         * sysdeps/pthread/timer_create.c (timer_create): Return correct
9443         error for CPU clocks.
9444
9445         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
9446         _POSIX_MONOTONIC_CLOCK.
9447         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
9448
9449         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
9450         recent kernels.
9451
9452 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9453
9454         * descr.h (struct pthread): Move cleanup field to the front.
9455
9456 2003-03-01  Roland McGrath  <roland@redhat.com>
9457
9458         * sem_open.c (sem_open): Braino fix.
9459
9460 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9461
9462         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
9463         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
9464         __pthread_cleanup_pop functionality.
9465         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9466
9467         * descr.h (struct pthread): Move tid field to the front now that
9468         it is often used.
9469
9470         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
9471         (__lll_mutex_timedlock_wait): Remove.
9472         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9473         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
9474         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9475         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9476         (lll_unlock_wake_cb): Don't save and restore %esi.
9477         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9478         %esi.
9479         (__lll_timedwait_tid): Add alignment.
9480         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9481         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9482         %esi.
9483         (__lll_timedwait_tid): Removed.
9484         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
9485         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
9486         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
9487         (pthread_barrier_wait): Don't save, load, and restore %esi for
9488         last thread.
9489         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
9490         (__pthread_cond_signal): Don't save, load, and restore %esi.
9491         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
9492         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
9493         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
9494         Don't save, load, and restore %esi.
9495
9496 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
9497
9498         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
9499         Release lock before waking up the waiters.
9500
9501         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
9502
9503         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
9504         (reader_thread): Likewise.
9505
9506         * sysdeps/pthread/pthread_rwlock_unlock.c
9507         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
9508         to wake up readers if there are none.
9509
9510         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
9511         Release internal lock before wake threads.
9512
9513 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
9514
9515         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
9516         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
9517         predefined.
9518         * tst-rwlock9.c: Likewise.
9519         * tst-rwlock10.c: New file.
9520         * tst-rwlock11.c: New file.
9521
9522         * Makefile (tests): Add tst-dlsym1.
9523         * tst-dlsym1.c: New file.
9524
9525         * init.c (__pthread_initialize_minimal_internal): Set
9526         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
9527         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
9528
9529 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
9530
9531         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
9532
9533         * tst-cond2.c: Fix sychronization with child.
9534
9535         * tst-rwlock8.c (reader_thread): Remove unused variable.
9536
9537         * Makefile: Add rules to build and run tst-tls3.
9538         * tst-tls3.c: New file.
9539         * tst-tls3mod.c: New file.
9540
9541         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
9542         * tst-rwlock8.c: New file.
9543         * tst-rwlock9.c: New file.
9544         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
9545         complete broken rwlock implementation.
9546         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9547         Likewise.
9548         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9549         Likewise.
9550         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9551         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9552         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
9553         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
9554         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
9555         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
9556         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
9557
9558 2003-02-23  Roland McGrath  <roland@redhat.com>
9559
9560         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
9561
9562 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
9563
9564         * Makefile (tests): Add tst-context1.
9565         * tst-context1.c: New file.
9566
9567         * Makefile (tests): Add tst-tls1 and tst-tls2.
9568         * tst-tls1.c: New file.
9569         * tst-tls2.c: New file.
9570
9571         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
9572         for failed cmpxchg.
9573
9574         * pthread_create.c (start_thread): Set EXITING_BIT early.
9575
9576         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
9577         (THREAD_GETMEM_NC): Likewise.
9578
9579 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
9580
9581         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
9582         off 3 more bytes by using offset-less instructions when possible.
9583
9584         * Makefile: Add dependency for $(objpfx)version.d.
9585
9586         * eintr.c (eintr_source): Add unnecessary return but the compiler
9587         insists.
9588
9589         * tst-kill3.c: Include <unistd.h>.
9590
9591 2003-02-21  Roland McGrath  <roland@redhat.com>
9592
9593         * pthread_create.c (start_thread): Call __libc_thread_freeres.
9594
9595 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9596
9597         * Makefile (tests): Add tst-eintr1.
9598         (distribute): Add eintr.c.
9599         * tst-eintr1.c: New file.
9600         * eintr.c: New file.
9601
9602         * pthread_cancel.c (pthread_cancel): Use tkill directly.
9603
9604         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
9605         Disallow sending SIGCANCEL.
9606
9607         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
9608         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
9609         * tst-kill1.c: New file.
9610         * tst-kill2.c: New file.
9611         * tst-kill3.c: New file.
9612         * tst-kill5.c: New file.
9613         * tst-kill6.c: New file.
9614         * tst-basic7.c: Renamed to...
9615         * tst-kill4.c: ...this.
9616
9617 2003-02-21  Roland McGrath  <roland@redhat.com>
9618
9619         * Makefile (install-lib-ldscripts): New variable.
9620
9621 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9622
9623         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
9624         * pthread_cancel.c: Use INVALID_TD_P.
9625         * pthread_detach.c: Likewise.
9626         * pthread_getschedparam.c: Likewise.
9627         * pthread_setschedparam.c: Likewise.
9628         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
9629         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
9630         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
9631         * pthread_timedjoin.c: Likewise.
9632
9633         * tst-basic7.c: Include <signal.h>.
9634
9635         * pthread_join.c (pthread_join): Limited checking for invalid
9636         descriptors.
9637         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
9638
9639 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
9640
9641         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
9642         beginning of the loop.  Clear the entire first block of TSD.
9643         * Makefile (tests): Add tst-key4.
9644         * tst-key4.c: New file.
9645
9646 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
9647
9648         * Makefile (tests): Add tst-basic7.
9649         * tst-basic7.c: New file.
9650
9651         * pthread_create.c (deallocate_tsd): Mark as internal_function.
9652         Add some more __builtin_expect.
9653
9654         * pthreadP.h: Define dummy version of DEBUGGING_P.
9655
9656 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
9657
9658         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
9659         _POSIX_THREAD_PRIORITY_SCHEDULING.
9660         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
9661         _XOPEN_REALTIME_THREADS.
9662         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
9663
9664         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
9665         kernel returns EINVAL for PID <= 0, work around it.
9666
9667         * Makefile (tests): Add tst-signal5.
9668         * tst-signal5.c: New file.
9669
9670         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
9671         and LOGIN_NAME_MAX.
9672
9673         * tst-cancel1.c (tf): Block all signals.
9674
9675         * Makefile (tests): Add tst-basic6.
9676         * tst-basic6.c: New file.
9677
9678         * tst-basic1.c: Add test for process ID.
9679
9680         * Makefile (tests): Add tst-cancel10.
9681         * tst-cancel10.c: New file.
9682
9683         * Makefile (tests): Add tst-signal4.
9684         * tst-signal4.c: New file.
9685
9686         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
9687         __sigismember instead of sigismember.  Add __builtin_expect.
9688
9689 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
9690
9691         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
9692         pthread_setcancelstate, and pthread_rwlock_setpshared.
9693
9694         * tst-cancel7.c (do_test): Make sure the pid file exists before
9695         canceling the thread.
9696
9697         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
9698         pthread_rwlock_timedrdlock tests.
9699         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
9700         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9701         Check for invalid tv_nsec field.
9702         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9703         Likewise.
9704
9705         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
9706         recursive mutex of overflow.
9707
9708         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
9709
9710         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
9711         going into an endless loop.
9712         * Makefile (tests): Add tst-cancel9.
9713         * tst-cancel9.c: New file.
9714
9715         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
9716
9717 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
9718
9719         * tst-mutex5.c (do_test): Add more timedlock tests.
9720
9721         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
9722         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
9723
9724         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
9725         use INLINE_SYSCALL.  Error number is returned, not -1.
9726
9727         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
9728         and __deallocate_stack with internal_function.
9729         * pthread_create.c: Adjust definitions appropriately.
9730         * allocatestack.c: Likewise.
9731
9732         * pthread_join.c: Add one more __builtin_expect.
9733         * pthread_timedjoin.c: Likewise.
9734
9735         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
9736         not data of sequence number does not match.
9737         Add one __builtin_expect.
9738
9739         * Makefile (tests): Add tst-clock1.
9740         * tst-clock1.c: New file.
9741
9742         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
9743         negative arguments.
9744         * Makefile (tests): Add tst-basic5.
9745         * tst-basic5.c: New file.
9746
9747 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
9748
9749         * Makefile (tests): Add tst-basic4.
9750         * tst-basic4.c: New file.
9751
9752         * pthreadP.h: Add declaraction for __nptl_nthreads.
9753         * pthread_create.c: Define __nptl_nthreads
9754         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
9755         after thread is done.  If then zero, call exit(0).
9756         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9757         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
9758         * init.c (pthread_functions): Initialize ptr_nthreads.
9759         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
9760         (__reclaim_stacks): Decrement __nptl_nthreads.
9761         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
9762         Define.
9763         * Makefile (tests): Add tst-basic3.
9764         * tst-basic3.c: New file.
9765
9766         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
9767         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
9768         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
9769         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
9770         if asynchronous canceling is enabled.
9771         * pthread_join.c (pthread_join): When recognizing circular joins,
9772         take into account the other thread might be already canceled.
9773         * Makefile (tests): Add tst-join5.
9774         * tst-join5.c: New file.
9775
9776         * Makefile (tests): Add tst-join4.
9777         * tst-join4.c: New file.
9778
9779 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9780
9781         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
9782
9783 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9784
9785         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
9786         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
9787         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
9788         warning.
9789         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
9790         to avoid warning.
9791         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
9792         error if lll_futex_wake failed.
9793
9794 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9795
9796         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
9797         handling of cancellation and failung pthread_mutex_unlock call.
9798         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9799         * Makefile (tests): Add tst-cond8 and tst-cond9.
9800         * tst-cond8.c: New file.
9801         * tst-cond9.c: New file.
9802
9803         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
9804
9805         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
9806         non-standard initializers with __USE_GNU.
9807
9808         * Makefile (tests): Add tst-cleanup3.
9809         * tst-cleanup3.c: New file.
9810
9811 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
9812
9813         * Makefile (tests): Add tst-attr1 and tst-attr2.
9814         * tst-attr1.c: New file.
9815         * tst-attr2.c: New file.
9816
9817         * Makefile: Add rules to build and run tst-atfork2 test.
9818         * tst-atfork2.c: New file.
9819         * tst-atfork2mod.c: New file.
9820
9821         * sysdeps/unix/sysv/linux/unregister-atfork.c
9822         (__unregister_atfork): Free the memory allocated for the handlers
9823         after removing them from the lists.
9824
9825         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
9826         cleanup function.
9827
9828         * tst-atfork1.c (do_test): Wait for the child we forked.
9829         Report error in child.
9830
9831         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
9832
9833         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
9834
9835 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
9836
9837         * Makefile (tests): Add tst-cancel8.
9838         * tst-cancel8.c: New file.
9839
9840         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
9841         clearing of control variable.
9842         * Makefile (tests): Add tst-once3 and tst-once4.
9843         * tst-once3.c: New file.
9844         * tst-once4.c: New file.
9845
9846 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
9847
9848         * sysdeps/sh/Makefile: New file.
9849         * sysdeps/sh/bits/atomic.h: New file.
9850         * sysdeps/sh/pthread_spin_init.c: New file.
9851         * sysdeps/sh/pthread_spin_lock.c: New file.
9852         * sysdeps/sh/pthread_spin_trylock.S: New file.
9853         * sysdeps/sh/pthread_spin_unlock.S: New file.
9854         * sysdeps/sh/pthreaddef.h: New file.
9855         * sysdeps/sh/tcb-offsets.sym: New file.
9856         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
9857         * sysdeps/sh/tls.h: New file.
9858         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
9859         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
9860         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
9861         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
9862         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
9863         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
9864         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
9865         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
9866         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
9867         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
9868         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
9869         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
9870         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
9871         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
9872         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
9873         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
9874         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
9875         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
9876         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
9877         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
9878         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
9879         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
9880         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
9881         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
9882         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
9883         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
9884         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
9885         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
9886         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
9887         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
9888
9889 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
9890
9891         * tst-cond2.c: Rearrange code to not rely on behavior undefined
9892         according to POSIX.
9893
9894         * tst-basic2.c (do_test): Lock mutex before creating the thread.
9895
9896 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
9897
9898         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
9899         (TLS_GET_FS): New #define.
9900         (TLS_SET_FS): New #define.
9901         Correct value of __NR_set_thread_area.
9902
9903         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9904
9905 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9906
9907         * Makefile (tests): Add tst-popen1.
9908         * tst-popen1.c: New file.
9909
9910         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9911         but inactive generalization.
9912         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9913         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9914         Minor optimization, remove one instruction.
9915         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9916
9917 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9918
9919         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9920
9921 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9922
9923         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9924         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9925         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9926         * sysdeps/pthread/pthread_cond_signal.c: New file.
9927         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9928         * sysdeps/pthread/pthread_cond_wait.c: New file.
9929         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9930         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9931         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9932         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9933         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9934         * sysdeps/s390/Makefile: New file.
9935         * sysdeps/s390/bits/atomic.h: New file.
9936         * sysdeps/s390/pthread_spin_init.c: New file.
9937         * sysdeps/s390/pthread_spin_lock.c: New file.
9938         * sysdeps/s390/pthread_spin_trylock.c: New file.
9939         * sysdeps/s390/pthread_spin_unlock.c: New file.
9940         * sysdeps/s390/pthreaddef.h: New file.
9941         * sysdeps/s390/tcb-offsets.sym: New file.
9942         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9943         * sysdeps/s390/tls.h: New file.
9944         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9945         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9946         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9947         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9948         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9949         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9950         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9951         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9952         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9953         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9954         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9955         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9956         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9957         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9958         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9959         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9960         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9961         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9962         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9963         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9964         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9965         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9966         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9967
9968 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9969
9970         * atomic.h: Add a couple more default implementations.
9971         (atomic_compare_and_exchange_acq): Use
9972         __arch_compare_and_exchange_32_acq in return value definition.  It
9973         always exists.
9974         (atomic_bit_set): Renamed from atomic_set_bit.
9975         Add missing atomic_ prefixes.
9976
9977         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9978         thread library is available, use correct value to mark initialized
9979         once variable.
9980
9981 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9982
9983         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9984         __sysconf to determine pagesize.
9985
9986         * pthread_create.c: Include <atomic.h>.
9987         * allocatestack.c (allocate_stack): Implement coloring of the
9988         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9989         size minus one.  Adjust users.
9990         * sysdeps/i386/i686/Makefile: New file.
9991
9992 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9993
9994         * allocatestack.c: Improve comment throughout the file.
9995
9996         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9997         (__lll_lock_wait): Add branch prediction.
9998         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9999         (__lll_lock_wait): Likewise.
10000         (lll_unlock_wake_cb): Removed.
10001
10002 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
10003
10004         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
10005         _POSIX_THREAD_PRIORITY_SCHEDULING.
10006
10007 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
10008
10009         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
10010         Fix return type of ptr___pthread_getspecific.
10011
10012 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
10013
10014         * Makefile (tests): Add tst-umask1.
10015         (tst-umask1-ARGS): Define.
10016         * tst-umask1.c: New file.
10017
10018 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
10019
10020         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
10021         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
10022         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
10023         pthread_rwlock_unlock.
10024         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
10025         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
10026         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
10027         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
10028         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
10029         New file.
10030         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
10031         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
10032         New file.
10033         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
10034         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
10035         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
10036         New file.
10037         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
10038         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
10039         New file.
10040         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
10041         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
10042         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
10043         New file.
10044         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
10045         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
10046         New file.
10047         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
10048
10049         * Makefile (libpthread-routines): Remove lowlevelcond and
10050         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
10051         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
10052         and pthread_cond_broadcast.
10053         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
10054         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
10055         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
10056         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
10057         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
10058         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
10059         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
10060         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
10061         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
10062         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
10063         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
10064         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
10065         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
10066         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
10067         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
10068         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
10069         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
10070         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
10071         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
10072         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
10073         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
10074         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
10075         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
10076         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
10077         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
10078         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
10079         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
10080         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
10081         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
10082         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
10083         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
10084
10085         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
10086         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
10087         of the code is moved to ...
10088         * sysdeps/pthread/createthread.c: ...here.  New file.
10089
10090 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
10091
10092         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
10093         (__new_sem_post): Clear %eax before returning.
10094         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
10095
10096         * Makefile (tests): Add tst-cleanup2.
10097         * tst-cleanup2.c: New file.
10098
10099         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10100         Interpret first parameter correctly.
10101
10102 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
10103
10104         * Makefile (headers): Add bits/semaphore.h.
10105
10106 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
10107
10108         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
10109         if not SHARED.
10110
10111 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
10112
10113         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
10114         must be used and mapping failed.
10115         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
10116
10117         * Makefile (CFLAGS-pthread_self.os): Define this, not
10118         CFLAGS-pthread_self.c.
10119
10120 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
10121
10122         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
10123         lll_unlock_wake_cb.
10124
10125         * Makefile (libpthread-routines): Add version.  Add rules to build
10126         version.os and banner.h.
10127         * version.c: New file.
10128
10129 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
10130
10131         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
10132         the alias unconditional.
10133         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
10134
10135 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
10136
10137         * Makefile (CFLAGS-pthread_self.c): New definition.
10138
10139 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
10140
10141         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
10142         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
10143         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
10144         * init.c (__pthread_initialize_minimal_internal): Likewise.
10145
10146 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
10147
10148         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
10149
10150         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
10151         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
10152         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
10153         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
10154         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
10155         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
10156
10157 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
10158
10159         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
10160         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
10161         * tst-cancel-wrappers.sh: Remove all exceptions.
10162
10163 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
10164
10165         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
10166         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
10167
10168         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
10169         Use __libc_pthread_functions array if SHARED.
10170
10171         * pthreadP.h: Move pthread_cond_2_0_t definition to...
10172         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
10173
10174         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
10175         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
10176         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
10177         __libc_ptf_call instead of __libc_maybe_call.
10178         (PTF): New #define.
10179         (__libc_cleanup_region_start): Wrap function name with PTF call.
10180         (__libc_cleanup_region_end): Likewise.
10181         (__libc_cleanup_end): Likewise.
10182
10183         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
10184         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
10185         * pthread_key_create.c: Add __pthread_key_create_internal alias.
10186         * pthreadP.h: Add prototypes.
10187
10188         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
10189         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
10190         __pthread_rwlock_unlock aliases.
10191         * pthreadP.h: Add prototypes for new aliases.
10192
10193         * pthreadP.h (struct pthead_functions): Moved to...
10194         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
10195         * init.c (pthread_functions): Add initializers for new elements.
10196
10197         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
10198         __pthread_cleanup_pop_restore aliases.
10199         * pthreadP.h: Add prototypes.
10200
10201         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
10202         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
10203         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
10204         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
10205         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
10206         * pthreadP.h: Adjust prototypes and callers.
10207
10208 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
10209
10210         * Makefile (tests): Add tst-cancel7.
10211         (tst-cancel7-ARGS): New variable.
10212         * tst-cancel7.c: New file.
10213
10214         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
10215         around gcc defficiencies.
10216         * old_pthread_cond_signal.c: Likewise.
10217         * old_pthread_cond_timedwait.c: Likewise.
10218         * old_pthread_cond_wait.c: Likewise.
10219
10220         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
10221
10222 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
10223
10224         * Makefile (tests): Add tst-cond7.
10225         * tst-cond7.c: New file.
10226
10227         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
10228         (condvar_cleanup): Get condvar address from the right place.
10229
10230         * atomic.h: Correct definitions of atomic_full_barrier,
10231         atomic_read_barrier, atomic_write_barrier.
10232
10233         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
10234         race-free.
10235         * old_pthread_cond_signal.c: Likewise.
10236         * old_pthread_cond_timedwait.c: Likewise.
10237         * old_pthread_cond_wait.c: Likewise.
10238
10239 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
10240
10241         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
10242
10243 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
10244
10245         * pthreadP.h (pthread_cond_2_0_t): New type.
10246         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
10247         Use new type for the 2.0 condvar function prototypes.
10248         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
10249         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
10250         parameter.
10251         * old_pthread_cond_destroy.c: Likewise.
10252         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
10253         * old_pthread_cond_signal.c: Likewise.
10254         * old_pthread_cond_timedwait.c: Likewise.
10255         * old_pthread_cond_wait.c: Likewise.
10256
10257         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
10258         (__pthread_cond_wait): Don't save cancellation mode and seq value
10259         in same location.
10260
10261         * herrno.c (__h_errno_location): Don't define as weak.
10262
10263 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
10264
10265         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
10266         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
10267         and pthread_cond_wait.
10268         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
10269         Renamed to...
10270         (__pthread_cond_broadcast_2_0): ... this.
10271         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
10272         Renamed to...
10273         (__pthread_cond_destroy_2_0): ... this.
10274         * old_pthread_cond_init.c (__old_pthread_cond_init):
10275         Renamed to...
10276         (__pthread_cond_init_2_0): ... this.
10277         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
10278         Renamed to...
10279         (__pthread_cond_signal_2_0): ... this.
10280         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
10281         Renamed to...
10282         (__pthread_cond_wait_2_0): ... this.
10283         * pthread_cond_destroy.c: Include shlib-compat.h.
10284         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
10285         * pthread_cond_init.c: Include shlib-compat.h.
10286         (pthread_cond_init): Change strong_alias into versioned_symbol.
10287         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
10288         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
10289         fields.
10290         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
10291         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
10292         __pthread_cond_wait_2_0): New prototypes.
10293         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
10294         __old_pthread_cond_init, __old_pthread_cond_signal,
10295         __old_pthread_cond_wait): Removed.
10296         * init.c: Include shlib-compat.h.
10297         (pthread_functions): Guard ptr___pthread_attr_init_2_0
10298         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
10299         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
10300         ptr___pthread_cond_*_2_0 fields.
10301         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
10302         pthread_cond_*@GLIBC_2.0 compatibility symbols.
10303
10304         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
10305         LIBC_SIGACTION was not yet defined.
10306         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
10307         [!defined LIBC_SIGACTION] (__sigaction): New function and
10308         libc_hidden_weak.
10309         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
10310         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
10311
10312 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
10313
10314         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
10315
10316 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
10317
10318         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
10319         New, larger type definition.
10320         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
10321         implementation.
10322         * Versions [libpthread]: Add definitions for new pthread_cond_*
10323         interfaces for version GLIBC_2.3.2.
10324         * pthread_cond_init.c: Update initialization for new type definition.
10325         * Makefile (libpthread-routines): Remove pthread_cond_wait,
10326         pthread_cond_timedwait, pthread_cond_signal, and
10327         pthread_cond_broadcast.  Add old_pthread_cond_init,
10328         old_pthread_cond_destroy, old_pthread_cond_wait,
10329         old_pthread_cond_timedwait, old_pthread_cond_signal, and
10330         old_pthread_cond_broadcast.
10331         * old_pthread_cond_broadcast.c: New file.
10332         * old_pthread_cond_destroy.c: New file.
10333         * old_pthread_cond_init.c: New file.
10334         * old_pthread_cond_signal.c: New file.
10335         * old_pthread_cond_timedwait.c: New file.
10336         * old_pthread_cond_wait.c: New file.
10337         * pthreadP.h: Add prototypes for the compatibility interfaces.
10338
10339         * pthread_cond_destroy.c: Don't include <errno.h>.
10340
10341 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
10342
10343         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
10344         unnecessary zero offset when addressing MUTEX.
10345
10346 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10347
10348         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
10349         __register_atfork.
10350         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
10351         for __register_atfork.
10352
10353 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10354
10355         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
10356         instead of ASSEMBLER test macro.
10357
10358         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
10359         __libc_current_sigrtmax): Add libc_hidden_def.
10360
10361         * sysdeps/pthread/list.h: Remove assert.h include.
10362
10363 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10364
10365         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
10366         __pthread_initialize_minimal_internal not
10367         __pthread_initialize_minimal.
10368
10369 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
10370
10371         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
10372         __pthread_initialize_minimal as hidden.
10373
10374         * init.c (__pthread_initialize_minimal_internal): Don't mark as
10375         constructor.
10376
10377 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10378
10379         * Makefile ($(inst_libdir)/libpthread.so): Depend on
10380         $(common-objpfx)format.lds, include that into the output script.
10381         Fix comment.
10382         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
10383
10384 2002-12-28  Andreas Jaeger  <aj@suse.de>
10385
10386         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
10387         nsec resolution changes.
10388         (xstat64_conv): Likewise.
10389         (xstat32_conv): Likewise.
10390         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
10391         struct kernel_stat.
10392         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
10393         structs stat and stat64.
10394         * time/time.h (__timespec_defined): Define for __USE_MISC.
10395         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
10396
10397 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
10398
10399         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
10400         argument.
10401         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
10402         (pthread_exit): Use strong_alias to avoid warnings.
10403         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
10404         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
10405         ptr___pthread_attr_init_2_*.
10406         * init.c (pthread_functions): Adjust.
10407
10408 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
10409
10410         * forward.c: Make all functions available by default again.  It
10411         caused too much trouble.
10412
10413         * pt-siglongjmp.c: Removed.
10414
10415 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
10416
10417         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
10418         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
10419         * sysdeps/i386/Makefile: New file.
10420         * sysdeps/i386/tcb-offsets.sym: New file.
10421         * sysdeps/pthread/tcb-offsets.h: New file.
10422         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10423         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
10424
10425         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
10426         __register_atfork...
10427         (GLIBC_2.3.2): ...here.
10428
10429 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10430
10431         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
10432         pthread_attr_setstackaddr with __attribute_deprecated__.
10433
10434 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10435
10436         * pt-system.c (system): Remove cancellation handling.
10437         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
10438         cancellation routines.
10439
10440 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10441
10442         * descr.h: Include <dl-sysdep.h>.
10443         (struct pthread): Move header.data.list to the back of the struct.
10444         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
10445         (MULTIPLE_THREADS_OFFSET): Adjust offset.
10446         (SYSINFO_OFFSEET): Likewise.
10447
10448 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10449
10450         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
10451         Define.
10452         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
10453         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
10454         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
10455         (USE_DL_SYSINFO): Undef.
10456
10457 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
10458
10459         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
10460         $(common-objpfx)libc.so.
10461         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
10462         it is bigger than pipe buffer size even on arches with bigger
10463         page size.
10464         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
10465
10466 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
10467
10468         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
10469         correct errno access for case that USE___THREAD is not defined.
10470
10471 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
10472
10473         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
10474         Patch by Marijn Ros <marijn@mad.scientist.com>.
10475
10476 2002-12-22  Roland McGrath  <roland@redhat.com>
10477
10478         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
10479
10480 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
10481
10482         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
10483
10484 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
10485
10486         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
10487         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
10488         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
10489
10490         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
10491         of int $0x80.
10492         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10493         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
10494         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
10495         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10496         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10497         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
10498         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
10499         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
10500
10501         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
10502         sysenter.
10503         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
10504
10505         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
10506
10507         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
10508         in new TCB.
10509         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
10510         that sysinfo is properly initialized.
10511         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
10512         to 1 only for ld.so.
10513
10514         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
10515         RTLD_CORRECT_DYNAMIC_WEAK.
10516
10517 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
10518
10519         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
10520         Use return 0 as 6th argument to FORWARD4.
10521         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
10522
10523 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10524
10525         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
10526         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
10527         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
10528         (INIT_SYSINFO): New #define.
10529         (TLS_TP_INIT): Use INIT_SYSINFO.
10530         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10531         At test to make sure SYSINFO_OFFSET value is correct.
10532         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
10533
10534 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
10535
10536         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
10537         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
10538         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
10539         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
10540         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
10541         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
10542         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
10543
10544 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10545
10546         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
10547         macro instead of using int $0x80 directly.
10548
10549         * sysdeps/pthread/bits/stdio-lock.h: New file.
10550         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
10551         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
10552         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
10553         * Makefile (routines): Add libc-lowlevelmutex.
10554
10555         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
10556         __i686.get_pc_thunk.dx.
10557
10558 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10559
10560         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
10561         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
10562         ($(objpfx)tst-cancel-wrappers.out): New rule.
10563         * tst-cancel-wrappers.sh: New test.
10564         * tst-locale1.c: Include signal.h.
10565         (uselocale): Test static linking of __libc_current_sigrt*.
10566
10567 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
10568
10569         * Makefile (tests): Add tst-cancel6.
10570         * tst-cancel6.c: New file
10571
10572 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10573
10574         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
10575         Define meaningfully for assembler as well.
10576         * pthreadP.h (struct pthread_functions): Remove
10577         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
10578         and ptr_pthread_attr_init_2_1 fields.
10579         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
10580         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
10581         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
10582         (FORWARD3): Define using FORWARD4.
10583         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
10584         versions.
10585         * pt-system.c: Remove duplicate stdlib.h include.
10586
10587 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
10588
10589         * sem_init.c: Define sem_init@GLIBC_2.0.
10590         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
10591         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
10592
10593         * flockfile.c: Moved to...
10594         * sysdeps/pthread/flockfile.c: ...here.  New file.
10595         * funlockfile.c: Moved to...
10596         * sysdeps/pthread/funlockfile.c: ...here.  New file.
10597         * ftrylockfile.c: Moved to...
10598         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
10599
10600 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
10601
10602         * libc-cancellation.c: Guard both function with
10603         #if !defined NOT_IN_libc.
10604         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
10605         automatically provided pthread wrappers.
10606         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
10607         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
10608         nor in libpthread.
10609         * pt-open.c: Removed.
10610         * pt-fcntl.c: Removed.
10611         * pt-fsync.c: Removed.
10612         * pt-lseek.c: Removed.
10613         * pt-msgrcv.c: Removed.
10614         * pt-msgsnd.c: Removed.
10615         * pt-msync.c: Removed.
10616         * pt-nanosleep.c: Removed.
10617         * pt-open64.c: Removed.
10618         * pt-pause.c: Removed.
10619         * pt-pread.c: Removed.
10620         * pt-pread64.c: Removed.
10621         * pt-pwrite.c: Removed.
10622         * pt-pwrite64.c: Removed.
10623         * pt-read.c: Removed.
10624         * pt-recv.c: Removed.
10625         * pt-recvfrom.c: Removed.
10626         * pt-recvmsg.c: Removed.
10627         * pt-send.c: Removed.
10628         * pt-sendto.c: Removed.
10629         * pt-sigtimedwait.c: Removed.
10630         * pt-sigwait.c: Removed.
10631         * pt-wait.c: Removed.
10632         * pt-waitpid.c: Removed.
10633         * pt-write.c: Removed.
10634         * pt-accept.c: Removed.
10635         * pt-close.c: Removed.
10636         * pt-connect.c: Removed.
10637         * pt-lseek64.c: Removed.
10638         * pt-sendmsg.c: Removed.
10639         * pt-tcdrain.c: Removed.
10640
10641 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
10642
10643         * init.c (__pthread_initialize_minimal_internal): Renamed from
10644         __pthread_initialize_minimal.  Make old name an alias.  This
10645         converts a normal relocation into a relative relocation.
10646
10647         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
10648
10649         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
10650         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
10651         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
10652         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
10653         pt-sigwaitinfo, pt-waitid, and pt-writev.
10654         * pt-creat.c: Removed.
10655         * pt-poll.c: Removed.
10656         * pt-pselect.c: Removed.
10657         * pt-readv.c: Removed.
10658         * pt-select.c: Removed.
10659         * pt-sigpause.c: Removed.
10660         * pt-sigsuspend.c: Removed.
10661         * pt-sigwaitinfo.c: Removed.
10662         * pt-waitid.c: Removed.
10663         * pt-writev.c: Removed.
10664
10665         * init.c (pthread_functions): New variable.
10666         (__pthread_initialize_minimal): Pass pointer to pthread_functions
10667         (or NULL) to __libc_pthread_init.
10668         * forward.c: Rewrite to use __libc:pthread_functions array to get
10669         function addresses.
10670         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
10671         prototype.
10672         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10673         Take new parameter.  Copy content of variable pointed to by it
10674         to __libc_pthread_init.
10675
10676         * pthreadP.h (struct pthread_functions): New type.
10677         (__libc_pthread_init): Declare.
10678
10679         * pthread_attr_destroy.c: Add namespace protected alias.
10680         * pthread_attr_getdetachstate.c: Likewise.
10681         * pthread_attr_getinheritsched.c: Likewise.
10682         * pthread_attr_getschedparam.c: Likewise.
10683         * pthread_attr_getschedpolicy.c: Likewise.
10684         * pthread_attr_getscope.c: Likewise.
10685         * pthread_attr_setdetachstate.c: Likewise.
10686         * pthread_attr_setinheritsched.c: Likewise.
10687         * pthread_attr_setschedparam.c: Likewise.
10688         * pthread_attr_setschedpolicy.c: Likewise.
10689         * pthread_attr_setscope.c: Likewise.
10690         * pthread_cond_broadcast.c: Likewise.
10691         * pthread_cond_destroy.c: Likewise.
10692         * pthread_cond_init.c: Likewise.
10693         * pthread_cond_signal.c: Likewise.
10694         * pthread_cond_wait.c: Likewise.
10695         * pthread_condattr_destroy.c: Likewise.
10696         * pthread_condattr_init.c: Likewise.
10697         * pthread_equal.c: Likewise.
10698         * pthread_exit.c: Likewise.
10699         * pthread_getschedparam.c: Likewise.
10700         * pthread_self.c: Likewise.
10701         * pthread_setcancelstate.c: Likewise.
10702         * pthread_setschedparam.c: Likewise.
10703         * pthread_mutex_destroy.c: Likewise.
10704         * pthread_mutex_init.c: Likewise.
10705         * pthreadP.h: Add prototypes for the aliases.
10706
10707         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
10708         multiple_threads member in correct TCB to 1.
10709
10710         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
10711         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
10712         member of thread decriptor, otherwise return unconditionally 1.
10713
10714 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10715
10716         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
10717         regular Linux version.  Remove file.
10718         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
10719         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
10720         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
10721         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
10722         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
10723         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
10724         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
10725         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
10726         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
10727         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
10728         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
10729         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
10730         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
10731         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
10732         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
10733         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
10734         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
10735         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
10736         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
10737         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
10738         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
10739         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
10740         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
10741         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
10742         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
10743         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
10744         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
10745         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
10746         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
10747         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
10748
10749 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10750
10751         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
10752         * sysdeps/unix/sysv/linux/open.c: Removed.
10753         * sysdeps/unix/sysv/linux/fsync.c: Removed.
10754         * sysdeps/unix/sysv/linux/lseek.c: Removed.
10755         * sysdeps/unix/sysv/linux/msync.c: Removed.
10756         * sysdeps/unix/sysv/linux/read.c: Removed.
10757         * sysdeps/unix/sysv/linux/close.c: Removed.
10758         * sysdeps/unix/sysv/linux/creat.c: Removed.
10759         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
10760         * sysdeps/unix/sysv/linux/pause.c: Removed.
10761         * sysdeps/unix/sysv/linux/select.c: Removed.
10762         * sysdeps/unix/sysv/linux/write.c: Removed.
10763
10764 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10765
10766         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
10767         element in TCB to see whether locking is needed.
10768
10769         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
10770         MULTIPLE_THREADS_OFFSET value is correct.
10771
10772         * sysdeps/unix/sysv/linux/close.c: New file.
10773         * sysdeps/unix/sysv/linux/connect.S: New file.
10774         * sysdeps/unix/sysv/linux/creat.c: New file.
10775         * sysdeps/unix/sysv/linux/fsync.c: New file.
10776         * sysdeps/unix/sysv/linux/llseek.c: New file.
10777         * sysdeps/unix/sysv/linux/lseek.c: New file.
10778         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
10779         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
10780         * sysdeps/unix/sysv/linux/msync.c: New file.
10781         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
10782         * sysdeps/unix/sysv/linux/open.c: New file.
10783         * sysdeps/unix/sysv/linux/open64.c: New file.
10784         * sysdeps/unix/sysv/linux/pause.c: New file.
10785         * sysdeps/unix/sysv/linux/poll.c: New file.
10786         * sysdeps/unix/sysv/linux/pread.c: New file.
10787         * sysdeps/unix/sysv/linux/pread64.c: New file.
10788         * sysdeps/unix/sysv/linux/pselect.c: New file.
10789         * sysdeps/unix/sysv/linux/pwrite.c: New file.
10790         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
10791         * sysdeps/unix/sysv/linux/readv.c: New file.
10792         * sysdeps/unix/sysv/linux/recv.S: New file.
10793         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
10794         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
10795         * sysdeps/unix/sysv/linux/select.c: New file.
10796         * sysdeps/unix/sysv/linux/send.S: New file.
10797         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
10798         * sysdeps/unix/sysv/linux/sendto.S: New file.
10799         * sysdeps/unix/sysv/linux/sigpause.c: New file.
10800         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
10801         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
10802         * sysdeps/unix/sysv/linux/sigwait.c: New file.
10803         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
10804         * sysdeps/unix/sysv/linux/system.c: New file.
10805         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
10806         * sysdeps/unix/sysv/linux/wait.c: New file.
10807         * sysdeps/unix/sysv/linux/waitid.c: New file.
10808         * sysdeps/unix/sysv/linux/waitpid.c: New file.
10809         * sysdeps/unix/sysv/linux/writev.c: New file.
10810         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
10811
10812         * pt-readv.c: Fix comment.
10813
10814 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10815
10816         * tst-cleanup1.c: Include stdlib.h.
10817
10818         * tst-cancel5.c: New test.
10819         * Makefile (tests): Add tst-cancel5.
10820         (tst-cancel5): Link against libc.so libpthread.so in that order.
10821
10822 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
10823
10824         * forward.c (test_loaded): Prevent recursive calls.
10825
10826         * Makefile (routines): Add libc-cancellation.
10827         * libc-cancellation.c: New file.
10828         * descr.h (struct pthread): Add multiple_threads field.
10829         * allocatestack.c (allocate_stack): Initialize multiple_header field of
10830         new thread descriptor to 1.
10831         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
10832         Initialize multiple_thread field after successful thread creation.
10833         * cancellation.c (__do_cancel): Move to pthreadP.h.
10834         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
10835         (__pthread_disable_asynccancel): Add internal_function attribute.
10836         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
10837         * pthread_setcancelstate.c: Likewise.
10838         * pthread_setcanceltype.c: Likewise.
10839         * pthread_exit.c: Likewise.
10840         * pthreadP.h (CANCELLATION_P): Likewise.
10841         (__do_cancel): Define as static inline.
10842         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
10843         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
10844         declarations.
10845         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
10846         fields.  Define MULTIPLE_THREADS_OFFSET.
10847         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
10848         declaration.
10849         * sysdeps/unix/sysv/linux/accept.S: New file.
10850         * sysdeps/unix/sysv/linux/read.c: New file.
10851         * sysdeps/unix/sysv/linux/write.c: New file.
10852         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
10853         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
10854         initialization of __libc_locking_needed.
10855         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
10856         __libc_locking_needed, use multiple_threads field in TCB.
10857         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10858
10859 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10860
10861         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
10862         version.
10863         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
10864
10865         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
10866         access to __libc_locking_needed for PIC.
10867
10868 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
10869
10870         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
10871         declare for libc.so.
10872         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
10873         expression.
10874         (__libc_lock_lock): Put into statement expression.
10875         (__libc_lock_unlock): Remove trailing semicolon.
10876         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
10877
10878 2002-12-12  Roland McGrath  <roland@redhat.com>
10879
10880         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
10881         "m" constraint to refer to __libc_locking_needed.  Declare it here.
10882
10883 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10884
10885         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
10886         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
10887         Initialize __libc_locking_needed.
10888         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
10889         instead of __register_pthread_fork_handler.
10890         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
10891         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
10892         fork-gen with libc_pthread_init.
10893         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
10894         of __register_pthread_fork_handler.
10895         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
10896         of __register_pthread_fork_handler.
10897         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
10898         __libc_locking_needed to determine whether lock prefix can be avoided.
10899         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10900
10901 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10902
10903         * Makefile (tests): Add tst-cleanup1.
10904         * tst-cleanup1.c: New file.
10905         * cancellation.c (__cleanup_thread): Removed.
10906         (__do_cancel): Remove call to __cleanup_thread.
10907         * pthreadP.h: Remove __cleanup_thread prorotype.
10908
10909         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10910         Remember function and argument even if cancellation handler
10911         function is not available.
10912         (__libc_cleanup_region_end): Execute registered function directly if
10913         pthread functions are not available.
10914         (__libc_cleanup_end): Likewise.
10915
10916         * init.c (__pthread_initialize_minimal): Fix initialization in
10917         static lib by preventing gcc from being too clever.
10918
10919 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10920
10921         * init.c (__pthread_initialize_minimal): Remove unneccesary
10922         sigaddset call.
10923
10924         * Makefile (tests): We can run tst-locale2 now.
10925
10926 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10927
10928         * Versions: Remove duplicated sigwait entry.
10929
10930 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10931
10932         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10933         inside libpthread.
10934
10935         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10936
10937         * pthreadP.h: Declare __pthread_enable_asynccancel and
10938         __pthread_disable_asynccancel.
10939         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10940         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10941         * cancellation.c (__pthread_enable_asynccancel): New function.
10942         (__pthread_disable_asynccancel): New function.
10943         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10944         * pt-close.c: Likewise.
10945         * pt-connect.c: Likewise.
10946         * pt-creat.c: Likewise.
10947         * pt-fcntl.c: Likewise.
10948         * pt-fsync.c: Likewise.
10949         * pt-lseek.c: Likewise.
10950         * pt-lseek64.c: Likewise.
10951         * pt-msgrcv.c: Likewise.
10952         * pt-msgsnd.c: Likewise.
10953         * pt-msync.c: Likewise.
10954         * pt-nanosleep.c: Likewise.
10955         * pt-open.c: Likewise.
10956         * pt-open64.c: Likewise.
10957         * pt-pause.c: Likewise.
10958         * pt-poll.c: Likewise.
10959         * pt-pread.c: Likewise.
10960         * pt-pread64.c: Likewise.
10961         * pt-pselect.c: Likewise.
10962         * pt-pwrite.c: Likewise.
10963         * pt-pwrite64.c: Likewise.
10964         * pt-read.c: Likewise.
10965         * pt-readv.c: Likewise.
10966         * pt-recv.c: Likewise.
10967         * pt-recvfrom.c: Likewise.
10968         * pt-recvmsg.c: Likewise.
10969         * pt-select.c: Likewise.
10970         * pt-send.c: Likewise.
10971         * pt-sendmsg.c: Likewise.
10972         * pt-sendto.c: Likewise.
10973         * pt-sigpause.c: Likewise.
10974         * pt-sigsuspend.c: Likewise.
10975         * pt-sigtimedwait.c: Likewise.
10976         * pt-sigwait.c: Likewise.
10977         * pt-sigwaitinfo.c: Likewise.
10978         * pt-system.c: Likewise.
10979         * pt-tcdrain.c: Likewise.
10980         * pt-wait.c: Likewise.
10981         * pt-waitid.c: Likewise.
10982         * pt-waitpid.c: Likewise.
10983         * pt-write.c: Likewise.
10984         * pt-writev.c: Likewise.
10985         * pthread_join.c: Likewise.
10986         * pthread_timedjoin.c: Likewise.
10987
10988         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10989         (__xpg_sigpause): New function.
10990         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10991
10992 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10993
10994         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10995
10996         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10997         _GI_pthread_cleanup_pop to pthreadP.h.
10998
10999         * ftrylockfile.c: Use _IO_lock_trylock instead of
11000         pthread_mutex_trylock.
11001
11002         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
11003         (CANCEL_RESET): Likewise.
11004         (__pthread_setcanceltype_): Declare.
11005         (__pthread_mutex_lock_internal): Declare.
11006         (__pthread_mutex_unlock_internal): Declare.
11007         (__pthread_once_internal): Declare.
11008         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
11009         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
11010
11011         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
11012         and pthread_mutex_unlock.
11013         * pthread_cond_wait.c: Likewise.
11014         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
11015         * pthread_mutex_unlock.c: Likewise.
11016
11017         * pthread_setcanceltype.c: Add additional alias
11018         __pthread_setcanceltype.
11019
11020         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
11021         * sem_open.c (sem_open): Likewise.
11022         Use __libc_open, __libc_write, and __libc_close instead of
11023         open, write, and close respectively.
11024
11025         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
11026         Rewrite as statement expression since it must return a value.
11027
11028         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
11029         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
11030         __pthread_kill.
11031
11032         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
11033         alias __pthread_once_internal.
11034
11035         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
11036
11037 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
11038
11039         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
11040         * tst-stdio1.c: New file.
11041         * tst-stdio2.c: New file.
11042
11043         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
11044
11045         * Makefile (tests): Comment out tst-locale2 for now.
11046         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
11047
11048         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
11049         -D_IO_MTSAFE_IO.
11050         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
11051         Use _IO_lock_init instead of explicit assignment.
11052
11053         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
11054         Define __libc_lock_* and __libc_lock_recursive macros with
11055         lowlevellock macros, not pthread mutexes.
11056
11057         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
11058         of pthread_mutex_lock.
11059         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
11060         instead of pthread_mutex_unlock.
11061
11062 2002-12-06  Roland McGrath  <roland@redhat.com>
11063
11064         * allocatestack.c (__stack_user): Use uninitialized defn.
11065         * init.c (__pthread_initialize_minimal): Initialize it here.
11066
11067 2002-12-05  Roland McGrath  <roland@redhat.com>
11068
11069         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
11070         string.
11071         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
11072
11073         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
11074         missing & here too.
11075
11076 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
11077
11078         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
11079         lowlevellock.
11080         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
11081         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
11082         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
11083         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
11084         for __libc_lock_* macros.
11085         * Makefile (routines): Add libc-lowlevellock.
11086
11087 2002-10-09  Roland McGrath  <roland@redhat.com>
11088
11089         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
11090         Under [__PIC__], call the function via the pointer fetched for
11091         comparison rather than a call by name that uses the PLT.
11092         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
11093         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
11094         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
11095         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
11096         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
11097
11098 2002-12-04  Roland McGrath  <roland@redhat.com>
11099
11100         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
11101
11102         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
11103         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
11104
11105         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
11106
11107 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
11108
11109         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
11110         a completely opaque, non-integer type.
11111         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
11112
11113 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
11114
11115         * sysdeps/i386/tls.h: Include stdlib.h.
11116         * sysdeps/x86_64/tls.h: Likewise.
11117
11118 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
11119
11120         * Makefile (tests): Add tst-locale2.
11121         (tests-static): Likewise.
11122         * tst-locale2.c: New file.
11123
11124         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
11125         volatile and add memory clobbers to lock operations.
11126
11127 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
11128
11129         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
11130         * sysdeps/i386/i486/bits/atomic.h: New file.
11131         * sysdeps/i386/i586/bits/atomic.h: New file.
11132         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
11133         include i486 version.
11134         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
11135         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
11136         Patch by Marijn Ros <marijn@mad.scientist.com>.
11137
11138         * allocatestack.c (get_cached_stack): Don't crash if we first
11139         found a stack with a larger size then needed.
11140         Reported by Hui Huang <hui.huang@sun.com>.
11141
11142         * Makefile (tests): Add tst-sysconf.
11143         * tst-sysconf.c: New file.
11144
11145         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
11146         PTHREAD_THREADS_MAX.
11147
11148 2002-12-02  Roland McGrath  <roland@redhat.com>
11149
11150         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
11151         Declare using hidden_proto instead of attribute_hidden, so there are
11152         non-.hidden static symbols for gdb to find.
11153         (__pthread_keys): Likewise.
11154         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
11155         * allocatestack.c (__stack_user): Likewise.
11156         * pthread_create.c (__pthread_keys): Likewise.
11157         (__nptl_threads_events, __nptl_last_event): Make these static instead
11158         of hidden.
11159         * pthread_key_create.c (__pthread_pthread_keys_max,
11160         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
11161
11162 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
11163
11164         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
11165         statically.
11166         * tst-locale1.c: New file.
11167
11168         * pthread_cond_timedwait.c: Include <stdlib.h>.
11169
11170         * Makefile (tests): Add tst-fork2 and tst-fork3.
11171         * tst-fork2.c: New file.
11172         * tst-fork3.c: New file.
11173
11174 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
11175
11176         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
11177
11178         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
11179         require it to 200112L.
11180
11181         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
11182         instruction only if HAVE_CMOV is defined.
11183         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
11184
11185         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
11186
11187         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
11188
11189         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
11190
11191         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
11192
11193 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
11194
11195         * sysdeps/x86_64/bits/atomic.h: New file.
11196
11197         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
11198         16-bit operations.
11199
11200         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
11201         possible since gettid cannot fail.
11202
11203         * sysdeps/x86_64/pthreaddef.h: New file.
11204
11205         * sysdeps/i386/pthreaddef.h (gettid): Removed.
11206
11207         * sysdeps/x86_64/pthread_spin_init.c: New file.
11208         * sysdeps/x86_64/pthread_spin_lock.c: New file.
11209         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
11210         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
11211
11212         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
11213         Add missing lock prefix.  Minute optimization.
11214
11215         * tst-spin2.c (main): Also check successful trylock call.
11216
11217         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
11218         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
11219
11220         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
11221         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
11222
11223         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
11224         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
11225         value in case of an error.  Add support for INTERNAL_SYSCALL.
11226
11227         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
11228         value in case of an error.
11229
11230         * sysdeps/x86_64/tls.h: New file.
11231
11232 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
11233
11234         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
11235         takes the array member name and the index as parameters.
11236         (THREAD_SETMEM_NC): Likewise.
11237         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
11238         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
11239         interfaces.
11240
11241         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
11242         to decide which code to use.
11243         (THREAD_SETMEM_NC): Likewise.
11244
11245         * allocatestack.c (queue_stack): Don't remove stack from list here.
11246         Do it in the caller.  Correct condition to prematurely terminate
11247         loop to free stacks.
11248         (__deallocate_stack): Remove stack from list here.
11249
11250 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
11251
11252         * Makefile (tests): Add tst-stack1.
11253         * tst-stack1.c: New file.
11254
11255         * allocatestack.c (allocate_stack): Initialize the TCB on a user
11256         provided stack.
11257
11258         * pthread_attr_getstack.c: Return bottom of the thread area.
11259
11260 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
11261
11262         * Makefile (libpthread-routines): Add pt-allocrtsig and
11263         pthread_kill_other_threads.
11264         * pt-allocrtsig.c: New file.
11265         * pthread_kill_other_threads.c: New file.
11266         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
11267         all three functions.
11268         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
11269         allocrtsig.
11270         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
11271         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
11272         and __libc_allocate_rtsig_private.
11273         * Versions (libpthread): Export pthread_kill_other_threads_np,
11274         __libc_current_sigrtmin, and __libc_current_sigrtmax.
11275
11276 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
11277
11278         * allocatestack.c (allocate_stack): stackaddr in attribute points to
11279         the end of the stack.  Adjust computations.
11280         When mprotect call fails dequeue stack and free it.
11281         * pthread_attr_setstack.c: Store top of the stack in stackaddr
11282         attribute.
11283         * pthread_getattr_np.c: Likewise.
11284
11285         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
11286         surprises.
11287
11288 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
11289
11290         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
11291         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11292
11293 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
11294
11295         * pthread_getspecific.c: Optimize access to first 2nd-level array.
11296         * pthread_setspecific.c: Likewise.
11297
11298 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
11299
11300         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
11301         definitions.  Get them from the official place.
11302         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
11303
11304         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
11305         Use new CLONE_ flags in clone() calls.
11306
11307         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
11308         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
11309
11310         * Versions: Add pthread_* functions for libc.
11311         * forward.c: New file.
11312
11313         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
11314         errno-loc.
11315         * herrno.c: New file.
11316         * res.c: New file.
11317
11318         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
11319         sem_trywait, and sem_timedwait.  Add herrno and res.
11320         * sem_init.c: Don't initialize lock and waiters members.
11321         * sem_open.c: Likewise.
11322         * sem_post.c: Removed.
11323         * sem_wait.c: Removed.
11324         * sem_trywait.c: Removed.
11325         * sem_timedwait.c: Removed.
11326         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
11327         Includes full implementations of sem_post, sem_wait, sem_trywait,
11328         and sem_timedwait.
11329         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
11330         for new implementation.
11331         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
11332         and waiters fields.
11333
11334         * tst-sem3.c: Improve error message.
11335         * tst-signal3.c: Likewise.
11336
11337         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
11338         to tell the kernel about the termination futex and to initialize tid
11339         member.  Don't initialize main_thread.
11340         * descr.h (struct pthread): Remove main_thread member.
11341         * cancelllation.c (__do_cancel): Remove code handling main thread.
11342         The main thread is not special anymore.
11343
11344         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
11345         size of the stacks to stack_cache_actsize.
11346
11347         * pt-readv.c: Add missing "defined".
11348         * pt-sigwait.c: Likewise.
11349         * pt-writev.c: Likewise.
11350
11351 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
11352
11353         * Versions: Export __connect from libpthread.
11354         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11355
11356         * Makefile (libpthread-routines): Add pt-raise.
11357         * sysdeps/unix/sysv/linux/raise.c: New file.
11358         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
11359         * sysdeps/generic/pt-raise.c: New file.
11360
11361         * pthread_cond_init.c: Initialize all data elements of the condvar
11362         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11363
11364         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
11365         * pthread_create.c: Likewise.
11366
11367         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
11368         * tst-key1.c: New file.
11369         * tst-key2.c: New file.
11370         * tst-key3.c: New file.
11371
11372         * Versions: Export pthread_detach for version GLIBC_2.0.
11373         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
11374
11375 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
11376
11377         * pthread_key_create.c: Terminate search after an unused key was found.
11378         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11379
11380         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
11381         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11382
11383 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
11384
11385         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
11386         dynamic lookup for errno in PIC.
11387
11388         * allocatestack.c (get_cached_stack): Rearrange code slightly to
11389         release the stack lock as soon as possible.
11390         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
11391         the static TLS block.
11392         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
11393
11394         * cancellation.c: Renamed from cancelation.c.
11395         * Makefile: Adjust accordingly.
11396         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
11397         * cleanup_defer.c: Use CANCELLATION_P.
11398         * pthread_testcancel.c: Likewise.
11399         * descr.h: Fix spelling in comments.
11400         * init.c: Likewise.
11401         * pthread_getattr_np.c: Likewise.
11402         * pthread_getschedparam.c: Likewise.
11403         * pthread_setschedparam.c: Likewise.
11404         * Versions: Likewise.
11405
11406         * pt-pselect.c: New file.
11407         * Makefile (libpthread-routines): Add pt-pselect.
11408         * Versions: Add pselect.
11409
11410         * tst-cancel4.c: New file.
11411         * Makefile (tests): Add tst-cancel4.
11412
11413 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
11414
11415         * pthread_mutex_lock.c: Always record lock ownership.
11416         * pthread_mutex_timedlock.c: Likewise.
11417         * pthread_mutex_trylock.c: Likewise.
11418
11419         * pt-readv.c: New file.
11420         * pt-writev.c: New file.
11421         * pt-creat.c: New file.
11422         * pt-msgrcv.c: New file.
11423         * pt-msgsnd.c: New file.
11424         * pt-poll.c: New file.
11425         * pt-select.c: New file.
11426         * pt-sigpause.c: New file.
11427         * pt-sigsuspend.c: New file.
11428         * pt-sigwait.c: New file.
11429         * pt-sigwaitinfo.c: New file.
11430         * pt-waitid.c: New file.
11431         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
11432         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
11433         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
11434         * Versions: Add all the new functions.
11435
11436         * tst-exit1.c: New file.
11437         * Makefile (tests): Add tst-exit1.
11438
11439         * sem_timedwait.c: Minor optimization for more optimal fastpath.
11440
11441 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
11442
11443         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
11444
11445         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
11446         call.  pthread_join is an official cancellation point.
11447         * pthread_timedjoin.c: Likewise.
11448
11449         * pthread_cond_wait.c: Revert order in which internal lock are dropped
11450         and the condvar's mutex are retrieved.
11451         * pthread_cond_timedwait.c: Likewise.
11452         Reported by dice@saros.East.Sun.COM.
11453
11454 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
11455
11456         * pthreadP.h: Cut out all type definitions and move them...
11457         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
11458         * pthreadP.h: Include <internaltypes.h>.
11459
11460         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
11461         performance tweaks.
11462
11463         * sem_trywait.c: Shuffle #includes around to get right order.
11464         * sem_timedwait.c: Likewise.
11465         * sem_post.c: Likewise.
11466         * sem_wait.c: Likewise.
11467
11468         * nptl 0.3 released.
11469
11470         * Makefile (tests): Add tst-signal3.
11471         * tst-signal3.c: New file.
11472
11473 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
11474
11475         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
11476         the asms modify the sem object.
11477         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
11478
11479         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
11480         the actual members.
11481         * pthreadP.h (struct sem): New type.  Actual semaphore type.
11482         * semaphoreP.h: Include pthreadP.h.
11483         * sem_getvalue.c: Adjust to sem_t change.
11484         * sem_init.c: Likewise.
11485         * sem_open.c: Likewise.
11486         * sem_post.c: Likewise.
11487         * sem_timedwait.c: Likewise.
11488         * sem_trywait.c: Likewise.
11489         * sem_wait.c: Likewise.
11490
11491 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
11492
11493         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
11494         * tst-basic2.c: New file.
11495         * tst-exec1.c: New file.
11496         * tst-exec2.c: New file.
11497         * tst-exec3.c: New file.
11498
11499         * tst-fork1.c: Remove extra */.
11500
11501         * nptl 0.2 released.  The API for IA-32 is complete.