Invalid timeouts in SH sem_timedwait.
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2012-03-08  Thomas Schwinge  <thomas@codesourcery.com>
2
3         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait): Fix
4         updating nwaiters.
5
6         * tst-sem13.c (do_test): Add another test case.
7         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
8         Fix updating nwaiters.
9
10 2012-03-07  Joseph Myers  <joseph@codesourcery.com>
11
12         [BZ #10545]
13         * sysdeps/pthread/configure.in (libc_cv_forced_unwind): Change
14         link test to a compile test.
15         (libc_cv_c_cleanup): Likewise.  Declare puts rather than including
16         <stdio.h>.
17         * sysdeps/pthread/configure: Regenerated.
18
19 2012-03-07  Ulrich Drepper  <drepper@gmail.com>
20
21         * Makefile (distribute): Remove variable.
22
23 2012-01-23  Thomas Schwinge  <thomas@codesourcery.com>
24
25         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Get rid of
26         superfluous assignment.
27         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c (sem_timedwait):
28         Likewise.
29         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
30         (sem_timedwait): Likewise.
31
32 2012-03-06  Ulrich Drepper  <drepper@gmail.com>
33
34         * sysdeps/pthread/bits/libc-lock.h: Move information not needed in
35         installed headers to...
36         * sysdeps/pthread/bits/libc-lockP.h: ...here.  New file.
37
38 2012-03-06  David S. Miller  <davem@davemloft.net>
39
40         * sysdeps/unix/sysv/linux/sparc/sem_post.c (__new_sem_post): Use
41         atomic_increment and remove unused local variable.
42         (__old_sem_post): Likewise.
43
44 2012-02-27  David S. Miller  <davem@davemloft.net>
45
46         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Don't refer to
47         non-existing __pthread_attr.
48         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
49         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
50         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
51         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
52         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
53
54 2012-02-26  Ulrich Drepper  <drepper@gmail.com>
55
56         * sysdeps/pthread/pthread.h: Define __need_clockid_t for __USE_XOPEN2K.
57
58         * sysdeps/pthread/pthread.h: Define __need_timespec before including
59         <time.h>.
60         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Name pthread_attr_t
61         union.
62         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
63         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
64         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
65         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
66         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
67
68 2012-02-21  Joseph Myers  <joseph@codesourcery.com>
69
70         [BZ #13695]
71         * Makefile (generated): Remove crti.S, crtn.S, defs.h and
72         pt-initfini.s.
73         [crti.S not in sysdirs] (omit-deps): Do not append.
74         [crti.S not in sysdirs] (CFLAGS-pt-initfini.s): Remove variable.
75         [crti.S not in sysdirs] (pt-initfini.c): Remove vpath directive.
76         [crti.S not in sysdirs] ($(objpfx)crti.S): Remove rule.
77         [crti.S not in sysdirs] ($(objpfx)crtn.S): Likewise.
78         [crti.S not in sysdirs] ($(objpfx)defs.h): Likewise.
79         [crti.S not in sysdirs] ($(objpfx)crti.o): Likewise.
80         [crti.S not in sysdirs] ($(objpfx)crtn.o): Likewise.
81         [crti.S in sysdirs] (extra-objs): Append unconditionally.
82         [crti.S in sysdirs] ($(objpfx)crti.o): Define rule
83         unconditionally.
84         * sysdeps/pthread/pt-initfini.c: Remove file.
85
86 2012-02-16  Richard Henderson  <rth@twiddle.net>
87
88         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: Remove file.
89         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: Remove file.
90
91 2012-02-15  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
92
93         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: Remove file.
94
95 2012-02-16  David S. Miller  <davem@davemloft.net>
96
97         * sysdeps/sparc/Makefile: Add -fPIC when building pt-crti.S and crtn.S
98
99 2012-02-15  Marek Polacek  <polacek@redhat.com>
100
101         * sysdeps/unix/sysv/linux/x86_64/Makefile: Remove file.
102
103 2012-02-09  Paul Eggert  <eggert@cs.ucla.edu>
104
105         Replace FSF snail mail address with URLs, as per GNU coding standards.
106
107 2012-02-08  Andreas Schwab  <schwab@linux-m68k.org>
108
109         * Makefile (extra-objs) [crti.S in sysdirs]: Add pt-crti.o.
110
111 2012-02-08  Joseph Myers  <joseph@codesourcery.com>
112
113         Support crti.S and crtn.S provided directly by architectures.
114         * Makefile [crti.S in sysdirs] (omit-deps): Do not append.
115         [crti.S in sysdirs] (CFLAGS-pt-initfini.s): Do not define variable.
116         [crti.S in sysdirs] ($(objpfx)pt-initfini.s): Disable rule.
117         [crti.S in sysdirs] ($(objpfx)crti.S): Likewise.
118         [crti.S in sysdirs] ($(objpfx)crtn.S): Likewise.
119         [crti.S in sysdirs] ($(objpfx)defs.h): Likewise.
120         [crti.S in sysdirs] ($(objpfx)crti.o): Likewise.
121         [crti.S in sysdirs] ($(objpfx)crtn.o): Likewise.
122         [crti.S in sysdirs] (pt-initfini.c): Remove vpath directive.
123         [crti.S in sysdirs] ($(objpfx)crti.o): New rule.
124         * pt-crti.S: New file.
125         * sysdeps/unix/sysv/linux/i386/Makefile: Remove file.
126
127 2012-02-03  Joseph Myers  <joseph@codesourcery.com>
128
129         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
130         macros for PIC register setup.
131         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
132         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
133         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
134         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
135         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
136
137 2012-01-11  Marek Polacek  <polacek@redhat.com>
138
139         * forward.c (FORWARD_NORETURN): Define macro.
140         (__pthread_unwind): Use FORWARD_NORETURN macro to avoid warning.
141         (__pthread_exit): Likewise.
142
143 2012-01-10  Ulrich Drepper  <drepper@gmail.com>
144
145         * sysdeps/pthread/pthread.h: Add const attribute to pthread_equal.
146
147         * pthreadP.h: Add noreturn to __pthread_exit.
148         * sysdeps/pthread/pthread-functions.h: Likewise for ptr___pthread_exit.
149
150 2011-12-30  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
151
152         * sysdeps/unix/sysv/linux/aio_misc.h (__aio_create_helper_thread):
153         Call pthread_attr_setstacksize() with result of
154         __pthread_get_minstack() to account for application TLS usage.
155
156 2012-01-08  Marek Polacek  <polacek@redhat.com>
157
158         * sysdeps/unix/sysv/linux/mq_notify.c: Include <nptl/pthreadP.h>.
159
160 2012-01-07  Ulrich Drepper  <drepper@gmail.com>
161
162         [BZ #13553]
163         * pthreadP.h: Use const instead of __const.
164         * semaphore.h: Likewise.
165         * sysdeps/pthread/bits/libc-lock.h: Likewise.
166         * sysdeps/pthread/bits/sigthread.h: Likewise.
167         * sysdeps/pthread/pthread.h: Likewise.
168
169         * Makefile: Remove elf=yes test, only ELF is supported.
170
171         * shlib-versions: Remove entries for ports architectures.
172
173         In case anyone cares, the IA-64 architecture could move to ports.
174         * sysdeps/ia64/*: Removed.
175         * sysdeps/unix/sysv/linux/ia64/*: Removed.
176
177 2011-12-22  Ulrich Drepper  <drepper@gmail.com>
178
179         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread): Use
180         __pthread_get_minstack.
181         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Likewise.
182
183         [BZ #13088]
184         * sysdeps/unix/sysv/linux/timer_routines.c: Get minimum stack size
185         through __pthread_get_minstack.
186         * nptl-init.c (__pthread_initialize_minimal_internal): Get page size
187         directly from _rtld_global_ro.
188         (__pthread_get_minstack): New function.
189         * pthreadP.h: Declare __pthread_get_minstack.
190         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_get_minstack.
191
192 2011-12-21  Ulrich Drepper  <drepper@gmail.com>
193
194         [BZ #13515]
195         * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
196         Correct reading name from file.
197
198 2011-12-14  Carlos O'Donell  <carlos@systemhalted.org>
199
200         * allocatestack.c (allocate_stack): Return errno on failure.
201
202 2011-12-14  Jeff Law  <law@redhat.com>
203
204         [BZ #5245]
205         * pthread_create.c (__pthread_create_2_1): Translate ENOMEM to EAGAIN.
206
207 2011-11-28  Andreas Schwab  <schwab@redhat.com>
208
209         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Handle
210         EAGAIN from FUTEX_WAIT_REQUEUE_PI.
211         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
212
213 2011-11-15  Ulrich Drepper  <drepper@gmail.com>
214
215         * pthread_getattr_np.c (pthread_getattr_np): Set FD_CLOEXEC for
216         /proc/self/maps.
217
218 2011-10-29  Ulrich Drepper  <drepper@gmail.com>
219
220         [BZ #13358]
221         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
222         (__pthread_cond_timedwait): Initialize %r15 correctly also for code
223         path for kernels with FUTEX_CLOCK_REALTIME.
224         Debugged by H.J. Lu <hjl.tools@gmail.com>.
225
226 2011-10-27  Andreas Schwab  <schwab@redhat.com>
227
228         [BZ #13344]
229         * sysdeps/pthread/pthread.h: Use __THREADNL instead of __THREAD
230         for memory synchronization functions.
231         * semaphore.h: Likewise.
232
233 2011-10-24  Ulrich Drepper  <drepper@gmail.com>
234
235         * tst-cancel7.c: Avoid warning.
236         * tst-mutex6.c: Likewise.
237         * tst-mutex9.c: Likewise.
238         * tst-mutexpi6.c: Likewise.
239
240 2011-10-23  Ulrich Drepper  <drepper@gmail.com>
241
242         * sysdeps/i386/tls.h: Remove #include <list.h>.
243
244 2011-10-15  Ulrich Drepper  <drepper@gmail.com>
245
246         * pthread_create.c (start_thread): Call __ctype_init.
247
248 2011-09-15  Andreas Schwab  <schwab@redhat.com>
249
250         * sysdeps/pthread/list.h: Define only list_t if __need_list_t is
251         defined.
252         (list_add): Add atomic_write_barrier.
253         * descr.h: Define __need_list_t before including <list.h>.
254         * nptl-init.c: Include <list.h>
255         * allocatestack.c: Likewise.
256
257 2011-09-11  Ulrich Drepper  <drepper@gmail.com>
258
259         * sysdeps/i386/tls.h: Remove HAVE_TLS_SUPPORT test.
260         * sysdeps/ia64/tls.h: Likewise.
261         * sysdeps/powerpc/tls.h: Likewise.
262         * sysdeps/s390/tls.h: Likewise.
263         * sysdeps/sh/tls.h: Likewise.
264         * sysdeps/sparc/tls.h: Likewise.
265         * sysdeps/x86_64/tls.h: Likewise.
266
267 2011-09-10  Ulrich Drepper  <drepper@gmail.com>
268
269         * sysdeps/pthread/malloc-machine.h: Define MUTEX_INITIALIZER.
270
271         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Don't handle
272         !USE___THREAD.
273         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
274         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
275         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
276         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
277         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
278         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
279         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
280         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
281         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
282         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
283         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
284         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
285
286         * tst-tls1.c: Support for __thread is now mandatory.
287         * tst-tls2.c: Likewise.
288         * tst-tls3.c: Likewise.
289         * tst-tls3mod.c: Likewise.
290         * tst-tls4.c: Likewise.
291         * tst-tls4moda.c: Likewise.
292         * tst-tls4modb.c: Likewise.
293         * tst-tls5.h: Likewise.
294
295 2011-09-08  Ulrich Drepper  <drepper@gmail.com>
296
297         [BZ #12403]
298         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
299         (pthread_rwlock_timedwrlock): Use correct macro in test.
300         Patch by H.J. Lu <hongjiu.lu@intel.com>.
301
302 2011-09-06  Ulrich Drepper  <drepper@gmail.com>
303
304         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait): Don't
305         use gettimeofday vsyscall, just call gettimeofday.
306         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
307         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
308         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
309         Likewise.
310         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
311         Likewise.
312         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
313         Simplify __vdso_clock_gettime use.
314
315 2011-09-05  David S. Miller  <davem@davemloft.net>
316
317         * sysdeps/unix/sysv/linux/sem_timedwait.c (do_futex_timed_wait):
318         New function.
319         (sem_timedwait): Call it to force an exception region around
320         the async cancel enable and the futex operation.
321         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: Likewise.
322         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: Likewise.
323         * sysdeps/unix/sysv/linux/sem_wait.c (do_futex_wait): New function.
324         (__new_sem_wait): Call it to force an exception region around
325         the async cancel enable and the futex operation.
326         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: Likewise.
327         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: Likewise.
328
329 2011-08-31  Andreas Schwab  <schwab@redhat.com>
330
331         * allocatestack.c (setxid_mark_thread): Ensure that the exiting
332         thread is woken up.
333
334 2011-08-20  David S. Miller  <davem@davemloft.net>
335
336         * Makefile (tst-cleanup0.out): Fix typo in output redirection.
337
338 2011-08-14  Roland McGrath  <roland@hack.frob.com>
339
340         * sysdeps/i386/pthreaddef.h (TCB_ALIGNMENT): Set to 64, optimal on Atom.
341         * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Likewise.
342
343 2011-08-08  Andreas Schwab  <schwab@redhat.com>
344
345         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Maintain aligned
346         stack.
347         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
348         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
349
350 2011-07-22  Ulrich Drepper  <drepper@gmail.com>
351
352         * sysdeps/pthread/unwind-forcedunwind.c (_Unwind_Resume): Add read
353         barrier.
354         (__gcc_personality_v0): Likewise.
355         (_Unwind_ForcedUnwind): Likewise.
356         (_Unwind_GetCFA): Likewise.
357
358 2011-07-14  Roland McGrath  <roland@hack.frob.com>
359
360         * allocatestack.c (__reclaim_stacks): Use uintptr_t cast rather than
361         UINTMAX_C.
362
363 2011-06-30  Ulrich Drepper  <drepper@gmail.com>
364
365         * nptl-init.c (__nptl_set_robust): New function.
366         (pthread_functions): Add reference.
367         * npthreadP.h: Declare __nptl_set_robust.
368         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
369         ptr_set_robust member.
370         * sysdeps/unix/sysv/linux/fork.c: Call set_robust_list syscall in
371         child if threads are used.
372
373 2011-06-14  Andreas Jaeger  <aj@suse.de>
374
375         * pthread_rwlock_init.c: Include <string.h> for memset declaration.
376
377 2011-05-11  Ulrich Drepper  <drepper@gmail.com>
378
379         [BZ #386]
380         * allocatestack.c (allocate_stack): Convert ENOMEM error to EAGAIN.
381
382 2011-04-10  Ulrich Drepper  <drepper@gmail.com>
383
384         [BZ #12650]
385         * allocatestack.c (get_cached_stack): Deallocate DTV entries before
386         clearing memory.
387         Patch partly by Robert Rex <robert.rex@exasol.com>.
388
389 2011-01-19  Roland McGrath  <roland@redhat.com>
390
391         * pthread_cond_wait.c (__pthread_cond_wait): Fix comment typo.
392         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
393         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Likewise.
394         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
395         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Likewise.
396         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Likewise.
397
398 2011-01-16  Andreas Schwab  <schwab@linux-m68k.org>
399
400         * Makefile (test-extras): Add tst-cleanup4aux.
401
402 2011-01-14  Ulrich Drepper  <drepper@gmail.com>
403
404         [BZ #10563]
405         * sysdeps/pthread/setxid.h (__SETXID_1): Add cast to assignment.
406         (__SETXID_2): Likewise.
407         (__SETXID_3): Likewise.
408
409 2011-01-13  Ulrich Drepper  <drepper@gmail.com>
410
411         [BZ #10484]
412         * Versions [libc] (GLIBC_PRIVATE): Export __libc_alloca_cutoff.
413         * alloca_cutoff.c: Add libc_hidden_def.
414
415 2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
416
417         [BZ #12113]
418         * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
419         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
420         of "struct pthread".
421
422 2010-09-21  Andreas Schwab  <schwab@redhat.com>
423
424         * sysdeps/pthread/pthread.h (pthread_cleanup_push)
425         [!__EXCEPTIONS]: Mangle local variable not_first_call.
426         (pthread_cleanup_push_defer_np): Likewise.
427
428 2010-09-03  Ulrich Drepper  <drepper@redhat.com>
429
430         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Expect blocks are
431         small.
432
433 2010-08-10  Dinakar Guniguntala  <dino@in.ibm.com>
434             Stefan Hajnoczi  <stefanha@linux.vnet.ibm.com>
435
436         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: If
437         FUTEX_WAKE_OP fails make sure to call FUTEX_WAKE instead.
438
439 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
440
441         * sysdeps/unix/sysv/linux/i386/Makefile: New file.
442
443 2010-05-01  Alan Modra  <amodra@gmail.com>
444
445         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
446         (PSEUDO): Use correct cr save.  Don't use wrong parm save area
447         to save temps.  Correct cfi for possible later frame manipulation.
448         (DOCARGS_1, UNDOCARGS_1): Use the correct parm save area.
449         (DOCARGS_2, UNDOCARGS_2, DOCARGS_3, UNDOCARGS_3): Likewise.
450         (DOCARGS_4, UNDOCARGS_4, DOCARGS_5, UNDOCARGS_5): Likewise.
451         (DOCARGS_6, UNDOCARGS_6): Likewise.
452         (CENABLE, CDISABLE): Add nops for non-shared calls.
453
454 2010-07-06  Andreas Schwab  <schwab@redhat.com>
455
456         * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
457         Fix type mismatch.
458
459 2010-07-03  Ulrich Drepper  <drepper@redhat.com>
460
461         * tst-abstime.c (do_test): Some more cleanups
462
463 2010-07-02  Ulrich Drepper  <drepper@redhat.com>
464
465         * tst-abstime.c: Correct testing and add test for sem_timedwait.
466
467 2010-07-01  Andreas Schwab  <schwab@redhat.com>
468             Ulrich Drepper  <drepper@redhat.com>
469
470         * Makefile (tests): Add tst-abstime.
471         * tst-abstime.c: New file.
472         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
473         (__lll_timedlock_wait): Check for timestamp before the Epoch.
474         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
475         (__lll_timedlock_wait): Likewise.
476         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
477         (__lll_robust_timedlock_wait): Likewise.
478         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
479         (__pthread_cond_timedwait): Likewise.
480         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
481         (pthread_rwlock_timedrdlock): Likewise.
482         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
483         (pthread_rwlock_timedwrlock): Likewise.
484         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
485         Likewise.
486
487 2010-07-01  Ulrich Drepper  <drepper@redhat.com>
488
489         * Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
490
491 2010-06-01  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>
492
493         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
494         location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
495
496 2010-04-09  Ulrich Drepper  <drepper@redhat.com>
497
498         [BZ #11390]
499         * sysdeps/unix/sysv/linux/pthread_getname.c: New file.
500         * sysdeps/unix/sysv/linux/pthread_setname.c: New file.
501         * nptl/sysdeps/pthread/pthread.h: Declare pthread_getname and
502         pthread_setname.
503         * Makefile (libpthread-routines): Add pthread_getname and
504         pthread_setname.
505         * Versions: Export pthread_getname and pthread_setname for GLIBC_2.12.
506
507 2010-04-05  Thomas Schwinge  <thomas@schwinge.name>
508
509         * sysdeps/pthread/unwind-resume.c: Moved to main tree sysdeps/gnu/.
510         * sysdeps/pthread/rt-unwind-resume.c: Likewise.
511         * sysdeps/pthread/Makefile: Remove csu section and rt section's
512         unwind-resume bits, now in main tree sysdeps/gnu/Makefile instead.
513
514 2010-03-23  Luis Machado  <luisgpm@br.ibm.com>
515
516         * pthread_cond_timedwait.c: Add check for
517         HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
518         (pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
519         INTERNAL_SYSCALL.
520
521 2010-03-09  Ulrich Drepper  <drepper@redhat.com>
522
523         * pthread_create.c (__pthread_create_2_1): If priorities are incorrect
524         and the call fails wake eventually waiting setxid threads.  Don't free
525         stack here if we try starting a thread.
526         * sysdeps/pthread/createthread.c (do_clone): Only wake setxid waiter
527         if the clone call failed.
528
529 2010-03-08  Andreas Schwab  <schwab@redhat.com>
530
531         * pthread_create.c (__pthread_create_2_1): Don't set setxid_futex.
532         * allocatestack.c (get_cached_stack): Set setxid_futex.
533         (allocate_stack): Likewise.
534
535 2010-03-05  Andreas Schwab  <schwab@redhat.com>
536             Ulrich Drepper  <drepper@redhat.com>
537
538         * allocatestack.c (setxid_mark_thread): Delay handling of thread if
539         it is creating a thread or it is just being created.
540         * pthread_create.c (start_thread): Wake setxid thread if it is
541         waiting.
542         (__pthread_create_2_1): Initialize setxid_futex.
543         * sysdeps/pthread/createthread.c (do_clone): Wake setxid thread if it
544         is waiting.
545
546 2010-01-15  Ulrich Drepper  <drepper@redhat.com>
547
548         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
549         Fix unwind info.
550         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
551
552 2010-01-15  Michal Schmidt  <mschmidt@redhat.com>
553
554         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
555         Fix pthread_cond_timedwait with requeue-PI.
556         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
557         Fix pthread_cond_wait with requeue-PI.
558
559 2010-01-14  Ulrich Drepper  <drepper@redhat.com>
560
561         * Versions: Add pthread_mutex_consistent, pthread_mutexattr_getrobust,
562         and pthread_mutexattr_setrobust for GLIBC_2.12.
563         * pthread_mutex_consistent.c: Define alias pthread_mutex_consistent.
564         * pthread_mutexattr_getrobust.c: Define alias
565         pthread_mutexattr_getrobust.
566         * pthread_mutexattr_setrobust.c: Define alias
567         pthread_mutexattr_setrobust.
568
569 2010-01-12  Ulrich Drepper  <drepper@redhat.com>
570
571         * sysdeps/pthread/pthread.h: Cleanup.  Fix up for XPG7.
572
573 2010-01-08  Ulrich Drepper  <drepper@redhat.com>
574
575         * sysdeps/pthread/pthread.h: Fix pthread_mutex_consistent declaration.
576
577 2009-12-18  Thomas Schwinge  <thomas@codesourcery.com>
578
579         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
580         call __gmon_start__.
581         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
582
583 2009-12-17  Ulrich Drepper  <drepper@redhat.com>
584
585         * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
586         using memset.
587
588 2009-12-01  Dinakar Guniguntala  <dino@in.ibm.com>
589
590         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
591         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
592         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex
593         is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI.
594         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
595         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex
596         is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
597         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
598
599 2009-12-12  Ulrich Drepper  <drepper@redhat.com>
600
601         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
602         Don't update nwaiters after invalid timeout is recognized.
603
604 2009-11-27  Thomas Schwinge  <thomas@codesourcery.com>
605
606         * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call
607         __gmon_start__.
608
609 2009-11-27  Andreas Schwab  <schwab@redhat.com>
610
611         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
612         THREAD_SELF->cancelhandling after returning from futex call.
613
614 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
615
616         * tst-sem13.c: New file.
617         * Makefile (tests): Add tst-sem13.
618
619 2009-11-22  Roland McGrath  <roland@redhat.com>
620
621         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
622         instead of recapitulating its contents.
623
624 2009-11-18  Ulrich Drepper  <drepper@redhat.com>
625
626         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
627         optimizations and cleanups.
628
629 2009-11-18  Dinakar Guniguntala  <dino@in.ibm.com>
630
631         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
632         Remove redundant code. Fix cfi offsets.
633         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
634         Fix cfi offsets.
635
636 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
637
638         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
639         reduce size of unwind info.
640
641         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
642         cfi directives.
643         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
644         Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
645
646 2009-11-03  Andreas Schwab  <schwab@linux-m68k.org>
647
648         [BZ #4457]
649         * sysdeps/pthread/unwind-resume.c: Include <libgcc_s.h> and use
650         LIBGCC_S_SO.
651         * sysdeps/pthread/unwind-forcedunwind.c: Likewise.
652
653 2009-10-30  Ulrich Drepper  <drepper@redhat.com>
654
655         * tst-sem11.c (main): Rewrite to avoid aliasing problems.
656
657         [BZ #3270]
658         * allocatestack.c (__nptl_setxid): Perform the operation in multiple
659         steps to avoid races with creation and terminations.
660         * nptl-init.c (sighandler_setxid): Adjust.
661         Patch by Daniel Jacobowitz.
662
663 2009-09-07  Andreas Schwab  <schwab@redhat.com>
664
665         * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.
666
667 2009-09-02  Suzuki K P  <suzuki@in.ibm.com>
668             Joseph Myers  <joseph@codesourcery.com>
669
670         [BZ #7094]
671         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
672         Initialize the sigev_notify field for newly created timer to make sure
673         the timer gets deleted from the active timer's list upon timer_delete.
674
675 2009-08-27  Andrew Stubbs  <ams@codesourcery.com>
676
677         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
678         Correct a logic error.
679
680 2009-08-25  Ulrich Drepper  <drepper@redhat.com>
681
682         * sysdeps/x86_64/tls.h (RTLD_ENABLE_FOREIGN_CALL): Store old value
683         of the field in local variables.
684         (RTLD_FINALIZE_FOREIGN_CALL): Restore rtld_must_xmm_save from local
685         variable and don't unconditionally clear it.
686
687 2009-08-24  Ulrich Drepper  <drepper@redhat.com>
688
689         * pthread_create.c (start_thread): Hint to the kernel that memory for
690         the stack can be reused.  We do not mark all the memory.  The part
691         still in use and some reserve are kept.
692
693 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
694
695         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
696
697 2009-08-11  Ulrich Drepper  <drepper@redhat.com>
698
699         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
700         directives.
701
702 2009-08-10  Ulrich Drepper  <drepper@redhat.com>
703
704         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
705         directives.
706         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
707
708 2009-08-10  Andreas Schwab  <schwab@redhat.com>
709
710         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
711         (__pthread_cond_signal): Don't clobber register used for syscall
712         number.
713
714 2009-08-08  Ulrich Drepper  <drepper@redhat.com>
715
716         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
717         Optimize code path used when FUTEX_CLOCK_REALTIME is supported.
718
719         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
720         (__pthread_cond_wait): Optimize by avoiding use of callee-safe
721         register.
722
723 2009-08-07  Ulrich Drepper  <drepper@redhat.com>
724
725         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Little optimizations
726         enabled by the special *_asynccancel functions.
727         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
728         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
729
730         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include lowlevellock.h.
731
732 2009-08-04  Ulrich Drepper  <drepper@redhat.com>
733
734         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: New file.
735         * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: New file.
736         * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: New file.
737         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Optimize
738         since we can assume the special __*_{en,dis}able_asynccancel
739         functions.
740         (PUSHARGS_*, POPARGS_*, SAVESTK_*, RESTSTK_*): Removed.
741         * sysdeps/x86_64/tcb-offsets.sym: Add cancellation-related bits
742         and PTHREAD_CANCELED.
743
744 2009-07-31  Ulrich Drepper  <drepper@redhat.com>
745
746         * descr.h: Better definition of *_BITMASK macros for cancellation.
747
748 2009-07-29  Ulrich Drepper  <drepper@redhat.com>
749
750         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Define explicitly to 32.
751
752         * sysdeps/x86_64/tls.h (tcbhead_t): Add room for SSE registers the
753         dynamic linker might have to save.
754         Define RTLD_CHECK_FOREIGN_CALL, RTLD_ENABLE_FOREIGN_CALL,
755         RTLD_PREPARE_FOREIGN_CALL, and RTLD_FINALIZE_FOREIGN_CALL.  Pretty
756         printing.
757
758         * sysdeps/x86_64/tcb-offsets.sym: Add RTLD_SAVESPACE_SSE.
759
760 2009-07-28  Ulrich Drepper  <drepper@redhat.com>
761
762         * pthread_mutex_lock.c [NO_INCR] (__pthread_mutex_cond_lock_adjust):
763         New function.
764         * pthreadP.h: Declare __pthread_mutex_cond_lock_adjust.
765         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add ROBUST_BIT.
766         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Don't use
767         requeue_pi for robust mutexes.
768         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
769         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
770         Don't only skip __pthread_mutex_cond_lock.  Call instead
771         __pthread_mutex_cond_lock_adjust.
772         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
773
774         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Minor
775         optimization of PI mutex handling.
776
777 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
778
779         [BZ #10418]
780         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
781         instead of of _acq variants of cmpxchg.
782
783 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
784
785         * sysdeps/x86_64/configure.in: New file.
786
787         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
788         path when not using absolute timeout futex.
789
790 2009-07-20  Ulrich Drepper  <drepper@redhat.com>
791
792         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
793         optimizations of last changes.
794         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
795
796 2009-07-19  Ulrich Drepper  <drepper@redhat.com>
797
798         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
799         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
800         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: If mutex
801         is a PI mutex, then use FUTEX_CMP_REQUEUE_PI.
802         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
803         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: If mutex
804         is a PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
805         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
806
807         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
808         (__pthread_cond_timedwait): Make more robust.
809
810 2009-07-18  Ulrich Drepper  <drepper@redhat.com>
811
812         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
813         (__lll_robust_timedlock_wait): If possible use FUTEX_WAIT_BITSET to
814         directly use absolute timeout.
815
816         * tst-sem5.c (do_test): Add test for premature timeout.
817         * Makefile: Linu tst-sem5 with librt.
818
819         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
820         (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
821         directly use absolute timeout.
822         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
823         (pthread_rwlock_timedrdlock): Likewise.
824
825         * tst-cond11.c (run_test): Add test to check that the timeout is
826         long enough.
827
828         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
829         (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to
830         directly use absolute timeout.
831
832         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
833         (__pthread_cond_wait): Convert to using exception handler instead of
834         registered unwind buffer.
835         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
836         (__pthread_cond_timedwait): Likewise.
837
838 2009-07-17  Ulrich Drepper  <drepper@redhat.com>
839
840         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
841         If possible use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME to directly
842         use absolute timeout.
843
844         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Optimize
845         handling of uncontested semaphore.
846
847         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
848         (__condvar_cleanup): Rewrite to use cfi directives instead of
849         hand-coded unwind tables.
850         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S (__pthread_once):
851         Likewise.
852         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
853         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
854         Likewise.
855
856 2009-06-12  Ulrich Drepper  <drepper@redhat.com>
857
858         * Makefile (libpthread-routines): Add pthread_sigqueue.
859         * Versions: Add pthread_sigqueue for GLIBC_2.11.
860         * sysdeps/pthread/bits/sigthread.h: Declare pthread_sigqueue.
861         * sysdeps/unix/sysv/linux/pthread_sigqueue.c: New file.
862
863 2009-06-11  Ulrich Drepper  <drepper@redhat.com>
864
865         [BZ #10262]
866         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
867         (LOAD_FUTEX_WAIT_ABS): Fix futex parameter in case private futexes
868         cannot be assumed.
869         Patch by Bryan Kadzban <bz-glibc@kdzbn.homelinux.net>.
870
871 2009-05-16  Ulrich Drepper  <drepper@redhat.com>
872
873         * libc-cancellation.c: Move __libc_cleanup_routine to...
874         * libc-cleanup.c: ...here.  New file.
875         * Makefile (routines): Add libc-cleanup.
876
877         * cancellation.c (__pthread_disable_asynccancel): Remove unnecessary
878         test.
879         * libc-cancellation.c: Use <nptl/cancellation.c: to define the code.
880         * sysdeps/pthread/librt-cancellation.c: Likewise.
881
882         [BZ #9924]
883         * nptl-init.c: Renamed from init.c.
884         * Makefile: Change all occurences of init.c to nptl-init.c.
885
886 2009-05-15  Ulrich Drepper  <drepper@redhat.com>
887
888         * cancellation.c (__pthread_disable_asynccancel): Correct the bits
889         to test when deciding on the delay.
890         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
891         * pthread_cancel.c: Close race between deciding on sending a signal
892         and setting the CANCELING_BIT bit.
893
894         * cancellation.c (__pthread_disable_asynccancel): Don't return if
895         thread is canceled.
896         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
897
898 2009-04-27  Ulrich Drepper  <drepper@redhat.com>
899
900         * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
901         is available.
902         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
903         * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
904         * sysdeps/i386/tls.h: Likewise.
905         (tcbhead_t): Add __private_tm member.
906
907 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
908
909         * sem_open.c (sem_open): Rewrite initialization of initsem to
910         avoid warnings.
911
912         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
913         Avoid warning by using may_alias attribute on ptrhack.
914
915 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
916
917         [BZ #10090]
918         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
919         Check policy and priority for validity.
920         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
921
922 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
923
924         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
925         (__pthread_cond_timedwait): Change to use cfi directives instead of
926         hand-coded unwind sections.
927
928 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
929
930         * init.c (nptl_freeres): Compile only for SHARED.
931
932 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
933
934         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
935         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
936         FUTEX_BITSET_MATCH_ANY.
937
938 2009-02-27  Roland McGrath  <roland@redhat.com>
939
940         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
941         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
942
943 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
944
945         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
946         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
947         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
948         200112L to 200809L.
949
950 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
951
952         * sysdeps/pthread/pthread.h: The robust mutex functions are in
953         POSIX 2008.
954
955 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
956
957         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
958         Unify name of include protector macro.
959
960 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
961
962         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
963         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
964
965 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
966
967         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
968         pointer variables.
969
970         * allocatestack.c (__free_stacks): Renamed from free_stacks.
971         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
972         * init.c (nptl_freeres): New function.
973         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
974         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
975         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
976         variable.
977         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
978         load DSO.  Assign last.
979         (__unwind_freeres): New function.
980
981         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
982         for better debugging.  No need to use stack_list_add here.
983
984 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
985
986         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
987         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
988         instead of computing relative timeout.
989         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
990         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
991
992 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
993
994         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
995
996 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
997
998         * sysdeps/pthread/list.h (list_add): Initialize new element first.
999         (list_add_tail): Removed.
1000
1001 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
1002
1003         * (in_flight_stack): New variable.
1004         (stack_list_del): New function.  Use instead of list_del.
1005         (stack_list_add): New function.  Use instead of list_add when adding to
1006         stack_cache and stack_used lists.
1007         (__reclaim_stacks): Complete operations on stack_cache and stack_used lists
1008         when the fork call interrupted another thread.
1009
1010 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
1011
1012         * init.c (__pthread_initialize_minimal_internal): Optimize test
1013         FUTEX_CLOCK_REALTIME a bit.
1014
1015 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
1016
1017         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
1018         only passing five parameters to FUTEX_WAIT_BITSET call.
1019
1020         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1021         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
1022         instead of computing relative timeout.
1023
1024 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
1025
1026         * init.c (__pthread_initialize_minimal_internal): Check for
1027         FUTEX_CLOCK_REALTIME flag.
1028         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
1029         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
1030         relative timeout.
1031
1032         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1033         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
1034         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1035         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1036         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1037         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1038
1039 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
1040
1041         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
1042         loop body instead of ; to avoid gcc warnings.
1043         (pthread_cleanup_pop_restore_np): Likewise.
1044         Patch by Caolán McNamara <caolanm@redhat.com>.
1045
1046 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
1047
1048         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
1049         fast path here, for robust/PI/PP mutexes call
1050         __pthread_mutex_lock_full.  Don't use switch, instead use a series
1051         of ifs according to their probability.
1052         (__pthread_mutex_lock_full): New function.
1053         * pthread_mutex_unlock.c: Include assert.h.
1054         (__pthread_mutex_unlock_usercnt): Handle only the
1055         fast path here, for robust/PI/PP mutexes call
1056         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
1057         of ifs according to their probability.
1058         (__pthread_mutex_unlock_full): New function.
1059         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
1060         (__pthread_mutex_lock_full): Define.
1061
1062 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
1063
1064         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
1065         implementation.  Add necessary padding and.
1066         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
1067         words.
1068
1069 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1070
1071         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
1072         and FUTEX_WAKE_BITSET.
1073
1074 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
1075
1076         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
1077         and FUTEX_WAKE_BITSET.
1078         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1079         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1080         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1081         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1082
1083 2008-11-25  Roland McGrath  <roland@redhat.com>
1084
1085         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
1086         Subdirectories moved to ports repository as
1087         sysdeps/.../nptl subdirectories.
1088
1089 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
1090
1091         [BZ #7008]
1092         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
1093         of old value.
1094         * pthread_cond_init.c (__pthread_cond_init): Fix
1095         cond->__data.__nwaiters initialization.
1096         * Makefile (tests): Add tst-cond23.
1097         * tst-cond23.c: New test.
1098
1099 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
1100
1101         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
1102         arguments.
1103         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
1104         arguments.
1105
1106 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
1107
1108         [BZ #6955]
1109         * pthread_mutex_lock.c: Add support for private PI mutexes.
1110         * pthread_mutex_timedlock.c: Likewise.
1111         * pthread_mutex_trylock.c: Likewise.
1112         * pthread_mutex_unlock.c: Likewise.
1113         Patch mostly by Ben Jackson <ben@ben.com>.
1114
1115 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
1116
1117         [BZ #6843]
1118         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
1119         Increase stack size for helper thread.
1120
1121 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1122
1123         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
1124         assembly with a clobber list for access registers a0 and a1.
1125
1126 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1127
1128         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
1129         to force runp->refcntr to be read from memory.
1130
1131 2008-09-08  Richard Guenther  <rguenther@suse.de>
1132
1133         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
1134         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1135         lll_timedlock, lll_robust_timedlock, lll_unlock,
1136         lll_robust_unlock): Promote private to int.
1137
1138 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
1139
1140         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
1141         ARCH_RETRY_MMAP definitions.
1142         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
1143         Define MAP_STACK when not defined.
1144         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
1145         handling of ARCH_RETRY_MMAP.
1146
1147 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
1148
1149         * tst-align2.c (f): Print message that f is reached.
1150
1151 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
1152
1153         [BZ #6740]
1154         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
1155         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
1156
1157 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
1158
1159         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
1160         SOCK_CLOEXEC if possible.
1161
1162 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
1163
1164         * Makefile (tests): Add tst-rwlock2a.
1165         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
1166         * tst-rwlock2a.c: New file.
1167
1168 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
1169
1170         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
1171
1172 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
1173
1174         * sysdeps/pthread/pthread.h: Fix typo in comment.
1175
1176 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
1177
1178         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
1179         of CPU set to the kernel.
1180
1181 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
1182
1183         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
1184         cfi directives.
1185         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1186         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1187         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1188         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1189         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1190         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1191
1192 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
1193
1194         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
1195         cfi directives.
1196         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1197         Likewise.
1198         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1199         Likewise.
1200         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1201         Likewise.
1202
1203 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
1204
1205         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
1206
1207 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
1208
1209         David S. Miller  <davem@davemloft.net>
1210
1211         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
1212
1213 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
1214
1215         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
1216         __pshared correctly.
1217         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1218         Likewise.
1219         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1220         Likewise.
1221         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1222         Likewise.
1223         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1224         Likewise.
1225         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
1226
1227 2008-04-14  David S. Miller  <davem@davemloft.net>
1228
1229         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
1230         (__old_sem_wait): Fix argument to lll_futex_wait().
1231
1232 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
1233
1234         * pthread_create.c: Require pthread_mutex_trylock and
1235         pthread_key_delete for libgcc.
1236
1237 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
1238
1239         [BZ #6020]
1240         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
1241         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
1242         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
1243
1244 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
1245
1246         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
1247         <linux/limits.h> has defined it.
1248         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1249         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1250         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
1251         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1252
1253 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
1254
1255         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
1256         of ASSEMBLER.
1257         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
1258         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
1259
1260 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
1261
1262         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
1263         HAVE_DL_DISCOVER_OSVERSION.
1264         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
1265         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
1266
1267 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
1268
1269         [BZ #5778]
1270         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
1271         _POSIX_CHOWN_RESTRICTED value to zero.
1272
1273 2008-01-31  Roland McGrath  <roland@redhat.com>
1274
1275         * Makefile (omit-deps): Variable removed.
1276
1277 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
1278
1279         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
1280         unnecessary addr32 prefix.
1281
1282 2008-01-29  Roland McGrath  <roland@redhat.com>
1283
1284         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
1285
1286 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1287
1288         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
1289
1290 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1291
1292         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
1293         a scratch register.
1294         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1295         (__lll_lock_wait_private): Fix typo.
1296         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
1297         (pthread_barrier_wait): Likewise.  Adjust XADD use.
1298         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
1299         Adjust XADD use.
1300         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
1301         (pthread_rwlock_timedrdlock): Return correct return value.
1302         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
1303         (pthread_rwlock_timedwrlock): Likewise.
1304
1305 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
1306
1307         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
1308         thread returns the program exits with an error code.
1309
1310 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
1311
1312         * pthread-errnos.sym: Add EOVERFLOW.
1313         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
1314         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
1315         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1316         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1317
1318 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
1319
1320         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
1321         parameter.  Passed it as permission to mmap.
1322         * allocatestack.c (allocate_stack): Pass prot as second parameter
1323         to ARCH_RETRY_MMAP.
1324
1325 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
1326
1327         * tst-basic7.c: Allocate memory for the stack.
1328
1329         [BZ #5465]
1330         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
1331         (__pthread_cond_timedwait): Don't use VDSO.
1332         Patch by Michal Januszewski.
1333
1334 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
1335
1336         [BZ #5455]
1337         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
1338         Allow label before pthread_cleanup_pop.
1339         (pthread_cleanup_pop_restore_np): Likewise.
1340
1341 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1342
1343         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
1344         Store 2 before returning ETIMEDOUT.
1345
1346 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
1347
1348         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
1349         Store 2 before returning ETIMEDOUT.
1350         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
1351         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1352         (__lll_lock_wait_private): Optimize.
1353         (__lll_lock_wait): Likewise.
1354
1355 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
1356
1357         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
1358         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
1359         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
1360
1361 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
1362
1363         [BZ #5240]
1364         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
1365         If we time out, try one last time to lock the futex to avoid
1366         losing a wakeup signal.
1367         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1368         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1369
1370         [BZ #5245]
1371         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
1372         if necessary.
1373
1374 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
1375
1376         [BZ #5245]
1377         * allocatestack.c (allocate_stack): Change ENOMEM error in case
1378         mmap failed to EAGAIN.
1379         * Makefile (tests): Add tst-basic7.
1380         * tst-basic7.c: New file.
1381
1382 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
1383
1384         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
1385         Use __linkin_atfork.
1386
1387 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
1388
1389         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
1390         missing line continuations.
1391         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
1392         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
1393
1394 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
1395
1396         [BZ #5220]
1397         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
1398         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
1399         (struct timer): Add next element.
1400         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
1401         enqueue timer structure into __active_timer_sigev_thread list.
1402         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
1403         remove timer struct from __active_timer_sigev_thread.
1404         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1405         Before using timer structure make sure it is still on the
1406         __active_timer_sigev_thread list.  Keep lock until done.
1407         Define __active_timer_sigev_thread and
1408         __active_timer_sigev_thread_lock.
1409
1410 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
1411
1412         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
1413         Redefine thread_atfork for use of ATFORK_MEM.
1414         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
1415         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
1416         function.
1417         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1418         Use atomic operation when removing first element of list.
1419
1420 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
1421
1422         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
1423         routine instead of an alias to __new_sem_post.
1424
1425 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
1426
1427         * init.c (__pthread_initialize_minimal): Initialize word to appease
1428         valgrind.
1429
1430 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
1431
1432         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
1433         libc.so just clear NAME.
1434         (__libc_rwlock_fini): Nop inside of libc.so.
1435         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
1436         all zeros.
1437
1438 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
1439
1440         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1441         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
1442         unlocking failed.
1443         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
1444
1445 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
1446
1447         [BZ #4938]
1448         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
1449         reclaimed stack if necessary.
1450         * Makefile (tests): Add tst-tsd6.
1451         * tst-tsd6.c: New file.
1452
1453 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
1454
1455         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
1456         Add private argument.
1457
1458 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
1459
1460         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1461         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
1462
1463 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
1464
1465         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
1466         (__lll_robust_timedlock): Pass private as last argument to
1467         __lll_robust_timedlock_wait.
1468         (__lll_unlock): Fix a pasto.
1469
1470 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
1471
1472         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
1473         sparc_old_sem): New structs.
1474         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
1475         (__sem_wait_cleanup): New function.
1476         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
1477         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1478         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1479         lll_futex_wait.
1480         (__old_sem_wait): New function.
1481         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
1482         nptl/sysdeps/unix/sysv/linux/sparc version.
1483         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
1484         Likewise.
1485         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
1486         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
1487         (__new_sem_trywait): Use sparc_old_sem structure.
1488         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
1489         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
1490         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1491         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1492         lll_futex_timed_wait.
1493         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
1494         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
1495         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1496         lll_futex_wake.
1497         (__old_sem_post): New function.
1498         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
1499         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
1500         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
1501         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
1502         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
1503         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
1504
1505 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1506
1507         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1508         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1509         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1510         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1511         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
1512         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1513         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1514         Use FUTEX_WAKE_OP.
1515         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1516         kernel-features.h and tcb-offsets.h.
1517         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1518         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1519         process private.
1520         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1521         tcb-offsets.h.
1522         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
1523         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1524         process private.
1525         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
1526         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1527         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1528         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1529         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1530         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1531         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1532
1533 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
1534
1535         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
1536         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1537         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
1538         lll_futex_timed_wait.
1539
1540         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
1541         __lll_robust_unlock): Rewrite as macros instead of inline functions.
1542         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
1543         __lll_robust_unlock, __lll_wait_tid): Likewise.
1544
1545 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1546
1547         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1548         Fix a pasto.
1549         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1550         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1551         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1552         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1553         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1554         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1555         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1556         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
1557         kernel-features.h.
1558         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1559         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1560         process private.  Switch DW_CFA_advance_loc1 and some
1561         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1562         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1563         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
1564         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1565         process private.  Switch DW_CFA_advance_loc{1,2} and some
1566         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1567         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
1568         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1569         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1570         Likewise.
1571         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1572         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1573         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1574         Likewise.
1575         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1576         (__pthread_cond_broadcast): Compare %r8 instead of
1577         dep_mutex-cond_*(%rdi) with $-1.
1578         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1579         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
1580         of oring.
1581
1582 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
1583
1584         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
1585
1586 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1587
1588         * allocatestack.c: Include kernel-features.h.
1589         * pthread_create.c: Likewise.
1590         * pthread_mutex_init.c: Likewise.
1591         * init.c: Likewise.
1592         * pthread_cond_timedwait.c: Likewise.
1593         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1594         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1595         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1596         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1597         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1598         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1599         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1600         Likewise.
1601         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1602         Likewise.
1603         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1604         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1605         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1606         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1607
1608 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
1609
1610         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
1611         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1612         byte elements.  One of them is the new __shared element.
1613         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1614         adjust names of other padding elements.
1615         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
1616         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1617         byte elements.  One of them is the new __shared element.
1618         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1619         adjust names of other padding elements.
1620         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
1621         Renamed __pad1 element to __shared, adjust names of other padding
1622         elements.
1623         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1624         (pthread_rwlock_t): Likewise.
1625         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
1626         typo.
1627
1628 2007-08-09  Anton Blanchard  <anton@samba.org>
1629
1630         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
1631
1632 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
1633
1634         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
1635         <kernel-features.h>.
1636         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1637
1638 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
1639
1640         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
1641         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
1642         dealing with robust mutexes.
1643         * pthread_mutex_timedlock.c: Likewise.
1644         * pthread_mutex_trylock.c: Likewise.
1645         * pthread_mutex_unlock.c: Likewise.
1646         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1647
1648 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
1649
1650         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
1651         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
1652         (PTHREAD_MUTEX_PSHARED): Define.
1653         * pthread_mutex_init.c (__pthread_mutex_init): Set
1654         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
1655         mutexes.
1656         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
1657         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
1658         as second argument to lll_lock.
1659         (LLL_MUTEX_TRYLOCK): Take mutex as argument
1660         instead of its __data.__lock field.
1661         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1662         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1663         to lll_robust_lock.
1664         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1665         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
1666         instead of mutex->__data.__kind directly, pass
1667         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
1668         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
1669         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1670         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
1671         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
1672         to lll_timedlock, lll_robust_timedlock, lll_unlock and
1673         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
1674         of mutex->__data.__kind directly.
1675         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
1676         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
1677         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
1678         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
1679         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
1680         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
1681         and lll_futex_wake.
1682         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
1683         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
1684         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1685         directly.
1686         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
1687         Take mutex as argument instead of its __data.__lock field, pass
1688         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
1689         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
1690         __data.__lock field.
1691         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1692         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1693         to lll_robust_cond_lock.
1694         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
1695         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
1696         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
1697         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
1698         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
1699         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
1700         lll_futex_wait.
1701         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
1702         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
1703         lll_futex_wake.
1704         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
1705         pshared variable, pass it to lll_lock, lll_unlock,
1706         lll_futex_timedwait and lll_futex_wake.
1707         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
1708         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
1709         and lll_futex_wake.
1710         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
1711         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
1712         macro.
1713         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
1714         lll_futex_wake_unlock): Likewise.
1715         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
1716         Likewise.
1717         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
1718         lll_futex_wake_unlock): Likewise.
1719         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
1720         Likewise.
1721         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
1722         lll_futex_wake_unlock): Likewise.
1723         (lll_futex_wake): Fix a typo.
1724         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
1725         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1726         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1727         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1728         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1729         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1730         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1731         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1732         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1733         (__pthread_cond_timedwait): Likewise.
1734         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1735         (__condvar_cleanup, __pthread_cond_wait): Likewise.
1736
1737 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
1738
1739         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1740         Don't use CGOTSETUP and CGOTRESTORE macros.
1741         (CGOTSETUP, CGOTRESTORE): Remove.
1742         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
1743         @local symbol.
1744
1745 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1746
1747         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
1748         definitions for private futexes.
1749         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
1750         kernel-features.h and lowlevellock.h.  Use private futexes if
1751         they are available.
1752         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
1753         (__lll_mutex_lock_wait): Rename to
1754         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
1755         (__lll_mutex_timedlock_wait): Rename to ...
1756         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
1757         Don't compile in for libc.so.
1758         (__lll_mutex_unlock_wake): Rename to ...
1759         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
1760         (__lll_timedwait_tid): Use __NR_gettimeofday.
1761         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
1762         the header from assembler.  Renamed all lll_mutex_* resp.
1763         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1764         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
1765         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
1766         Define.
1767         (__lll_lock_wait_private): Add prototype.
1768         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
1769         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
1770         __lll_unlock_wake): Likewise.
1771         (lll_lock): Add private argument.  Call __lll_lock_wait_private
1772         if private is constant LLL_PRIVATE.
1773         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1774         lll_timedlock, lll_robust_timedlock): Add private argument.
1775         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
1776         if private is constant LLL_PRIVATE.
1777         (lll_robust_unlock, lll_robust_dead): Add private argument.
1778         (lll_lock_t): Remove.
1779         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1780         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1781         lll_cond_wake, lll_cond_broadcast): Remove.
1782         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
1783         kernel-features.h and lowlevellock.h.
1784         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1785         (LOAD_FUTEX_WAIT): Define.
1786         (__lll_robust_mutex_lock_wait): Rename to ...
1787         (__lll_robust_lock_wait): ... this.  Add private argument.
1788         Use LOAD_FUTEX_WAIT macro.
1789         (__lll_robust_mutex_timedlock_wait): Rename to ...
1790         (__lll_robust_timedlock_wait): ... this.    Add private argument.
1791         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
1792         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
1793         lowlevellock.h.
1794         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1795         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
1796         __lll_mutex_{lock,unlock}_*.
1797         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
1798         lowlevellock.h and pthread-errnos.h.
1799         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1800         FUTEX_CMP_REQUEUE, EINVAL): Remove.
1801         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
1802         __lll_mutex_{lock,unlock}_*.
1803         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
1804         lowlevellock.h and pthread-errnos.h.
1805         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
1806         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
1807         __lll_mutex_{lock,unlock}_*.
1808         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1809         lowlevellock.h.
1810         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
1811         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
1812         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1813         (__condvar_tw_cleanup): Likewise.
1814         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1815         lowlevellock.h.
1816         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1817         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
1818         __lll_mutex_{lock,unlock}_*.
1819         ( __condvar_w_cleanup): Likewise.
1820         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
1821         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1822         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
1823         lowlevellock.h.
1824         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1825         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
1826         __lll_mutex_{lock,unlock}_*.
1827         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
1828         lowlevellock.h.
1829         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1830         FUTEX_PRIVATE_FLAG): Remove.
1831         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
1832         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1833         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
1834         lowlevellock.h.
1835         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1836         FUTEX_PRIVATE_FLAG): Remove.
1837         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
1838         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1839         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
1840         lowlevellock.h.
1841         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1842         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
1843         __lll_mutex_{lock,unlock}_*.
1844         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
1845         lowlevellock.h.
1846         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1847         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
1848         __lll_mutex_{lock,unlock}_*.
1849         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
1850         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1851         (__new_sem_post): Use standard initial exec code sequences.
1852         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
1853         lowlevellock.h.
1854         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1855         FUTEX_PRIVATE_FLAG): Remove.
1856         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
1857         exec code sequences.
1858         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
1859         (__new_sem_trywait): Use standard initial exec code sequences.
1860         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
1861         (__new_sem_wait): Use standard initial exec code sequences.
1862
1863 2007-07-31  Anton Blanchard  <anton@samba.org>
1864
1865         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1866         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
1867         atomic_full_barrier.
1868
1869 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1870
1871         * allocatestack.c (stack_cache_lock): Change type to int.
1872         (get_cached_stack, allocate_stack, __deallocate_stack,
1873         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
1874         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
1875         as second argument to lll_lock and lll_unlock macros on
1876         stack_cache_lock.
1877         * pthread_create.c (__find_in_stack_list): Likewise.
1878         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
1879         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
1880         as second argument.
1881         * descr.h (struct pthread): Change lock and setxid_futex field
1882         type to int.
1883         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
1884         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
1885         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
1886         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
1887         Likewise.
1888         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
1889         * pthread_cond_init.c (__pthread_cond_init): Likewise.
1890         * pthreadP.h (__attr_list_lock): Change type to int.
1891         * pthread_attr_init.c (__attr_list_lock): Likewise.
1892         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
1893         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
1894         lll_{,un}lock.
1895         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
1896         also for lll_futex_{wake,wait}.
1897         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
1898         a pointer to const.
1899         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
1900         LLL_SHARED as second argument to lll_{,un}lock.
1901         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
1902         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
1903         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
1904         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
1905         Likewise.
1906         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
1907         as second argument to lll_{,un}lock macros on pd->lock.
1908         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
1909         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
1910         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1911         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
1912         Likewise.
1913         * sysdeps/pthread/createthread.c (do_clone, create_thread):
1914         Likewise.
1915         * pthread_once.c (once_lock): Change type to int.
1916         (__pthread_once): Pass LLL_PRIVATE as second argument to
1917         lll_{,un}lock macros on once_lock.
1918         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
1919         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
1920         rwlock->__data.__shared as second argument to them and similarly
1921         for lll_futex_w*.
1922         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
1923         Likewise.
1924         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
1925         Likewise.
1926         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
1927         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
1928         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
1929         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1930         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
1931         to lll_{,un}lock macros on __sem_mappings_lock.
1932         * sem_open.c (check_add_mapping): Likewise.
1933         (__sem_mappings_lock): Change type to int.
1934         * semaphoreP.h (__sem_mappings_lock): Likewise.
1935         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1936         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
1937         instead of lll_*mutex_*, pass LLL_SHARED as last
1938         argument.
1939         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
1940         pass LLL_SHARED as last argument.
1941         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
1942         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
1943         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
1944         pass LLL_SHARED as last argument.
1945         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1946         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
1947         LLL_SHARED as last argument.
1948         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
1949         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
1950         Similarly.
1951         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
1952         __libc_lock_lock_recursive, __libc_lock_unlock,
1953         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
1954         argument to lll_{,un}lock.
1955         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
1956         _IO_lock_unlock): Likewise.
1957         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
1958         compound literal.
1959         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1960         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
1961         __fork_lock.
1962         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
1963         free_mem): Likewise.
1964         (__fork_lock): Change type to int.
1965         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
1966         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
1967         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
1968         lll_futex_wake.
1969         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1970         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
1971         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
1972         New function.
1973         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
1974         pass it through to lll_futex_*wait, only compile in when
1975         IS_IN_libpthread.
1976         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1977         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
1978         argument and pass it through to lll_futex_*wait.
1979         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
1980         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
1981         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
1982         inline functions to __lll_* resp. __lll_robust_*.
1983         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
1984         (lll_mutex_dead): Add private argument.
1985         (__lll_lock_wait_private): New prototype.
1986         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
1987         __lll_robust_lock_timedwait): Add private argument to prototypes.
1988         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
1989         call __lll_lock_wait_private, otherwise pass private to
1990         __lll_lock_wait.
1991         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
1992         __lll_robust_timedlock): Add private argument, pass it to
1993         __lll_*wait functions.
1994         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
1995         call __lll_unlock_wake_private, otherwise pass private to
1996         __lll_unlock_wake.
1997         (__lll_robust_unlock): Add private argument, pass it to
1998         __lll_robust_unlock_wake.
1999         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
2000         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
2001         argument, pass it through to __lll_* inline function.
2002         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
2003         (lll_lock_t): Remove.
2004         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
2005         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
2006         lll_cond_wake, lll_cond_broadcast): Remove.
2007         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2008         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2009         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2010         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2011         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
2012         the header from assembler.  Renamed all lll_mutex_* resp.
2013         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
2014         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
2015         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2016         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
2017         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
2018         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
2019         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
2020         Remove prototype.
2021         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
2022         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
2023         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
2024         (lll_trylock): Likewise, use __lll_trylock_asm, pass
2025         MULTIPLE_THREADS_OFFSET as another asm operand.
2026         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
2027         MULTIPLE_THREADS_OFFSET as last asm operand, call
2028         __lll_lock_wait_private if private is constant LLL_PRIVATE,
2029         otherwise pass private as another argument to __lll_lock_wait.
2030         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
2031         lll_timedlock, lll_robust_timedlock): Add private argument, pass
2032         private as another argument to __lll_*lock_wait call.
2033         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
2034         MULTIPLE_THREADS_OFFSET as another asm operand, call
2035         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
2036         otherwise pass private as another argument to __lll_unlock_wake.
2037         (lll_robust_unlock): Add private argument, pass private as another
2038         argument to __lll_unlock_wake.
2039         (lll_robust_dead): Add private argument, use __lll_private_flag
2040         macro.
2041         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
2042         LLL_MUTEX_LOCK_INITIALIZER.
2043         (lll_lock_t): Remove.
2044         (LLL_LOCK_INITIALIZER_WAITERS): Define.
2045         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
2046         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
2047         lll_cond_wake, lll_cond_broadcast): Remove.
2048         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2049         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
2050         2007-05-2{3,9} changes.
2051         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
2052         kernel-features.h and lowlevellock.h.
2053         (LOAD_PRIVATE_FUTEX_WAIT): Define.
2054         (LOAD_FUTEX_WAIT): Rewritten.
2055         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
2056         define.
2057         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
2058         (__lll_mutex_lock_wait): Rename to ...
2059         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
2060         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
2061         (__lll_mutex_timedlock_wait): Rename to ...
2062         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
2063         contains private argument.  Don't compile in for libc.so.
2064         (__lll_mutex_unlock_wake): Rename to ...
2065         (__lll_unlock_wake): ... this.  %ecx contains private argument.
2066         Don't compile in for libc.so.
2067         (__lll_timedwait_tid): Use __NR_gettimeofday.
2068         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
2069         kernel-features.h and lowlevellock.h.
2070         (LOAD_FUTEX_WAIT): Define.
2071         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
2072         define.
2073         (__lll_robust_mutex_lock_wait): Rename to ...
2074         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
2075         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
2076         macro.
2077         (__lll_robust_mutex_timedlock_wait): Rename to ...
2078         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
2079         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
2080         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
2081         lowlevellock.h.
2082         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2083         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
2084         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
2085         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
2086         to __lll_lock_wait in %edx.
2087         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
2088         Include lowlevellock.h and pthread-errnos.h.
2089         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
2090         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
2091         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
2092         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
2093         pass LLL_SHARED in %ecx to both __lll_lock_wait and
2094         __lll_unlock_wake.
2095         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
2096         Include lowlevellock.h and pthread-errnos.h.
2097         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
2098         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
2099         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
2100         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
2101         pass LLL_SHARED in %ecx to both __lll_lock_wait and
2102         __lll_unlock_wake.
2103         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
2104         Include lowlevellock.h.
2105         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
2106         Don't define.
2107         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
2108         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
2109         pass LLL_SHARED in %ecx to both __lll_lock_wait and
2110         __lll_unlock_wake.  Use __NR_gettimeofday.
2111         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
2112         Include lowlevellock.h.
2113         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2114         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
2115         to __lll_*, pass cond_lock address in %edx rather than %ecx to
2116         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
2117         and __lll_unlock_wake.
2118         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
2119         Include lowlevellock.h.
2120         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2121         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
2122         MUTEX(%ebx) address in %edx rather than %ecx to
2123         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
2124         and __lll_unlock_wake.  Move return value from %ecx to %edx
2125         register.
2126         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2127         Include lowlevellock.h.
2128         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
2129         Don't define.
2130         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
2131         MUTEX(%ebp) address in %edx rather than %ecx to
2132         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
2133         and __lll_unlock_wake.  Move return value from %ecx to %edx
2134         register.  Use __NR_gettimeofday.
2135         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2136         Include lowlevellock.h.
2137         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
2138         Don't define.
2139         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
2140         MUTEX(%ebp) address in %edx rather than %ecx to
2141         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
2142         and __lll_unlock_wake.  Move return value from %ecx to %edx
2143         register.  Use __NR_gettimeofday.
2144         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
2145         Include lowlevellock.h.
2146         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2147         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
2148         MUTEX(%edi) address in %edx rather than %ecx to
2149         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
2150         and __lll_unlock_wake.
2151         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
2152         Include lowlevellock.h.
2153         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2154         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
2155         MUTEX(%ebx) address in %edx rather than %ecx to
2156         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
2157         and __lll_unlock_wake.  Move return value from %ecx to %edx
2158         register.
2159         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
2160         lowlevellock.h.
2161         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
2162         define.
2163         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
2164         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
2165         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
2166         lowlevellock.h.
2167         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
2168         (sem_timedwait): Use __NR_gettimeofday.
2169         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
2170         lowlevellock.h.
2171         (LOCK): Don't define.
2172         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
2173         lowlevellock.h.
2174         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
2175         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
2176         are waiters.
2177         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
2178         2007-05-2{3,9} changes.
2179         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
2180         kernel-features.h and lowlevellock.h.
2181         (LOAD_PRIVATE_FUTEX_WAIT): Define.
2182         (LOAD_FUTEX_WAIT): Rewritten.
2183         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
2184         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
2185         (__lll_mutex_lock_wait): Rename to ...
2186         (__lll_lock_wait): ... this.  %esi is now private argument.
2187         Don't compile in for libc.so.
2188         (__lll_mutex_timedlock_wait): Rename to ...
2189         (__lll_timedlock_wait): ... this.  %esi contains private argument.
2190         Don't compile in for libc.so.
2191         (__lll_mutex_unlock_wake): Rename to ...
2192         (__lll_unlock_wake): ... this.  %esi contains private argument.
2193         Don't compile in for libc.so.
2194         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
2195         kernel-features.h and lowlevellock.h.
2196         (LOAD_FUTEX_WAIT): Define.
2197         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
2198         (__lll_robust_mutex_lock_wait): Rename to ...
2199         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
2200         Use LOAD_FUTEX_WAIT macro.
2201         (__lll_robust_mutex_timedlock_wait): Rename to ...
2202         (__lll_robust_timedlock_wait): ... this. %esi argument contains
2203         private, use LOAD_FUTEX_WAIT macro.
2204         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
2205         lowlevellock.h.
2206         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2207         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
2208         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
2209         __lll_lock_wait and __lll_unlock_wake.
2210         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
2211         Include lowlevellock.h and pthread-errnos.h.
2212         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
2213         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
2214         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
2215         pass LLL_SHARED in %esi to both __lll_lock_wait and
2216         __lll_unlock_wake.
2217         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
2218         Include lowlevellock.h and pthread-errnos.h.
2219         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
2220         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
2221         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
2222         pass LLL_SHARED in %esi to both __lll_lock_wait and
2223         __lll_unlock_wake.
2224         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
2225         Include lowlevellock.h.
2226         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2227         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
2228         pass LLL_SHARED in %esi to both __lll_lock_wait and
2229         __lll_unlock_wake.
2230         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
2231         Include lowlevellock.h.
2232         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
2233         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
2234         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
2235         and __lll_unlock_wake.
2236         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
2237         Include lowlevellock.h.
2238         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2239         Don't define.
2240         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
2241         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
2242         and __lll_unlock_wake.
2243         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2244         Include lowlevellock.h.
2245         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2246         Don't define.
2247         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
2248         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
2249         and __lll_unlock_wake.
2250         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2251         Include lowlevellock.h.
2252         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2253         Don't define.
2254         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
2255         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
2256         and __lll_unlock_wake.
2257         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
2258         Include lowlevellock.h.
2259         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2260         Don't define.
2261         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
2262         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
2263         and __lll_unlock_wake.
2264         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
2265         Include lowlevellock.h.
2266         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
2267         Don't define.
2268         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
2269         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
2270         and __lll_unlock_wake.
2271         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
2272         lowlevellock.h.
2273         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
2274         define.
2275         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
2276         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
2277         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
2278         lowlevellock.h.
2279         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
2280         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
2281         lowlevellock.h.
2282         (LOCK): Don't define.
2283         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
2284         lowlevellock.h.
2285         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
2286         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
2287         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
2288         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
2289         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
2290         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
2291         (__lll_lock_wait_private): New function.
2292         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
2293         it to lll_futex_*wait.  Don't compile in for libc.so.
2294         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
2295         Remove.
2296         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
2297         (struct sparc_pthread_barrier): Remove.
2298         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
2299         struct sparc_pthread_barrier.  Pass
2300         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
2301         and lll_futex_wait macros.
2302         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2303         Remove.
2304         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2305         Include sparc pthread_barrier_wait.c instead of generic one.
2306
2307 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
2308
2309         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
2310
2311         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
2312         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
2313         %ecx.
2314         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
2315         (pthread_rwlock_timedwrlock): Likewise.
2316         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
2317         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
2318
2319 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
2320
2321         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
2322
2323 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
2324
2325         * tst-locale2.c (useless): Add return statement.
2326
2327 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
2328
2329         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
2330         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
2331         * pthread_create.c (start_thread): Likewise.
2332         * init.c (sighandler_setxid): Likewise.
2333         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2334         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2335         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2336         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2337         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2338         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2339         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2340         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2341         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
2342         Likewise.
2343         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
2344         Likewise.
2345         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
2346         Likewise.
2347         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
2348         __rtld_notify): Likewise.
2349         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
2350         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
2351         __pthread_once): Likewise.
2352         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
2353         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2354         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2355         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2356         (lll_futex_wait): Add private argument, define as wrapper around
2357         lll_futex_timed_wait.
2358         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2359         use __lll_private_flag macro.
2360         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
2361         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
2362         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
2363         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2364         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2365         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2366         (lll_futex_wait): Add private argument, define as wrapper around
2367         lll_futex_timed_wait.
2368         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2369         use __lll_private_flag macro.
2370         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
2371         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
2372         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
2373         Define.
2374         (lll_futex_timed_wait, lll_futex_wake): Use it.
2375         (lll_private_futex_wait, lll_private_futex_timed_wait,
2376         lll_private_futex_wake): Removed.
2377         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
2378         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2379         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2380         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2381         (lll_futex_wait): Add private argument, define as wrapper around
2382         lll_futex_timed_wait.
2383         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2384         use __lll_private_flag macro.
2385         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
2386         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
2387         to lll_futex_*.
2388         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2389         (lll_private_futex_wait, lll_private_futex_timed_wait,
2390         lll_private_futex_wake): Removed.
2391         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
2392         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
2393         (lll_private_futex_wait, lll_private_futex_timed_wait,
2394         lll_private_futex_wake): Removed.
2395         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
2396         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2397         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2398         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2399         (lll_futex_wait): Add private argument, define as wrapper around
2400         lll_futex_timed_wait.
2401         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2402         use __lll_private_flag macro.
2403         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
2404         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
2405         to lll_futex_*.
2406         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
2407         Define.
2408         (lll_futex_timed_wait, lll_futex_wake): Use it.
2409         (lll_private_futex_wait, lll_private_futex_timed_wait,
2410         lll_private_futex_wake): Removed.
2411
2412 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
2413
2414         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
2415         of the structure for sparc32.
2416
2417 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
2418
2419         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
2420
2421 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
2422
2423         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
2424         code used when private futexes are assumed.
2425         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2426         Likewise.
2427
2428 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
2429
2430         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2431         (__lll_private_flag): Define.
2432         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
2433         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
2434         __lll_private_flag.
2435         (lll_private_futex_wait, lll_private_futex_timedwait,
2436         lll_private_futex_wake): Define as wrapper around non-_private
2437         macros.
2438         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2439         (__lll_private_flag): Define.
2440         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
2441         (lll_private_futex_wait, lll_private_futex_timedwait,
2442         lll_private_futex_wake): Define as wrapper around non-_private
2443         macros.
2444
2445 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
2446
2447         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
2448         parameter to lll_futex_wait call.
2449         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
2450
2451         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2452         Replace lll_futex_wait with lll_private_futex_wait.
2453         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
2454         Add LLL_SHARED parameter to lll_futex_wake().
2455
2456         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
2457         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
2458         lll_private_futex_wake.
2459         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
2460         bit from private parm before syscall.
2461         (lll_futex_timed_wait): Likewise.
2462         (lll_futex_wake): Likewise.
2463         (lll_futex_wake_unlock): Likewise.
2464         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
2465         (lll_robust_mutex_unlock): Likewise.
2466         (lll_mutex_unlock_force): Likewise.
2467         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
2468
2469 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
2470
2471         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
2472         compilation when unconditionally using private futexes.
2473         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2474         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2475         Likewise.
2476         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2477         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2478
2479 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
2480
2481         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
2482         Define.
2483
2484 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2485
2486         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
2487         kernel-features.h.
2488
2489 2007-05-16  Roland McGrath  <roland@redhat.com>
2490
2491         * init.c (__nptl_initial_report_events): New variable.
2492         (__pthread_initialize_minimal_internal): Initialize pd->report_events
2493         to that.
2494
2495 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
2496
2497         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
2498         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
2499
2500 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
2501
2502         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
2503         implementation.
2504
2505 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
2506
2507         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
2508         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
2509         * pthread_mutex_timedlock.c: Likewise.
2510         * pthread_mutex_trylock.c: Likewise.
2511         * pthread_mutex_unlock.c: Likewise.
2512
2513 2007-06-17  Andreas Schwab  <schwab@suse.de>
2514
2515         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
2516         sections.
2517
2518 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
2519
2520         * allocatestack.c (allocate_stack): Make code compile if
2521         __ASSUME_PRIVATE_FUTEX is set.
2522
2523 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2524
2525         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
2526         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
2527         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
2528         (__pthread_rwlock_wrlock): Likewise.
2529         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2530         (pthread_rwlock_timedrdlock): Likewise.
2531         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2532         (pthread_rwlock_timedwrlock): Likewise.
2533         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
2534         (__pthread_rwlock_unlock): Likewise.
2535
2536 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2537
2538         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
2539         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
2540         Split __flags into __flags, __shared, __pad1 and __pad2.
2541         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
2542         futexes if they are available.
2543         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
2544         in libc-lowlevellock.S allow using private futexes.
2545         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
2546         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
2547         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
2548         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
2549         lll_private_futex_timed_wait and lll_private_futex_wake.
2550         (lll_robust_mutex_unlock): Fix typo.
2551         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
2552         field in futex command setup.
2553         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
2554         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
2555         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2556         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
2557         if they are available.  Remove clear_once_control.
2558         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
2559         futexes if they are available.
2560         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2561         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2562         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2563         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2564         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
2565         Wake only when there are waiters.
2566         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
2567         support.  Indicate that there are waiters.  Remove unnecessary
2568         extra cancellation test.
2569         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
2570         left-over duplication of __sem_wait_cleanup.
2571
2572 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
2573
2574         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
2575         parameter to lll_futex_wait, lll_futex_timed_wait, and
2576         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
2577         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
2578         lll_private_futex_wake.
2579         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2580         * allocatestack.c: Adjust use of lll_futex_* macros.
2581         * init.c: Likewise.
2582         * lowlevellock.h: Likewise.
2583         * pthread_barrier_wait.c: Likewise.
2584         * pthread_cond_broadcast.c: Likewise.
2585         * pthread_cond_destroy.c: Likewise.
2586         * pthread_cond_signal.c: Likewise.
2587         * pthread_cond_timedwait.c: Likewise.
2588         * pthread_cond_wait.c: Likewise.
2589         * pthread_create.c: Likewise.
2590         * pthread_mutex_lock.c: Likewise.
2591         * pthread_mutex_setprioceiling.c: Likewise.
2592         * pthread_mutex_timedlock.c: Likewise.
2593         * pthread_mutex_unlock.c: Likewise.
2594         * pthread_rwlock_timedrdlock.c: Likewise.
2595         * pthread_rwlock_timedwrlock.c: Likewise.
2596         * pthread_rwlock_unlock.c: Likewise.
2597         * sysdeps/alpha/tls.h: Likewise.
2598         * sysdeps/i386/tls.h: Likewise.
2599         * sysdeps/ia64/tls.h: Likewise.
2600         * sysdeps/powerpc/tls.h: Likewise.
2601         * sysdeps/pthread/aio_misc.h: Likewise.
2602         * sysdeps/pthread/gai_misc.h: Likewise.
2603         * sysdeps/s390/tls.h: Likewise.
2604         * sysdeps/sh/tls.h: Likewise.
2605         * sysdeps/sparc/tls.h: Likewise.
2606         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2607         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2608         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
2609         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
2610         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2611         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2612         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2613         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2614         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
2615         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
2616         Likewise.
2617         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
2618         * sysdeps/x86_64/tls.h: Likewise.
2619
2620 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
2621
2622         * pthread_getattr_np.c: No need to install a cancellation handler,
2623         this is no cancellation point.
2624         * pthread_getschedparam.c: Likewise.
2625         * pthread_setschedparam.c: Likewise.
2626         * pthread_setschedprio.c: Likewise.
2627         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
2628         lll_unlock_wake_cb.
2629         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2630         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2631         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2632         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2633         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2634         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2635         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2636         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2637         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2638         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
2639         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2640         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2641
2642         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
2643         whether there are more than one thread makes no sense here since
2644         we only call the slow path if the locks are taken.
2645         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
2646
2647         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
2648         COND_NWAITERS_SHIFT.
2649         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
2650         COND_CLOCK_BITS.
2651         * pthread_cond_init.c: Likewise.
2652         * pthread_cond_timedwait.c: Likewise.
2653         * pthread_cond_wait.c: Likewise.
2654         * pthread_condattr_getclock.c: Likewise.
2655         * pthread_condattr_setclock.c: Likewise.
2656         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
2657         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2658         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2659         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2660         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2661
2662 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
2663
2664         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
2665         unistd.h.
2666
2667         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
2668         insn suffix.
2669         (THREAD_GSCOPE_GET_FLAG): Remove.
2670         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
2671         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
2672         changes.
2673         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
2674         (THREAD_GSCOPE_GET_FLAG): Remove.
2675         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
2676         instead of THREAD_GSCOPE_GET_FLAG.
2677         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
2678         it.
2679         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2680         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2681         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2682         THREAD_GSCOPE_WAIT): Define.
2683         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2684         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2685         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2686         THREAD_GSCOPE_WAIT): Define.
2687         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2688         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2689         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2690         THREAD_GSCOPE_WAIT): Define.
2691         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2692         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2693         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2694         THREAD_GSCOPE_WAIT): Define.
2695
2696 2007-05-24  Richard Henderson  <rth@redhat.com>
2697
2698         * descr.h (struct pthread): Add header.gscope_flag.
2699         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2700         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2701         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2702         THREAD_GSCOPE_WAIT): Define.
2703
2704 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
2705
2706         * init.c: Make it compile with older kernel headers.
2707
2708         * tst-initializers1.c: Show through exit code which test failed.
2709
2710         * pthread_rwlock_init.c: Also initialize __shared field.
2711         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
2712         element in rwlock structure into four byte elements.  One of them is
2713         the new __shared element.
2714         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
2715         Likewise.
2716         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
2717         __shared, adjust names of other padding elements.
2718         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2719         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
2720         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
2721         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
2722         FUTEX_PRIVATE_FLAG.
2723         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
2724         futex to use private operations if possible.
2725         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2726         Likewise.
2727         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2728         Likewise.
2729         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2730         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2731         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2732         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2733         Likewise.
2734         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2735         Likewise.
2736         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2737         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2738
2739 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
2740
2741         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
2742         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
2743         * pthread_rwlock_timedrdlock.c: Likewise.
2744         * pthread_rwlock_tryrdlock.c: Likewise.
2745
2746         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
2747         optimization.
2748
2749         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
2750         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
2751         duplication of __sem_wait_cleanup.
2752
2753         * allocatestack.c: Revert last change.
2754         * init.c: Likewise.
2755         * sysdeps/i386/tls.h: Likewise.
2756         * sysdeps/x86_64/tls.h: Likewise.
2757         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
2758         header structure.
2759         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
2760
2761         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
2762         Add private field.
2763         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
2764         * pthread_barrier_init.c: Set private flag if pshared and private
2765         futexes are supported.
2766         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
2767         private field in futex command setup.
2768         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
2769
2770 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2771
2772         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
2773         support.
2774         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2775         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2776         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2777         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2778         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2779
2780         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
2781         * sem_init.c (__new_sem_init): Rewrite to initialize all three
2782         fields in the structure.
2783         (__old_sem_init): New function.
2784         * sem_open.c: Initialize all fields of the structure.
2785         * sem_getvalue.c: Adjust for renamed element.
2786         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
2787         (gen-as-const-headers): Add structsem.sym.
2788         * sysdeps/unix/sysv/linux/structsem.sym: New file.
2789         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
2790         struct new_sem.  Add struct old_sem.
2791         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
2792         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2793         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2794         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
2795         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2796         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2797         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2798         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2799         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2800         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
2801         * tst-sem10.c: New file.
2802         * tst-sem11.c: New file.
2803         * tst-sem12.c: New file.
2804         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
2805         of struct sem.
2806
2807 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2808             Jakub Jelinek  <jakub@redhat.com>
2809
2810         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2811         Move __pthread_enable_asynccancel right before futex syscall.
2812         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2813         Likewise.
2814
2815 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
2816
2817         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
2818         THREAD_COPY_PRIVATE_FUTEX): Define.
2819         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
2820         THREAD_COPY_PRIVATE_FUTEX): Define.
2821         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
2822         * init.c (__pthread_initialize_minimal_internal): Use
2823         THREAD_SET_PRIVATE_FUTEX.
2824
2825         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
2826         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
2827         THREAD_GSCOPE_FLAG_WAIT): Define.
2828         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
2829         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
2830         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
2831         PTR_DEMANGLE.
2832         (THREAD_GSCOPE_GET_FLAG): Define.
2833         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
2834         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
2835         instead of ->header.gscope_flag directly.
2836
2837 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
2838
2839         * init.c (__pthread_initialize_minimal_internal): Check whether
2840         private futexes are available.
2841         * allocatestack.c (allocate_stack): Copy private_futex field from
2842         current thread into the new stack.
2843         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
2844         futexes if they are available.
2845         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
2846         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
2847         in libc-lowlevellock.S allow using private futexes.
2848         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2849         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
2850         FUTEX_PRIVATE_FLAG.
2851         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2852         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
2853         if they are available.
2854         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2855         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
2856         * sysdeps/i386/tcb-offsets.sym: Likewise.
2857         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
2858         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
2859
2860 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
2861
2862         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2863         Remove ptr_wait_lookup_done again.
2864         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
2865         (__pthread_initialize_minimal_internal): Initialize
2866         _dl_wait_lookup_done pointer in _rtld_global directly.
2867         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2868         Remove code to code _dl_wait_lookup_done.
2869         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
2870         encrypted for now.
2871
2872 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
2873
2874         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
2875         pthread_mutex_init failed with ENOTSUP.
2876
2877 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
2878
2879         * allocatestack.c (__wait_lookup_done): New function.
2880         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2881         Add ptr_wait_lookup_done.
2882         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
2883         * pthreadP.h: Declare __wait_lookup_done.
2884         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
2885         Define macros to implement reference handling of global scope.
2886         * sysdeps/x86_64/tls.h: Likewise.
2887         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2888         Initialize GL(dl_wait_lookup_done).
2889
2890 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
2891
2892         [BZ #4512]
2893         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
2894         is detected.
2895         * pthread_mutex_timedlock.c: Likewise.
2896         * pthread_mutex_trylock.c: Likewise.
2897         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
2898
2899         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
2900         * tst-robust9.c: New file.
2901         * tst-robustpi9.c: New file.
2902
2903         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
2904         unnecessary extra cancellation test.
2905
2906 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
2907
2908         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
2909         extra cancellation test.
2910         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2911
2912 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
2913
2914         * descr.h (struct pthread): Rearrange members to fill hole in
2915         64-bit layout.
2916
2917         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2918         (__pthread_setaffinity_new): If syscall was successful and
2919         RESET_VGETCPU_CACHE is defined, use it before returning.
2920         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
2921
2922 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
2923
2924         [BZ #4455]
2925         * tst-align2.c: Include stackinfo.h.
2926         * tst-getpid1.c: Likewise.
2927
2928 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
2929
2930         [BZ #4455]
2931         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
2932         * tst-getpid1.c (do_test): Likewise.
2933
2934         [BZ #4456]
2935         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
2936         (allocate_stack): Likewise.
2937
2938 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
2939
2940         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2941         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
2942         (__lll_robust_timedlock_wait): Likewise.
2943         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
2944
2945 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
2946
2947         [BZ #4465]
2948         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
2949         * tst-cancel4.c (tf_fdatasync): New test.
2950
2951 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
2952
2953         [BZ #4392]
2954         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
2955         check mutexes like normal mutexes.
2956
2957         [BZ #4306]
2958         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
2959         Initialize the whole sigevent structure to appease valgrind.
2960
2961 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
2962
2963         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
2964         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
2965
2966 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
2967
2968         * tst-locale1.c: Avoid warnings.
2969         * tst-locale2.c: Likewise.
2970
2971 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
2972
2973         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2974         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
2975
2976 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
2977
2978         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
2979         __extern_always_inline where appropriate.
2980         * sysdeps/pthread/pthread.h: Likewise.
2981
2982 2007-03-13  Richard Henderson  <rth@redhat.com>
2983
2984         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
2985         separate cfi regions for the two subsections.
2986
2987 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
2988
2989         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
2990         new thread, don't just decrement it.
2991         Patch by Suzuki K P <suzuki@in.ibm.com>.
2992
2993 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
2994
2995         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
2996         PTHFCT_CALL definition.
2997
2998 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
2999
3000         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
3001         available, don't use it.
3002
3003 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
3004
3005         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3006         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
3007         call into the kernel to delay.
3008
3009 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
3010
3011         * tst-initializers1.c: We want to test the initializers as seen
3012         outside of libc, so undefined _LIBC.
3013
3014         * pthread_join.c (cleanup): Avoid warning.
3015
3016 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
3017
3018         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3019         (__lll_timedwait_tid): Add unwind info.
3020
3021         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
3022         function table, mangle the pointers.
3023         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
3024         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
3025         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
3026         demangle pointers before use.
3027         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
3028         demangle pointer.
3029         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
3030         * sysdeps/pthread/setxid.h: Likewise.
3031
3032 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
3033
3034         * tst-rwlock7.c: Show some more information in case of correct
3035         behavior.
3036
3037 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
3038
3039         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3040         (lll_futex_timed_wait): Undo part of last change, don't negate
3041         return value.
3042
3043 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
3044
3045         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
3046         FUTEX_CMP_REQUEUE and lll_futex_requeue.
3047
3048 2006-12-28  David S. Miller  <davem@davemloft.net>
3049
3050         * shlib-versions: Fix sparc64 linux target specification.
3051
3052 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
3053
3054         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3055         Adjust include path for pthread_barrier_wait.c move.
3056
3057 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
3058
3059         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
3060         tid isn't reread from pd->tid in between ESRCH test and the syscall.
3061
3062 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
3063
3064         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
3065         6 argument cancellable syscalls.
3066         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
3067         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
3068         6 argument cancellable syscalls.
3069         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
3070
3071 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
3072
3073         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
3074         (__rtld_mrlock_initialize): Add missing closing parenthesis.
3075
3076 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
3077
3078         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
3079         __sync_lock_release instead of __sync_lock_release_si.
3080
3081 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
3082
3083         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
3084         Define.
3085         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
3086         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
3087         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3088         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3089         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3090         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3091         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3092         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3093         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3094         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3095         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3096
3097 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
3098
3099         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
3100         * pthread_barrier_wait.c: ...here.
3101         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
3102         * pthread_cond_broadcast.c: ...here.
3103         * sysdeps/pthread/pthread_cond_signal.c: Move to...
3104         * pthread_cond_signal.c: ...here.
3105         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
3106         * pthread_cond_timedwait.c: ...here.
3107         * sysdeps/pthread/pthread_cond_wait.c: Move to...
3108         * pthread_cond_wait.c: ...here.
3109         * sysdeps/pthread/pthread_once.c: Move to...
3110         * pthread_once.c: ...here.
3111         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
3112         * pthread_rwlock_rdlock.c: ...here.
3113         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
3114         * pthread_rwlock_timedrdlock.c: ...here.
3115         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
3116         * pthread_rwlock_timedwrlock.c: ...here.
3117         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
3118         * pthread_rwlock_unlock.c: ...here.
3119         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
3120         * pthread_rwlock_wrlock.c: ...here.
3121         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
3122         * pthread_spin_destroy.c: ...here.
3123         * sysdeps/pthread/pthread_spin_init.c: Move to...
3124         * pthread_spin_init.c: ...here.
3125         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
3126         * pthread_spin_unlock.c: ...here.
3127         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
3128         * pthread_getcpuclockid.c: ...here.
3129
3130         * init.c: USE_TLS support is now always enabled.
3131         * tst-tls5.h: Likewise.
3132         * sysdeps/alpha/tls.h: Likewise.
3133         * sysdeps/i386/tls.h: Likewise.
3134         * sysdeps/ia64/tls.h: Likewise.
3135         * sysdeps/powerpc/tls.h: Likewise.
3136         * sysdeps/s390/tls.h: Likewise.
3137         * sysdeps/sh/tls.h: Likewise.
3138         * sysdeps/sparc/tls.h: Likewise.
3139         * sysdeps/x86_64/tls.h: Likewise.
3140
3141 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
3142
3143         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
3144         __rtld_mrlock_change): Update oldval if atomic compare and exchange
3145         failed.
3146
3147         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3148         Define to THREAD_SELF->header.multiple_threads.
3149         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
3150         Likewise.
3151         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
3152         Likewise.
3153         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
3154         (SINGLE_THREAD_P): Likewise.
3155         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3156         (SINGLE_THREAD_P): Likewise.
3157         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3158         (SINGLE_THREAD_P): Likewise.
3159         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3160         (SINGLE_THREAD_P): Likewise.
3161         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
3162         Likewise.
3163         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
3164         (SINGLE_THREAD_P): Likewise.
3165         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
3166         (SINGLE_THREAD_P): Likewise.
3167         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
3168         Likewise.
3169
3170 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
3171
3172         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
3173         by default rather than 2_3_3.
3174
3175 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
3176
3177         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
3178         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
3179         atomic_* instead of catomic_* macros.
3180
3181 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
3182
3183         [BZ #3285]
3184         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
3185         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
3186         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
3187         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
3188         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
3189         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
3190         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
3191         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
3192         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
3193         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
3194         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
3195         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
3196         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
3197
3198 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
3199
3200         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
3201         cancelable syscalls with six parameters.
3202
3203         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
3204         operations instead of atomic_*.
3205
3206 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
3207
3208         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
3209
3210 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
3211
3212         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
3213         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
3214         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
3215         New file.
3216         * pthread_attr_setstack.c: Allow overwriting the version number of the
3217         new symbol.
3218         * pthread_attr_setstacksize.c: Likewise.
3219         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
3220         it.
3221         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
3222         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
3223
3224 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
3225
3226         [BZ #3251]
3227         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
3228         Patch by Petr Baudis.
3229
3230 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
3231
3232         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
3233
3234         * tst-cancel2.c (tf): Loop as long as something was written.
3235
3236 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3237
3238         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
3239         mutexes wake all mutexes.
3240         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
3241         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
3242         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3243
3244 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
3245
3246         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
3247         to guarantee the thread is always canceled.
3248
3249 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
3250
3251         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
3252         Include stdlib.h.
3253         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
3254         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
3255         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3256         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3257         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3258
3259 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
3260
3261         [BZ #3123]
3262         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
3263         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
3264         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3265         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3266         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3267         * Makefile (tests): Add tst-cond22.
3268         * tst-cond22.c: New file.
3269
3270 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
3271
3272         [BZ #3124]
3273         * descr.h (struct pthread): Add parent_cancelhandling.
3274         * sysdeps/pthread/createthread.c (create_thread): Pass parent
3275         cancelhandling value to child.
3276         * pthread_create.c (start_thread): If parent thread was canceled
3277         reset the SIGCANCEL mask.
3278         * Makefile (tests): Add tst-cancel25.
3279         * tst-cancel25.c: New file.
3280
3281 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
3282             Ulrich Drepper  <drepper@redhat.com>
3283
3284         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
3285         counterp if it is already zero.
3286         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
3287
3288 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
3289             Roland McGrath  <roland@redhat.com>
3290
3291         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3292         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
3293         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
3294         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
3295         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
3296         lll_robust_mutex_timedlock, lll_mutex_unlock,
3297         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
3298         Add _L_*_ symbols around the subsection.
3299         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
3300         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
3301
3302 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
3303             Roland McGrath  <roland@redhat.com>
3304
3305         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3306         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
3307         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
3308         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
3309         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
3310         lll_robust_mutex_timedlock, lll_mutex_unlock,
3311         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
3312         Add _L_*_ symbols around the subsection.
3313         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
3314         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
3315
3316 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
3317
3318         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
3319         change because it can disturb too much existing code.  If real hard
3320         reader preference is needed we'll introduce another type.
3321         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3322         (pthread_rwlock_timedwrlock): Likewise.
3323         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
3324         Likewise.
3325
3326 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
3327
3328         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
3329         reader preference.
3330         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3331         (pthread_rwlock_timedwrlock): Likewise.
3332         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
3333         Likewise.
3334
3335 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
3336
3337         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
3338         Only define ifdef SHARED.
3339
3340 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
3341
3342         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
3343         (free_stacks): ...here.
3344         (__free_stack_cache): New function.
3345         * pthreadP.h: Declare __free_stack_cache.
3346         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
3347         ptr_freeres.
3348         * init.c (pthread_functions): Initialize ptr_freeres.
3349         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
3350         New freeres function.
3351
3352 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
3353
3354         [BZ #3018]
3355         * Makefile (extra-objs): Add modules to extra-test-objs instead.
3356
3357 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
3358
3359         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3360         _XOPEN_REALTIME_THREADS.
3361
3362 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
3363
3364         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
3365         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
3366         HAVE_CLOCK_GETTIME_VSYSCALL.
3367         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
3368
3369 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
3370
3371         * sysdeps/unix/sysv/linux/bits/posix_opt.h
3372         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
3373         * descr.h (struct priority_protection_data): New type.
3374         (struct pthread): Add tpp field.
3375         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
3376         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
3377         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
3378         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
3379         TPP mutexes.
3380         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
3381         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
3382         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
3383         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
3384         * tpp.c: New file.
3385         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
3386         boosted by TPP.
3387         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
3388         * pthread_mutexattr_getprioceiling.c
3389         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
3390         in the SCHED_FIFO priority range.
3391         * pthread_mutexattr_setprioceiling.c
3392         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
3393         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
3394         if mutex is not TPP.  Ceiling is now in __data.__lock.
3395         * pthread_mutex_setprioceiling.c: Include stdbool.h.
3396         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
3397         is now in __data.__lock.  Add locking.
3398         * pthread_create.c (__free_tcb): Free pd->tpp structure.
3399         * Makefile (libpthread-routines): Add tpp.
3400         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
3401         * tst-tpp.h: New file.
3402         * tst-mutexpp1.c: New file.
3403         * tst-mutexpp6.c: New file.
3404         * tst-mutexpp10.c: New file.
3405         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
3406         * tst-mutex6.c (TEST_FUNCTION): Likewise.
3407
3408 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
3409
3410         [BZ #2843]
3411         * pthread_join.c (pthread_join): Account for self being canceled
3412         when checking for deadlocks.
3413         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
3414         (tf1): Don't print anything after pthread_join returns, this would be
3415         another cancellation point.
3416         (tf2): Likewise.
3417         * tst-join6.c: New file.
3418         * Makefile (tests): Add tst-join6.
3419
3420 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
3421
3422         [BZ #2892]
3423         * pthread_setspecific.c (__pthread_setspecific): Check
3424         out-of-range index before checking for unused key.
3425
3426         * sysdeps/pthread/gai_misc.h: New file.
3427
3428 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
3429
3430         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
3431         file.  Don't use sysctl.
3432         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
3433         overwrite the file if this is likely not true.
3434
3435 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
3436
3437         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
3438         * Makefile (tests): Add tst-getpid3.
3439         * tst-getpid3.c: New file.
3440
3441 2006-07-30  Roland McGrath  <roland@redhat.com>
3442
3443         * Makefile (libpthread-routines): Add ptw-sigsuspend.
3444
3445         * sysdeps/unix/sysv/linux/i386/not-cancel.h
3446         (pause_not_cancel): New macro.
3447         (nanosleep_not_cancel): New macro.
3448         (sigsuspend_not_cancel): New macro.
3449         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
3450         nanosleep_not_cancel macro from <not-cancel.h>.
3451         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
3452         macro from <not-cancel.h>.
3453
3454 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
3455             Jakub Jelinek  <jakub@redhat.com>
3456
3457         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
3458         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
3459         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
3460         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
3461         * pthread_mutex_init.c: Add support for priority inheritance mutex.
3462         * pthread_mutex_lock.c: Likewise.
3463         * pthread_mutex_timedlock.c: Likewise.
3464         * pthread_mutex_trylock.c: Likewise.
3465         * pthread_mutex_unlock.c: Likewise.
3466         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
3467         all mutexes.
3468         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
3469         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
3470         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
3471         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
3472         pthread-pi-defines.sym.
3473         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
3474         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
3475         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3476         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
3477         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3478         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3479         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3480         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
3481         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3482         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3483         _POSIX_THREAD_PRIO_INHERIT to 200112L.
3484         * tst-mutex1.c: Adjust to allow use in PI mutex test.
3485         * tst-mutex2.c: Likewise.
3486         * tst-mutex3.c: Likewise.
3487         * tst-mutex4.c: Likewise.
3488         * tst-mutex5.c: Likewise.
3489         * tst-mutex6.c: Likewise.
3490         * tst-mutex7.c: Likewise.
3491         * tst-mutex7a.c: Likewise.
3492         * tst-mutex8.c: Likewise.
3493         * tst-mutex9.c: Likewise.
3494         * tst-robust1.c: Likewise.
3495         * tst-robust7.c: Likewise.
3496         * tst-robust8.c: Likewise.
3497         * tst-mutexpi1.c: New file.
3498         * tst-mutexpi2.c: New file.
3499         * tst-mutexpi3.c: New file.
3500         * tst-mutexpi4.c: New file.
3501         * tst-mutexpi5.c: New file.
3502         * tst-mutexpi6.c: New file.
3503         * tst-mutexpi7.c: New file.
3504         * tst-mutexpi7a.c: New file.
3505         * tst-mutexpi8.c: New file.
3506         * tst-mutexpi9.c: New file.
3507         * tst-robust1.c: New file.
3508         * tst-robust2.c: New file.
3509         * tst-robust3.c: New file.
3510         * tst-robust4.c: New file.
3511         * tst-robust5.c: New file.
3512         * tst-robust6.c: New file.
3513         * tst-robust7.c: New file.
3514         * tst-robust8.c: New file.
3515         * Makefile (tests): Add the new tests.
3516
3517         * pthread_create.c (start_thread): Add some casts to avoid warnings.
3518         * pthread_mutex_destroy.c: Remove unneeded label.
3519
3520 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
3521
3522         * pthread_mutex_init.c (__pthread_mutex_init): Move some
3523         computations to compile time.
3524
3525 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
3526
3527         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
3528
3529 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
3530
3531         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
3532
3533 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
3534
3535         * pthread_key_create.c (__pthread_key_create): Do away with
3536         __pthread_keys_lock.
3537
3538         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3539         (__kernel_cpumask_size): Mark as hidden.
3540         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
3541
3542         * sem_open.c (__sem_mappings_lock): Mark as hidden.
3543         * semaphoreP.h (__sem_mappings_lock): Likewise.
3544
3545 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
3546
3547         * pthread_atfork.c: Mark __dso_handle as hidden.
3548
3549 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
3550
3551         [BZ #2644]
3552         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
3553         the reload problem.  Change the one path in pthread_cancel_init
3554         which causes the problem.  Force gcc to reload.  Simplify callers.
3555         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
3556         (_Unwind_GetBSP): Undo last patch.
3557
3558 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
3559
3560         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
3561         function pointer is reloaded after pthread_cancel_init calls.
3562
3563         [BZ #2644]
3564         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
3565         pointers are reloaded after pthread_cancel_init calls.
3566
3567 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
3568
3569         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
3570         __always_inline.
3571
3572 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
3573
3574         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3575         Allocate new object which is passed to timer_sigev_thread so that
3576         the timer can be deleted before the new thread is scheduled.
3577
3578 2006-04-26  Roland McGrath  <roland@redhat.com>
3579
3580         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
3581
3582 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
3583
3584         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
3585         suffix for conditional jumps.
3586         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3587         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3588         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3589         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3590         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3591         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3592
3593         * init.c (sigcancel_handler): Compare with correct PID even if the
3594         thread is in the middle of a fork call.
3595         (sighandler_setxid): Likewise.
3596         Reported by Suzuki K P <suzuki@in.ibm.com> .
3597
3598 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
3599
3600         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
3601
3602 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
3603
3604         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
3605         fails [Coverity CID 105].
3606
3607 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
3608
3609         * sysdeps/pthread/pthread.h: Add nonnull attributes.
3610
3611 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
3612
3613         [BZ #2505]
3614         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
3615         Define __lll_rel_instr using lwsync.
3616
3617 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
3618
3619         * allocatestack.c (allocate_stack): Always initialize robust_head.
3620         * descr.h: Define struct robust_list_head.
3621         (struct pthread): Use robust_list_head in robust mutex list definition.
3622         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
3623         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
3624         (__pthread_initialize_minimal_internal): Register robust_list with
3625         the kernel.
3626         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
3627         Declare __set_robust_list_avail.
3628         * pthread_create.c (start_thread): Register robust_list of new thread.
3629         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
3630         waiters.
3631         * pthread_mutex_destroy.c: For robust mutexes don't look at the
3632         number of users, it's unreliable.
3633         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
3634         set_robust_list syscall is available.
3635         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
3636         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
3637         Set robust_head.list_op_pending before trying to lock a robust mutex.
3638         * pthread_mutex_timedlock.c: Likewise.
3639         * pthread_mutex_trylock.c: Likewise.
3640         * pthread_mutex_unlock.c: Likewise for unlocking.
3641         * Makefile (tests): Add tst-robust8.
3642         * tst-robust8.c: New file.
3643
3644 2006-03-08  Andreas Schwab  <schwab@suse.de>
3645
3646         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
3647         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
3648
3649 2006-03-05  Roland McGrath  <roland@redhat.com>
3650
3651         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
3652         and $config_os doesn't match *linux*.
3653
3654 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
3655
3656         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
3657         Use __syscall_error.
3658         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3659         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
3660         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
3661         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3662         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
3663         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
3664
3665 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
3666
3667         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
3668
3669 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
3670
3671         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
3672         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
3673         mutex.
3674         (__lll_robust_timedlock_wait): Likewise.
3675         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
3676         (__lll_robust_lock_wait): Likewise.
3677         (__lll_robust_timedlock_wait): Likewise.
3678         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3679         (__lll_robust_lock_wait): Likewise.
3680         (__lll_robust_timedlock_wait): Likewise.
3681
3682 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
3683
3684         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
3685         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3686         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3687         lll_robust_mutex_unlock): Define.
3688         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3689
3690 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
3691
3692         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
3693         instead of <clone.S>.
3694
3695 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
3696
3697         * Makefile (libpthread-routines): Add
3698         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
3699         and pthread_mutex_[sg]etprioceiling.
3700         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
3701         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
3702         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
3703         pthread_mutex_setprioceiling.
3704         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
3705         PTHREAD_PRIO_PROTECT): New enum values.
3706         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
3707         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
3708         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
3709         prototypes.
3710         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
3711         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
3712         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
3713         Define.
3714         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
3715         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
3716         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
3717         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
3718         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
3719         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
3720         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
3721         protocol mutexes.
3722         * pthread_mutex_getprioceiling.c: New file.
3723         * pthread_mutex_setprioceiling.c: New file.
3724         * pthread_mutexattr_getprioceiling.c: New file.
3725         * pthread_mutexattr_setprioceiling.c: New file.
3726         * pthread_mutexattr_getprotocol.c: New file.
3727         * pthread_mutexattr_setprotocol.c: New file.
3728
3729 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
3730
3731         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
3732
3733 2006-02-27  Roland McGrath  <roland@redhat.com>
3734
3735         * sysdeps/pthread/Subdirs: List nptl here too.
3736         * configure (libc_add_on_canonical): New variable.
3737
3738         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
3739
3740         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
3741         self to get main source tree's file.
3742         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
3743         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
3744         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
3745         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
3746         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
3747         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
3748         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
3749         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
3750         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
3751         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
3752         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
3753         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
3754         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
3755
3756         * Makefile: Use $(sysdirs) in vpath directive.
3757
3758         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
3759         (CPPFLAGS-timer_routines.c): Likewise.
3760
3761         * Makeconfig (includes): Variable removed.
3762
3763 2006-02-26  Roland McGrath  <roland@redhat.com>
3764
3765         * sysdeps/generic/pt-raise.c: Moved to ...
3766         * pt-raise.c: ... here.
3767         * sysdeps/generic/lowlevellock.h: Moved to ...
3768         * lowlevellock.h: ... here.
3769
3770 2006-02-23  Roland McGrath  <roland@redhat.com>
3771
3772         * descr.h (struct pthread): Add final member `end_padding'.
3773         (PTHREAD_STRUCT_END_PADDING): Use it.
3774
3775 2006-02-20  Roland McGrath  <roland@redhat.com>
3776
3777         * sysdeps/mips: Directory removed, saved in ports repository.
3778         * sysdeps/unix/sysv/linux/mips: Likewise.
3779
3780 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
3781
3782         * tst-robust1.c: Add second mutex to check that the mutex list is
3783         handled correctly.
3784
3785 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
3786
3787         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
3788         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3789         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3790         lll_robust_mutex_unlock): New macros.
3791         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3792         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3793         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3794         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3795         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
3796
3797 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3798
3799         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
3800         definitions.
3801         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
3802
3803 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
3804
3805         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3806         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
3807         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3808         (lll_robust_mutex_unlock): Likewise.
3809
3810 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
3811
3812         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
3813         Set robust_list.__next rather than robust_list.
3814         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3815         (__pthread_list_t): New typedef.
3816         (pthread_mutex_t): Replace __next and __prev fields with __list.
3817         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3818         (__pthread_list_t): New typedef.
3819         (pthread_mutex_t): Replace __next and __prev fields with __list.
3820         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3821         (__pthread_list_t, __pthread_slist_t): New typedefs.
3822         (pthread_mutex_t): Replace __next and __prev fields with __list.
3823         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
3824         (__pthread_list_t, __pthread_slist_t): New typedefs.
3825         (pthread_mutex_t): Replace __next and __prev fields with __list.
3826         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
3827         (__pthread_list_t, __pthread_slist_t): New typedefs.
3828         (pthread_mutex_t): Replace __next and __prev fields with __list.
3829         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
3830         (__pthread_slist_t): New typedef.
3831         (pthread_mutex_t): Replace __next field with __list.
3832
3833 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
3834
3835         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
3836         PTHREAD_MUTEX_OWNERDEAD.
3837         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
3838         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
3839         * Makefile (libpthread-routines): Add lowlevelrobustlock.
3840         * pthread_create.c (start_thread): Very much simplify robust_list loop.
3841         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
3842         to PTHREAD_MUTEX_INCONSISTENT.
3843         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
3844         * pthread_mutex_lock.c: Reimplement robust mutex handling.
3845         * pthread_mutex_trylock.c: Likewise.
3846         * pthread_mutex_timedlock.c: Likewise.
3847         * pthread_mutex_unlock.c: Likewise.
3848         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
3849         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
3850         lowlevelrobustlock.sym.
3851         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
3852         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
3853         definitions.
3854         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3855         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
3856         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
3857         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
3858         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
3859
3860 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
3861
3862         * allocatestack.c (allocate_stack): Initialize robust_list.
3863         * init.c (__pthread_initialize_minimal_internal): Likewise.
3864         * descr.h (struct xid_command): Pretty printing.
3865         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
3866         robust_list.  Adjust macros.
3867         * pthread_create.c (start_thread): Adjust robust_list handling.
3868         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
3869         but the owner for all robust mutex types.
3870         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3871         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
3872         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3873         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
3874
3875         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
3876         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
3877
3878 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
3879
3880         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
3881         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
3882
3883 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3884
3885         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
3886         Return status.
3887         (lll_futex_timed_wait): Define.
3888
3889 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
3890
3891         * tst-cancel4.c: Test ppoll.
3892
3893 2006-01-18  Andreas Jaeger  <aj@suse.de>
3894
3895         [BZ #2167]
3896         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
3897         (pthread_mutex_t): Follow changes for other archs.  Based on patch
3898         by Jim Gifford <patches@jg555.com>.
3899
3900 2006-01-13  Richard Henderson  <rth@redhat.com>
3901
3902         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
3903
3904 2006-01-10  Roland McGrath  <roland@redhat.com>
3905
3906         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
3907         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3908         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3909         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3910         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3911         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3912         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3913         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3914         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3915         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3916
3917 2006-01-09  Roland McGrath  <roland@redhat.com>
3918
3919         * tst-initializers1-c89.c: New file.
3920         * tst-initializers1-c99.c: New file.
3921         * tst-initializers1-gnu89.c: New file.
3922         * tst-initializers1-gnu99.c: New file.
3923         * Makefile (tests): Add them.
3924         (CFLAGS-tst-initializers1-c89.c): New variable.
3925         (CFLAGS-tst-initializers1-c99.c): New variable.
3926         (CFLAGS-tst-initializers1-gnu89.c): New variable.
3927         (CFLAGS-tst-initializers1-gnu99.c): New variable.
3928
3929         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3930         Use __extension__ on anonymous union definition.
3931         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3932         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3933         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3934         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3935         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3936
3937 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
3938
3939         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3940         Don't give the union a name because it changes the mangled name.
3941         Instead name the struct for __data.
3942         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
3943         Likewise.
3944         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
3945         Likewise.
3946
3947 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
3948
3949         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
3950         stack bias to mc_ftp field.
3951
3952 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
3953
3954         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
3955         being too clever and reloading the futex value where it shouldn't.
3956
3957 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3958
3959         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
3960         correct type.
3961
3962 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
3963
3964         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3965         Add cfi directives.
3966
3967 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3968
3969         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
3970         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
3971         rename in tcbhead_t.
3972
3973         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3974         Don't give the union a name because it changes the mangled name.
3975         Instead name the struct for __data.
3976         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3977         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3978         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3979         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3980         * pthread_create.c (start_thread): Adjust robust mutex free loop.
3981         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
3982
3983 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
3984
3985         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3986         Return status.
3987         (lll_futex_timed_wait): Define.
3988         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3989         * sysdeps/pthread/aio_misc.h: New file.
3990
3991 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
3992
3993         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
3994
3995 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
3996
3997         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3998         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
3999         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4000
4001 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
4002
4003         * tst-cancel24.cc: Use C headers instead of C++ headers.
4004
4005 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
4006
4007         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
4008         sparc-linux configured glibc.
4009         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
4010         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
4011         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
4012         atomic_compare_and_exchange_val_24_acq instead of
4013         atomic_compare_and_exchange_val_acq.
4014         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
4015         instead of atomic_exchange_rel.
4016         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
4017         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
4018         file.
4019         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
4020         file.
4021         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
4022         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
4023         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
4024         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
4025         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
4026         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
4027         New file.
4028         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
4029         New file.
4030         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
4031         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
4032         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
4033         file.
4034         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
4035         file.
4036         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
4037
4038 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
4039
4040         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
4041         mutex initializers.
4042
4043 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
4044
4045         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
4046         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
4047         THREAD_COPY_POINTER_GUARD): Define.
4048         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
4049         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
4050
4051 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
4052
4053         * version.c: Update copyright year.
4054
4055 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4056
4057         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
4058         .eh_frame section, use cfi_* directives.
4059         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
4060
4061 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
4062
4063         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
4064         now.
4065
4066 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
4067
4068         * sysdeps/pthread/sigaction.c: Removed.
4069         * sigaction.c: New file.
4070         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
4071
4072 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
4073
4074         * Makefile (tests): Add tst-signal7.
4075         * tst-signal7.c: New file.
4076
4077 2005-12-27  Roland McGrath  <roland@redhat.com>
4078
4079         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
4080         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
4081         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
4082         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
4083         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
4084         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4085         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4086         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4087         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4088         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
4089         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4090
4091 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
4092
4093         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
4094         and __prev field to pthread_mutex_t.
4095         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4096         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4097         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4098         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4099         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
4100         to pthread_mutex_t.
4101
4102 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
4103
4104         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
4105         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
4106         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
4107         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
4108         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
4109         and PTHREAD_MUTEXATTR_FLAG_BITS.
4110         * descr.h (struct pthread): Add robust_list field and define
4111         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
4112         * pthread_mutexattr_getrobust.c: New file.
4113         * pthread_mutexattr_setrobust.c: New file.
4114         * pthread_mutex_consistent.c: New file.
4115         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
4116         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
4117         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
4118         Adjust pthread_mutex_t initializers.
4119         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
4120         field to pthread_mutex_t.
4121         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
4122         and __prev field to pthread_mutex_t.
4123         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
4124         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
4125         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
4126         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
4127         * pthread_mutexattr_gettype.c: Likewise.
4128         * pthread_mutexattr_setpshared.c: Likewise.
4129         * pthread_mutexattr_settype.c: Likewise.
4130         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
4131         Initialize mutex kind according to robust flag.
4132         * pthread_mutex_lock.c: Implement local robust mutex.
4133         * pthread_mutex_timedlock.c: Likewise.
4134         * pthread_mutex_trylock.c: Likewise.
4135         * pthread_mutex_unlock.c: Likewise.
4136         * pthread_create.c (start_thread): Mark robust mutexes which remained
4137         locked as dead.
4138         * tst-robust1.c: New file.
4139         * tst-robust2.c: New file.
4140         * tst-robust3.c: New file.
4141         * tst-robust4.c: New file.
4142         * tst-robust5.c: New file.
4143         * tst-robust6.c: New file.
4144         * tst-robust7.c: New file.
4145         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
4146         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
4147         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
4148         tst-robust5, tst-robust6, and tst-robust7.
4149
4150         * tst-typesizes.c: New file.
4151         * Makefile (tests): Add tst-typesizes.
4152
4153         * tst-once3.c: More debug output.
4154
4155 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
4156
4157         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
4158         missing after last change.
4159
4160         * version.c: Update copyright year.
4161
4162 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
4163
4164         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
4165         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
4166         * pthread_mutex_trylock.c: Likewise.
4167         * pthread_mutex_timedlock.c: Likewise.
4168         * pthread_mutex_unlock.c: Likewise.
4169
4170 2005-12-22  Roland McGrath  <roland@redhat.com>
4171
4172         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
4173         so that #include_next's search location is not reset to the -I..
4174         directory where <nptl/...> can be found.
4175
4176 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
4177
4178         [BZ #1913]
4179         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4180         Fix unwind info.  Remove useless branch prediction prefix.
4181         * tst-cancel24.cc: New file.
4182         * Makefile: Add rules to build and run tst-cancel24.
4183
4184 2005-12-21  Roland McGrath  <roland@redhat.com>
4185
4186         * libc-cancellation.c: Use <> rather than "" #includes.
4187         * pt-cleanup.c: Likewise.
4188         * pthread_create.c: Likewise.
4189         * pthread_join.c: Likewise.
4190         * pthread_timedjoin.c: Likewise.
4191         * pthread_tryjoin.c: Likewise.
4192         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
4193         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
4194         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
4195         * unwind.c: Likewise.
4196
4197 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4198
4199         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
4200         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
4201         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
4202         THREAD_COPY_POINTER_GUARD): Define.
4203
4204 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
4205
4206         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
4207         rather than one.
4208         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
4209         THREAD_COPY_POINTER_GUARD): Define.
4210         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
4211         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
4212         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
4213         THREAD_COPY_POINTER_GUARD): Define.
4214         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
4215         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
4216         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
4217         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
4218         Use PTR_DEMANGLE for B0 if defined.
4219
4220 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
4221
4222         * pthread_create.c (__pthread_create_2_1): Use
4223         THREAD_COPY_POINTER_GUARD if available.
4224         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
4225         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4226         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
4227         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
4228         * sysdeps/x86_64/tls.h: Likewise.
4229
4230 2005-12-15  Roland McGrath  <roland@redhat.com>
4231
4232         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
4233
4234 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
4235
4236         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
4237         sysdeps/generic.
4238         * errno-loc.c: New file.
4239
4240 2005-12-12  Roland McGrath  <roland@redhat.com>
4241
4242         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
4243         adjustments before choosing stack size.  Update minimum stack size
4244         calculation to match allocate_stack change.
4245
4246 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
4247
4248         * allocatestack.c (allocate_stack): Don't demand that there is an
4249         additional full page available on the stack beside guard, TLS, the
4250         minimum stack.
4251
4252 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
4253
4254         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
4255         (__cleanup_fct_attribute): Use __regparm__ not regparm.
4256
4257         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
4258         compiling 32-bit code we must define __cleanup_fct_attribute.
4259
4260 005-11-24  Jakub Jelinek  <jakub@redhat.com>
4261
4262         [BZ #1920]
4263         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
4264         __attribute__ instead of __attribute.
4265         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
4266         (__cleanup_fct_attribute): Likewise.
4267
4268 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
4269
4270         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
4271         a write barrier before writing libgcc_s_getcfa.
4272
4273 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
4274
4275         * sysdeps/unix/sysv/linux/configure: Removed.
4276
4277 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
4278
4279         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
4280         optional init_array/fini_array support.
4281
4282 2005-10-24  Roland McGrath  <roland@redhat.com>
4283
4284         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
4285         versioned_symbol use.
4286
4287 2005-10-16  Roland McGrath  <roland@redhat.com>
4288
4289         * init.c (__pthread_initialize_minimal_internal): Even when using a
4290         compile-time default stack size, apply the minimum that allocate_stack
4291         will require, and round up to page size.
4292
4293 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
4294
4295         * Makefile ($(test-modules)): Remove static pattern rule.
4296
4297 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
4298             Ulrich Drepper  <drepper@redhat.com>
4299
4300         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
4301         alignment in callback function.
4302         * Makefile: Add rules to build and run tst-align3.
4303         * tst-align3.c: New file.
4304
4305 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
4306
4307         * allocatestack.c (setxid_signal_thread): Add
4308         INTERNAL_SYSCALL_DECL (err).
4309
4310 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
4311
4312         * allocatestack.c (setxid_signal_thread): Need to use
4313         atomic_compare_and_exchange_bool_acq.
4314
4315 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
4316             Jakub Jelinek  <jakub@redhat.com>
4317
4318         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
4319         CANCEL_RESTMASK.
4320         (struct pthread): Move specific_used field to avoid padding.
4321         Add setxid_futex field.
4322         * init.c (sighandler_setxid): Reset setxid flag and release the
4323         setxid futex.
4324         * allocatestack.c (setxid_signal_thread): New function.  Broken
4325         out of the bodies of the two loops in __nptl_setxid.  For undetached
4326         threads check whether they are exiting and if yes, don't send a signal.
4327         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
4328         * pthread_create.c (start_thread): For undetached threads, check
4329         whether setxid bit is set.  If yes, wait until signal has been
4330         processed.
4331
4332         * allocatestack.c (STACK_VARIABLES): Initialize them.
4333         * pthread_create.c (__pthread_create_2_1): Initialize pd.
4334
4335 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
4336
4337         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
4338         waiters, awake all waiters on the associated mutex.
4339
4340 2005-09-22  Roland McGrath  <roland@redhat.com>
4341
4342         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
4343         ../sysdeps/x86_64/hp-timing.h).
4344
4345 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
4346
4347         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
4348         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4349         (lll_futex_wake_unlock): Define.
4350         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
4351         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4352         (lll_futex_wake_unlock): Define.
4353         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
4354         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4355         (lll_futex_wake_unlock): Define.
4356         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
4357         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4358         (lll_futex_wake_unlock): Define.
4359         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
4360         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4361         (lll_futex_wake_unlock): Define.
4362         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
4363         lll_futex_wake_unlock.
4364         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4365         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4366         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
4367         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4368         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4369         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
4370
4371 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4372
4373         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4374         Fix typo in register name.
4375
4376 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
4377
4378         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4379         Use __sigfillset.  Document that sigfillset does the right thing wrt
4380         to SIGSETXID.
4381
4382 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
4383
4384         [BZ #1102]
4385         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
4386         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
4387         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
4388         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
4389         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
4390         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
4391         in the structure.
4392         * Makefile (tests): Add tst-initializers1.
4393         (CFLAGS-tst-initializers1.c): Set.
4394         * tst-initializers1.c: New test.
4395
4396 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
4397
4398         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
4399         Make sure __flags are located at offset 48 from the start of the
4400         structure.
4401
4402 2005-07-02  Roland McGrath  <roland@redhat.com>
4403
4404         * Makeconfig: Comment fix.
4405
4406 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
4407
4408         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
4409         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
4410         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
4411         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
4412         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
4413         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4414         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
4415         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
4416         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
4417         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
4418
4419 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
4420
4421         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
4422         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4423         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
4424         fields.
4425         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4426         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
4427         field.  Put in sysinfo field unconditionally.
4428         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4429         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
4430         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4431         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
4432         fields.
4433         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4434         * pthread_create.c (__pthread_create_2_1): Use
4435         THREAD_COPY_STACK_GUARD macro.
4436         * Makefile: Add rules to build and run tst-stackguard1{,-static}
4437         tests.
4438         * tst-stackguard1.c: New file.
4439         * tst-stackguard1-static.c: New file.
4440
4441 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
4442
4443         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
4444         Invoke CGOTSETUP and CGOTRESTORE.
4445         (CGOTSETUP, CGOTRESTORE): Define.
4446
4447 2005-05-29  Richard Henderson  <rth@redhat.com>
4448
4449         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
4450         (tf_write, tf_writev): Use it.
4451         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
4452         the system minimum.
4453
4454 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
4455
4456         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
4457         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
4458         __librt_*_asynccancel@local.
4459
4460 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
4461
4462         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
4463         all occurrences of JUMPTARGET.  Instead append @local to labels.
4464
4465 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
4466
4467         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
4468         size/alignment of struct pthread rather than tcbhead_t.
4469         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4470         Likewise.
4471         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4472         Likewise.
4473         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4474         Likewise.
4475
4476 2005-05-19  Richard Henderson  <rth@redhat.com>
4477
4478         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
4479         __sync_val_compare_and_swap, not explicit _si variant.
4480         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
4481
4482 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
4483
4484         [BZ #915]
4485         * sysdeps/pthread/pthread.h: Avoid empty initializers.
4486
4487 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
4488
4489         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
4490         .eh_frame section, use cfi_* directives.
4491
4492 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
4493
4494         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
4495         of "" includes.
4496
4497 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
4498
4499         [BZ #1075]
4500         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
4501         aio_write blocks.
4502
4503 2005-04-27  Roland McGrath  <roland@redhat.com>
4504
4505         * Makefile (tests): Remove tst-clock2.
4506
4507         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
4508         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
4509         translating to the kernel clockid_t for our own process/thread clock.
4510
4511         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
4512
4513 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
4514
4515         * old_pthread_cond_init.c: Include <errno.h>.
4516         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
4517         process shared or uses clock other than CLOCK_REALTIME.
4518         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
4519
4520 2005-04-13  David S. Miller  <davem@davemloft.net>
4521
4522         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
4523         * sysdeps/sparc/sparc64/clone.S: New file.
4524
4525 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
4526
4527         [BZ #1102]
4528         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
4529         __inline instead of inline.
4530         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
4531
4532 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
4533
4534         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
4535         functionally equivalent, but shorter instructions.
4536         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4537         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4538         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4539         Likewise.
4540         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
4541         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4542         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4543         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4544         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4545         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4546         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4547         Likewise.
4548         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4549         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4550         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4551         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4552         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4553
4554 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
4555
4556         * sysdeps/mips/Makefile: New file.
4557         * sysdeps/mips/nptl-sysdep.S: New file.
4558         * sysdeps/mips/tcb-offsets.sym: New file.
4559         * sysdeps/mips/pthread_spin_lock.S: New file.
4560         * sysdeps/mips/pthread_spin_trylock.S: New file.
4561         * sysdeps/mips/pthreaddef.h: New file.
4562         * sysdeps/mips/tls.h: New file.
4563         * sysdeps/mips/jmpbuf-unwind.h: New file.
4564         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
4565         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
4566         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
4567         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
4568         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
4569         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
4570         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
4571         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
4572         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
4573         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
4574
4575 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
4576
4577         [BZ #1112]
4578         * pthread_create.c (__pthread_create_2_1): Rename syscall error
4579         variable to scerr.
4580
4581 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
4582
4583         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
4584
4585 2005-02-25  Roland McGrath  <roland@redhat.com>
4586
4587         * alloca_cutoff.c: Correct license text.
4588         * tst-unload.c: Likewise.
4589         * sysdeps/pthread/allocalim.h: Likewise.
4590         * sysdeps/pthread/pt-initfini.c: Likewise.
4591         * sysdeps/pthread/bits/libc-lock.h: Likewise.
4592         * sysdeps/pthread/bits/sigthread.h: Likewise.
4593         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
4594         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4595
4596 2005-02-16  Roland McGrath  <roland@redhat.com>
4597
4598         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4599         Use unsigned int * for ptr_nthreads.
4600
4601 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
4602
4603         [BZ #721]
4604         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
4605         gcc4.
4606
4607 2005-02-07  Richard Henderson  <rth@redhat.com>
4608
4609         [BZ #787]
4610         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
4611         argument.
4612
4613 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
4614
4615         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
4616         order of arguments in invocation of atomic_add_zero.
4617
4618 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
4619
4620         [BZ #737]
4621         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
4622         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
4623         at least gotntpoff relocation and addition.
4624         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
4625         Likewise.
4626         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4627         Likewise.
4628         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4629         Likewise.
4630
4631 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
4632
4633         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
4634         entry for static tls deallocation fix.
4635         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
4636         also contains information whether the memory pointed to is static
4637         TLS or not.
4638         * sysdeps/i386/tls.h: Likewise.
4639         * sysdeps/ia64/tls.h: Likewise.
4640         * sysdeps/powerpc/tls.h: Likewise.
4641         * sysdeps/s390/tls.h: Likewise.
4642         * sysdeps/sh/tls.h: Likewise.
4643         * sysdeps/sparc/tls.h: Likewise.
4644         * sysdeps/x86_64/tls.h: Likewise.
4645
4646 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
4647
4648         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
4649
4650 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
4651
4652         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
4653         %esp.
4654         * Makefile (tests): Add tst-align2.
4655         * tst-align2.c: New test.
4656         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
4657         -mpreferred-stack-boundary=4.
4658
4659 2004-12-18  Roland McGrath  <roland@redhat.com>
4660
4661         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
4662         New file removed withdrawn for the moment.
4663
4664 2004-12-17  Richard Henderson  <rth@redhat.com>
4665
4666         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
4667         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
4668
4669 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
4670
4671         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
4672         Increased PTHREAD_STACK_MIN.
4673
4674         * tst-context1.c (stacks): Use bigger stack size.
4675
4676 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
4677
4678         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
4679         * sysdeps/sparc/tcb-offsets.sym: Add TID.
4680
4681 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
4682
4683         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
4684         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
4685         * sysdeps/s390/tcb-offsets.sym (TID): Add.
4686
4687 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
4688
4689         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
4690
4691 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
4692
4693         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
4694         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
4695
4696         * tst-getpid1.c: If child crashes, report this first.  Print which
4697         signal.
4698
4699 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
4700
4701         * init.c (__pthread_initialize_minimal_internal): Also unblock
4702         SIGSETXID.
4703
4704 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4705
4706         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
4707         _POSIX_THREAD_CPUTIME): Define to 0.
4708         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
4709         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
4710         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
4711         __timer_signal_thread_tclk): Remove.
4712         (init_module): Remove their initialization.
4713         (thread_cleanup): Remove their cleanup assertions.
4714         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
4715         __timer_signal_thread_tclk): Remove.
4716         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
4717         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
4718         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
4719
4720 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
4721
4722         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
4723         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
4724
4725         * Makefile (tests): Add tst-getpid2.
4726         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
4727         (do_test): Use it.  Use __clone2 instead of clone on ia64.
4728         * tst-getpid2.c: New test.
4729
4730 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4731
4732         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
4733
4734 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
4735
4736         * Makefile (tests): Add tst-getpid1.
4737         * tst-getpid1.c: New file.
4738         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
4739         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
4740
4741 2004-12-02  Roland McGrath  <roland@redhat.com>
4742
4743         * Makefile (libpthread-nonshared): Variable removed.
4744         ($(objpfx)libpthread_nonshared.a): Target removed.
4745         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
4746         These are now handled by generic magic from
4747         libpthread-static-only-routines being set.
4748
4749 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
4750
4751         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
4752         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
4753         _POSIX_THREAD_PRIO_PROTECT): Define.
4754         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4755         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4756         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4757
4758 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
4759
4760         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
4761         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
4762         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
4763         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
4764         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4765         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4766         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4767
4768 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
4769
4770         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
4771
4772         * Makefile (libpthread-routines): Add pthread_setschedprio.
4773         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
4774         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
4775         * pthread_setschedprio.c: New file.
4776
4777 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
4778
4779         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
4780         * pthread_cancel.c (pthread_create): Likewise.
4781
4782         * Makefile (libpthread-routines): Add vars.
4783         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
4784         * init.c (__default_stacksize, __is_smp): Remove.
4785         * vars.c: New file.
4786         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
4787         and define a wrapper macro.
4788         (PTHREAD_STATIC_FN_REQUIRE): Define.
4789         * allocatestack.c (__find_thread_by_id): Undefine.
4790         * pthread_create (__pthread_keys): Remove.
4791         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
4792         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
4793         PTHREAD_STATIC_FN_REQUIRE.
4794
4795 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4796
4797         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
4798         parameter to REGISTER macro.
4799
4800 2004-11-17  Roland McGrath  <roland@redhat.com>
4801
4802         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
4803         Make sure SIGCANCEL is blocked as well.
4804
4805 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4806
4807         * sysdeps/pthread/setxid.h: New file.
4808         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
4809         (struct xid_command): Add forward decl.
4810         (struct pthread_functions): Change return type of __nptl_setxid hook
4811         to int.
4812         * pthreadP.h (__nptl_setxid): Change return type to int.
4813         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
4814         calling thread, return its return value and set errno on failure.
4815         * descr.h (struct xid_command): Change id type to long array.
4816
4817         * Makefile: Add rules to build and test tst-setuid1 and
4818         tst-setuid1-static.
4819         * tst-setuid1.c: New test.
4820         * tst-setuid1-static.c: New test.
4821
4822 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4823
4824         * Makefile (tests): Add tst-exit3.
4825         * tst-exit3.c: New test.
4826
4827 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
4828
4829         * Makefile (tests): Add tst-exit2.
4830         * tst-exit2.c: New file.
4831
4832 2004-11-09  Roland McGrath  <roland@redhat.com>
4833
4834         [BZ #530]
4835         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
4836         here, before calling clone.
4837         * pthread_create.c (start_thread): Don't do it here.
4838
4839 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
4840
4841         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
4842
4843 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
4844
4845         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4846         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
4847         assembler warning.
4848
4849 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
4850
4851         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
4852         if sched_priority is not between minprio and maxprio.
4853
4854 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4855
4856         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4857         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
4858
4859         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4860         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
4861
4862 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
4863
4864         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
4865         not-cancelable I/O functions.
4866
4867 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4868
4869         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4870         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4871         make sure 2 is stored in the futex and we looked at the old value.
4872         Fix a few other problems to return the correct value.
4873
4874 2004-10-14  Richard Henderson  <rth@redhat.com>
4875
4876         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
4877         make gcc4 happy.
4878
4879 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
4880
4881         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
4882         of pthread-functions.h and pthreaddef.h.
4883         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
4884
4885         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4886         Change __data.__nwaiters from int to unsigned int.
4887
4888         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
4889         sysconf (_SC_THREAD_CPUTIME) returns negative value.
4890
4891         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
4892         before return type.
4893
4894         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
4895         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
4896
4897 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
4898
4899         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
4900         test fails, remove message queue.
4901         (tf_msgsnd): Likewise.
4902
4903 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4904
4905         * tst-clock1.c: Change #ifdef to #if defined.
4906         * tst-clock2.c: Likewise.
4907         * tst-cond11.c: Likewise.
4908
4909         * sysdeps/pthread/timer_create.c (timer_create): Use
4910         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
4911         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
4912         THREAD_CPUTIME.
4913
4914 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4915
4916         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
4917         _POSIX_THREAD_CPUTIME): Define to 0.
4918
4919 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
4920
4921         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
4922         and _POSIX_THREAD_CPUTIME to zero.
4923         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4924         * tst-barrier2.c: Fix testing for POSIX feature.
4925         * tst-clock1.c: Likewise.
4926         * tst-clock2.c: Likewise.
4927         * tst-cond11.c: Likewise.
4928         * tst-cond4.c: Likewise.
4929         * tst-cond6.c: Likewise.
4930         * tst-flock2.c: Likewise.
4931         * tst-mutex4.c: Likewise.
4932         * tst-mutex9.c: Likewise.
4933         * tst-rwlock12.c: Likewise.
4934         * tst-rwlock4.c: Likewise.
4935         * tst-signal1.c: Likewise.
4936         * tst-spin2.c: Likewise.
4937         * sysdeps/pthread/posix-timer.h: Likewise.
4938         * sysdeps/pthread/timer_create.c: Likewise.
4939         * sysdeps/pthread/timer_routines.c: Likewise.
4940
4941 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
4942
4943         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4944         (__lll_mutex_timedlock_wait): Address futex correctly.
4945
4946         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4947         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4948         make sure 2 is stored in the futex and we looked at the old value.
4949         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4950         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
4951         which might very well made the code not working at all before.
4952         [BZ #417]
4953
4954 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
4955
4956         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4957         allow SIGSETXID to be sent.
4958         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
4959         for SIGSETXID to be defined.
4960         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4961         SIGSETXID cannot be blocked.
4962
4963         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4964         Add __extension__ to long long types.
4965         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4966         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4967         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4968         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4969         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4970         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4971         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4972
4973 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4974
4975         * descr.h (struct pthread): Add stopped_start field.
4976         * sysdeps/pthread/createthread.c (create_thread): Set
4977         start_stopped flag in descriptor for new thread appropriately.
4978         * pthread_create.c (start_thread): Only take lock to be stopped on
4979         startup if stopped_start flag says so.
4980
4981 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
4982
4983         * pthread_create.c (__pthread_create_2_1): Remember whether thread
4984         is created detached and if yes, do not try to free the stack in case
4985         the thread creation failed.
4986         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
4987         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
4988         case there has been no error.  [BZ #405]
4989
4990         * pthread_create.c (start_thread): Don't wait for scheduler data
4991         etc to be set at the beginning of the function.  The cancellation
4992         infrastructure must have been set up.  And enable async
4993         cancellation before potentially going to sleep.  [BZ #401]
4994
4995 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
4996
4997         * Versions: Remove exports for pthread_set*id_np functions.
4998         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
4999         for now.
5000         * Makefile: Don't build pthread_set*id code for now.
5001
5002 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
5003
5004         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
5005         internal use.
5006         * allocatestack.c (__nptl_setxid): New function.
5007         * descr.h (struct xid_command): Define type.
5008         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
5009         (sighandler_setxid): New function.
5010         (__pthread_initialize_minimal): Register sighandler_setxid for
5011         SIGCANCEL.
5012         * pt-allocrtsig.c: Update comment.
5013         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
5014         Declare __nptl_setxid.
5015         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
5016         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
5017         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
5018         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
5019         and pthread_setresuid_np.
5020         * pthread_setgid_np.c: New file.
5021         * pthread_setuid_np.c: New file.
5022         * pthread_setegid_np.c: New file.
5023         * pthread_seteuid_np.c: New file.
5024         * pthread_setregid_np.c: New file.
5025         * pthread_setreuid_np.c: New file.
5026         * pthread_setresgid_np.c: New file.
5027         * pthread_setresuid_np.c: New file.
5028         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
5029         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
5030         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
5031         and pthread_setresuid_np.
5032         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
5033         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
5034         pthread_setregid, and pthread_setresgid.
5035
5036 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
5037
5038         * allocatestack.c (allocate_stack): Return EAGAIN instead of
5039         ENOMEM when out of memory.
5040
5041 2004-09-10  Roland McGrath  <roland@redhat.com>
5042
5043         [BZ #379]
5044         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
5045         code, since we don't try to use the broken CLONE_STOPPED any more.
5046         * pthread_create.c (start_thread): Likewise.
5047
5048 2004-09-15  Richard Henderson  <rth@redhat.com>
5049
5050         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
5051
5052 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
5053
5054         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
5055         (__libc_unwind_longjmp): Delete macro and declare as function.
5056         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
5057         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
5058         nptl directory.
5059         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
5060         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
5061         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
5062
5063 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
5064
5065         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
5066         for __USE_XOPEN2K.
5067         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
5068         types also for __USE_XOPEN2K.
5069         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5070         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5071         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5072         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5073         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5074         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5075         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5076         [BZ #320]
5077
5078 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
5079
5080         * sysdeps/pthread/pthread.h
5081         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
5082         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
5083         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
5084         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
5085         [BZ #375]
5086
5087 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
5088
5089         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
5090         PSEUDO to be used with . prefix.
5091
5092         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
5093         Use atomic_increment instead of atomic_exchange_and_add.
5094         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
5095         Likewise.
5096         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
5097         Likewise.
5098         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
5099         Likewise.
5100
5101         * allocatestack.c (allocate_stack): Use atomic_increment_val
5102         instead of atomic_exchange_and_add.
5103         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
5104         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
5105         Likewise.
5106         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5107         Likewise.
5108
5109         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
5110         the initialization function might throw.
5111
5112 2005-09-05  Richard Henderson  <rth@redhat.com>
5113
5114         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5115         Move definition inside libpthread, libc, librt check.  Provide
5116         definition for rtld.
5117
5118 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
5119
5120         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
5121         * sysdeps/i386/jmpbuf-unwind.h: Likewise
5122         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
5123         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
5124         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
5125         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
5126         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
5127         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
5128         * unwind.c: Use it.
5129
5130         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5131         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
5132         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
5133         Likewise.
5134         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
5135         Decrement __nwaiters.  If pthread_cond_destroy has been called and
5136         this is the last waiter, signal pthread_cond_destroy caller and
5137         avoid using the pthread_cond_t structure after unlock.
5138         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5139         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5140         Read clock type from the least significant bits of __nwaiters instead
5141         of __clock.
5142         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5143         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
5144
5145 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
5146
5147         [BZ #342]
5148         * Makefile (tests): Add tst-cond20 and tst-cond21.
5149         * tst-cond20.c: New test.
5150         * tst-cond21.c: New test.
5151         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
5152         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
5153         it unsigned int.
5154         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
5155         Likewise.
5156         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
5157         (pthread_cond_t): Likewise.
5158         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
5159         Likewise.
5160         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5161         Likewise.
5162         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
5163         Likewise.
5164         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
5165         (cond_nwaiters): New.
5166         (clock_bits): New.
5167         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
5168         if there are waiters not signalled yet.
5169         Wait until all already signalled waiters wake up.
5170         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
5171         __nwaiters.  If pthread_cond_destroy has been called and this is the
5172         last waiter, signal pthread_cond_destroy caller and avoid using
5173         the pthread_cond_t structure after unlock.
5174         (__pthread_cond_wait): Increment __nwaiters in the beginning,
5175         decrement it when leaving.  If pthread_cond_destroy has been called
5176         and this is the last waiter, signal pthread_cond_destroy caller.
5177         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5178         Likewise.  Read clock type from the least significant bits of
5179         __nwaiters instead of __clock.
5180         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
5181         whether clock ID can be encoded in COND_CLOCK_BITS bits.
5182         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
5183         clock type just from the last COND_CLOCK_BITS bits of value.
5184         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
5185         instead of __clock, just from second bit of condattr's value.
5186
5187 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
5188
5189         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
5190         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
5191         != 64.
5192         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5193
5194 2004-08-15  Roland McGrath  <roland@frob.com>
5195
5196         * pthread_atfork.c: Update copyright terms including special exception
5197         for these trivial files, which are statically linked into executables
5198         that use dynamic linking for the significant library code.
5199
5200 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
5201
5202         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
5203         pthread_rwlock_rdlock.
5204         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
5205         Decrease __nr_readers_queued after reacquiring lock.
5206         * sysdeps/pthread/pthread_rwlock_timedrdlock
5207         (pthread_rwlock_timedrdlock): Likewise.
5208         Reported by Bob Cook <bobcook47@hotmail.com>.
5209
5210 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
5211
5212         * tst-rwlock14.c (tf): Read main thread handle from *ARG
5213         before pthread_barrier_wait.
5214
5215 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
5216
5217         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
5218         Remove unnecessary exception handling data.
5219
5220 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
5221
5222         [BZ #284]
5223         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
5224         instead of clockid_t.
5225
5226 2004-07-21  Roland McGrath  <roland@redhat.com>
5227
5228         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
5229
5230 2004-07-19  Roland McGrath  <roland@redhat.com>
5231
5232         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
5233
5234 2004-07-02  Roland McGrath  <roland@redhat.com>
5235
5236         * configure: Don't exit.
5237
5238 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5239
5240         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
5241         (__pthread_cond_timedwait): Check for invalid nanosecond in
5242         timeout value.
5243
5244 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
5245
5246         * Makefile: Add rules to build and run tst-fini1.
5247         * tst-fini1.c: New file.
5248         * tst-fini1mod.c: New file.
5249
5250 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
5251
5252         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
5253         if no cancellation support is needed.
5254         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
5255         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
5256         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
5257         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
5258         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
5259         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
5260         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
5261         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
5262         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
5263
5264         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
5265         only if not already defined.
5266
5267 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
5268
5269         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
5270         constraint "m" instead of "0" for futex.
5271
5272         * shlib-versions: Add powerpc64-.*-linux.*.
5273
5274 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
5275
5276         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
5277         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
5278         for valid tv_nsec.
5279         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
5280         1 billion and 64-bit tv_nsec which is valid when truncated to 32
5281         bits.
5282
5283 2004-06-29  Roland McGrath  <roland@redhat.com>
5284
5285         * Banner: NPTL no longer has its own version number.
5286         * Makefile (nptl-version): Variable removed.
5287         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
5288         using $(version), the glibc version number.
5289
5290 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5291
5292         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5293         Fix branch offset for a PLT entry.
5294         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
5295         Likewise.
5296         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
5297         Likewise.
5298         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
5299         Likewise.
5300         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
5301         Likewise.
5302
5303 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
5304
5305         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
5306         unconditionally.
5307
5308 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
5309
5310         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
5311         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
5312         instead of tv_sec.
5313         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
5314         (pthread_rwlock_timedrdlock): Likewise.
5315
5316 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
5317
5318         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
5319         Set __r7 to val, not mutex.
5320
5321 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
5322
5323         * Makefile: Add rules to build tst-rwlock14.
5324         * tst-rwlock14.c: New file.
5325
5326 2004-06-24  Boris Hu  <boris.hu@intel.com>
5327
5328         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
5329         check.
5330         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
5331
5332 2004-06-19  Andreas Jaeger  <aj@suse.de>
5333
5334         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
5335         assembler in last patch.
5336
5337 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
5338
5339         * sysdeps/pthread/pthread_cond_timedwait.c
5340         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
5341         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5342         (__pthread_cond_timedwait): Check for invalid nanosecond in
5343         timeout value.
5344         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5345         * tst-cond19.c: New file.
5346         * Makefile: Add rules to build and run tst-cond19.
5347
5348 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
5349
5350         * tst-context1.c (GUARD_PATTERN): Defined.
5351         (tst_context_t): Define struct containing ucontext_t & guard words.
5352         (ctx): Declare as an array of tst_context_t.
5353         (fct): Verify uc_link & guard words are still valid.
5354         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
5355
5356 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5357
5358         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5359         Add __data.__futex field, reshuffle __data.__clock.
5360         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
5361         (__pthread_cond_signal): Increment __futex at the same time as
5362         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5363         address of low 32-bits of __wakeup_seq to futex syscall.
5364         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5365         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5366         releasing internal lock to FUTEX_WAIT.
5367         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
5368         (__pthread_cond_timedwait): Likewise.
5369         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5370         (FUTEX_CMP_REQUEUE): Define.
5371         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5372         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5373         Pass __futex value from before the unlock and __futex address instead
5374         of address of low 32-bits of __wakeup_seq to futex syscall.
5375         Fallback to FUTEX_WAKE all on any errors.
5376
5377 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
5378
5379         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
5380         comment typo.
5381         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
5382         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
5383         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
5384         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
5385         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
5386
5387 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5388
5389         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
5390         Add memory clobber to inline assembly.
5391         (__lll_mutex_trylock): Likewise.
5392         (__lll_mutex_cond_trylock): Likewise.
5393
5394 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5395
5396         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
5397         Pass val argument as 6th system call argument in %r7.
5398
5399 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5400
5401         * Makefile (tests): Add tst-cond16.
5402         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
5403         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
5404         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5405         Add __data.__futex field, reshuffle __data.__clock.
5406         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
5407         (__pthread_cond_signal): Increment __futex at the same time as
5408         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5409         address of low 32-bits of __wakeup_seq to futex syscall.
5410         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
5411         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5412         releasing internal lock to FUTEX_WAIT.
5413         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
5414         (__pthread_cond_timedwait): Likewise.
5415         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
5416         (FUTEX_CMP_REQUEUE): Define.
5417         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5418         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5419         Pass __futex value from before the unlock and __futex address instead
5420         of address of low 32-bits of __wakeup_seq to futex syscall.
5421         Fallback to FUTEX_WAKE all on any errors.
5422         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
5423         Define.
5424         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5425         internally.  Return non-zero if error, zero if success.
5426         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5427         Add __data.__futex field, reshuffle __data.__clock.
5428         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
5429         Define.
5430         (lll_futex_requeue): Add val argument, return 1 unconditionally
5431         for the time being.
5432         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
5433         Add __data.__futex field, reshuffle __data.__clock.
5434         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
5435         Define.
5436         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5437         internally.  Return non-zero if error, zero if success.
5438         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
5439         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
5440         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
5441         Define.
5442         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5443         internally.  Return non-zero if error, zero if success.
5444         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
5445         Add __data.__futex field, reshuffle __data.__clock.
5446         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
5447         Define.
5448         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5449         internally.  Return non-zero if error, zero if success.
5450         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
5451         Add __data.__futex field, reshuffle __data.__clock.
5452         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
5453         Add __data.__futex field, reshuffle __data.__clock.
5454         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
5455         Increment __futex at the same time as __wakeup_seq or __total_seq.
5456         Pass address of __futex instead of address of low 32-bits of
5457         __wakeup_seq to futex syscall.
5458         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5459         Pass __futex value from before releasing internal lock
5460         to FUTEX_WAIT.
5461         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5462         Likewise.  Avoid unnecessary shadowing of variables.
5463         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
5464         Set __futex to 2 * __total_seq.  Pass __futex value from before the
5465         unlock and __futex address instead of address of low 32-bits of
5466         __wakeup_seq to futex_requeue macro, adjust for new return value
5467         meaning.
5468         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
5469         (__pthread_cond_signal): Increment __futex at the same time as
5470         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5471         address of low 32-bits of __wakeup_seq to futex syscall.
5472         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5473         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5474         releasing internal lock to FUTEX_WAIT.
5475         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5476         (__pthread_cond_timedwait): Likewise.
5477         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5478         (FUTEX_CMP_REQUEUE): Define.
5479         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5480         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5481         Pass __futex value from before the unlock and __futex address instead
5482         of address of low 32-bits of __wakeup_seq to futex syscall.
5483         Fallback to FUTEX_WAKE all on any errors.
5484
5485 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5486
5487         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
5488         Add nop to align the end of critical section.
5489         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
5490
5491 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5492
5493         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5494         Add __broadcast_seq field.
5495         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
5496         all waiters as woken with woken_seq and bump broadcast counter.
5497         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
5498         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
5499         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5500         Comment typo fixes.  Avoid returning -ETIMEDOUT.
5501
5502 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
5503
5504         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5505         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
5506         Reported by Kaz Kojima.
5507
5508 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
5509
5510         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
5511
5512 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5513
5514         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
5515         __broadcast_seq with bc_seq after acquiring internal lock instead of
5516         before it.
5517
5518 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
5519
5520         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
5521         compilation.
5522         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5523         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
5524         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5525         (pthread_cond_t): Add __data.__broadcast_seq field.
5526         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5527         (FRAME_SIZE): Define.
5528         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
5529         Comment typo fixes.
5530         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
5531         Define.
5532         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
5533         typo fixes.
5534         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5535         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
5536         fixes.
5537
5538 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
5539
5540         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
5541         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5542         Add __broadcast_seq field.
5543         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5544         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5545         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5546         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5547         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5548         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
5549         all waiters as woken with woken_seq and bump broadcast counter.
5550         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
5551         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
5552         __broadcast_seq field.
5553         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5554         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
5555         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5556         * pthread_cond_init.c: Initialize __broadcast_seq field.
5557         * Makefile (tests): Add tst-cond17 and tst-cond18.
5558         Add .NOTPARALLEL goal.
5559         * tst-cond16.c: New file.  From Jakub.
5560         * tst-cond17.c: New file.  From Jakub.
5561         * tst-cond18.c: New file.  From Jakub.
5562
5563 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
5564
5565         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
5566         unwind info.
5567
5568         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
5569         Parametrize frame size.  Correct some unwind info.
5570         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5571
5572 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5573
5574         * tst-stack3.c: Note testing functionality beyond POSIX.
5575
5576 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5577
5578         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
5579         Change conditional from ifdef to if.
5580
5581 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
5582
5583         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
5584         SYSDEP_CANCEL_ERROR): Define.
5585         (PSEUDO): Use it.
5586
5587 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
5588
5589         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
5590
5591 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
5592
5593         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
5594
5595 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5596
5597         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
5598         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5599         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
5600         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5601
5602 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
5603
5604         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
5605         thread has all signals blocked.
5606
5607 2004-04-18  Andreas Jaeger  <aj@suse.de>
5608
5609         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
5610         (SEM_VALUE_MAX): Add missing brace.
5611
5612 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5613
5614         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
5615         in rt subdir.
5616         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
5617         * sysdeps/pthread/tst-mqueue8x.c: New test.
5618         * tst-cancel4.c: Update comment about message queues.
5619
5620         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
5621         return it_value { 0, 0 }.
5622         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
5623         like SIGEV_SIGNAL.
5624         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
5625         assertion for SIGEV_NONE.
5626         (thread_attr_compare): Compare all attributes, not just a partial
5627         subset.
5628
5629 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5630
5631         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
5632
5633 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
5634
5635         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
5636         Just use a plain number.
5637         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
5638         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
5639         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
5640         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
5641         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
5642         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
5643         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5644
5645 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5646
5647         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
5648         frame info.
5649         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5650
5651 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
5652
5653         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
5654         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
5655         of calling sigwaitinfo.
5656
5657 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
5658
5659         * allocatestack.c (allocate_stack): Set reported_guardsize
5660         unconditionally.
5661         * pthread_getattr_np.c (pthread_getattr_np): Use
5662         reported_guardsize instead of guardsize.
5663         * descr.h (struct pthread): Add reported_guardsize field.
5664
5665 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
5666
5667         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
5668
5669 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
5670
5671         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
5672
5673 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5674
5675         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
5676         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
5677         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
5678         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
5679         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
5680         Define.
5681         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
5682         (_POSIX_MESSAGE_PASSING): Define.
5683         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
5684         (_POSIX_MESSAGE_PASSING): Define.
5685         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
5686         (_POSIX_MESSAGE_PASSING): Define.
5687
5688 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
5689
5690         * tst-context1.c (fct): Check whether correct stack is used.
5691
5692 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
5693
5694         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
5695         matching constraints for asm mem parameters.
5696
5697         * tst-clock2.c (tf): Don't define unless needed.
5698
5699 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
5700
5701         * Makefile (link-libc-static): Use $(static-gnulib) instead of
5702         $(gnulib).
5703
5704 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
5705
5706         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
5707         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
5708         * pthreadP.h: Declare __nptl_deallocate_tsd.
5709         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
5710         Adjust caller.
5711
5712         * Makefile (tests): Add tst-tsd5.
5713         * tst-tsd5.c: New file.
5714
5715 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
5716
5717         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5718         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
5719         is SHLIB_COMPAT check.
5720         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5721         (__pthread_attr_getaffinity_old): Likewise.
5722         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5723         (__pthread_getaffinity_old): Likewise.
5724         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5725         (__pthread_setaffinity_old): Likewise.
5726
5727 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
5728
5729         * allocatestack.c (_make_stacks_executable): Call
5730         _dl_make_stack_executable first.
5731
5732 2004-03-24  Roland McGrath  <roland@redhat.com>
5733
5734         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
5735         constraint instead of "0".
5736
5737 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
5738
5739         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5740         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
5741
5742         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
5743         code to avoid warning.
5744
5745 2004-03-24  Andreas Jaeger  <aj@suse.de>
5746
5747         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5748         (__pthread_attr_setaffinity_old): Remove const.
5749
5750 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
5751
5752         * sysdeps/unix/sysv/linux/smp.h: New file.
5753         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
5754         * init.c: Define __is_smp.
5755         (__pthread_initialize_minimal_internal): Call is_smp_system to
5756         initialize __is_smp.
5757         * pthreadP.h: Declare __is_smp.
5758         Define MAX_ADAPTIVE_COUNT is necessary.
5759         * pthread_mutex_init.c: Add comment regarding __spins field.
5760         * pthread_mutex_lock.c: Implement adaptive mutex type.
5761         * pthread_mutex_timedlock.c: Likewise.
5762         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
5763         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
5764         Add __spins field.
5765         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5766         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5767         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5768         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5769         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5770         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5771         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5772         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
5773         lll_mutex_cond_trylock.
5774         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5775         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5776         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5777         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5778         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5779         Define BUSY_WAIT_NOP.
5780         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5781         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5782
5783         * tst-mutex5.c: Add support for testing adaptive mutexes.
5784         * tst-mutex7.c: Likewise.
5785         * tst-mutex5a.c: New file.
5786         * tst-mutex7a.c: New file.
5787         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
5788
5789         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5790         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
5791         vgettimeofday call might destroy the content.
5792
5793         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
5794         @pause in the loop.
5795
5796         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5797         No need to restrict type of ret.  Make it int.  Add comment.
5798
5799         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5800         Remove unnecessary setne instruction.
5801
5802 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
5803
5804         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5805         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
5806         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
5807         If realloc fails, break out of the loop.
5808
5809 2004-03-20  Andreas Jaeger  <aj@suse.de>
5810
5811         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5812         (__pthread_setaffinity_old): Fix interface.
5813         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5814         (__pthread_getaffinity_old): Likewise.
5815
5816         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5817         (__pthread_setaffinity_new): Remove duplicate declaration.
5818
5819 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5820
5821         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
5822         the return value to a safe register.
5823         (CDISABLE): Set the function argument correctly.
5824
5825 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5826
5827         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
5828         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
5829         Rewrite so that only one locked memory operation per round is needed.
5830         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
5831         (pthread_barrier_wait): After wakeup, release lock only when the
5832         last thread stopped using the barrier object.
5833         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5834         (__pthread_cond_wait): Don't store mutex address if the current
5835         value is ~0l.  Add correct cleanup support and unwind info.
5836         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5837         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5838         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
5839         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
5840         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5841         Add correct cleanup support and unwind info.
5842         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
5843         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
5844         information for syscall wrappers.
5845
5846 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
5847
5848         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5849         cpusetsize field, remove next.
5850         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
5851         parameter for size of the CPU set.
5852         (pthread_setaffinity_np): Likewise.
5853         (pthread_attr_getaffinity_np): Likewise.
5854         (pthread_attr_setaffinity_np): Likewise.
5855         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
5856         interface change, keep compatibility code.
5857         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
5858         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
5859         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
5860         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
5861         __pthread_getaffinity_np.
5862         * Versions: Add version for changed interfaces.
5863         * tst-attr3.c: Adjust test for interface change.
5864         * pthread_getattr_np.c: Query the kernel about the affinity mask with
5865         increasing buffer sizes.
5866         * pthread_attr_destroy.c: Remove unused list handling.
5867         * pthread_attr_init.c: Likewise.
5868
5869 2004-03-17  Roland McGrath  <roland@redhat.com>
5870
5871         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
5872         first argument to clock_getres so we ever enable kernel timers.
5873
5874 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
5875
5876         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
5877
5878 2004-03-12  Richard Henderson  <rth@redhat.com>
5879
5880         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
5881         oldvalue from CENABLE to CDISABLE.
5882
5883 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
5884
5885         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
5886         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
5887         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
5888         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
5889
5890 2004-03-11  Richard Henderson  <rth@redhat.com>
5891
5892         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
5893         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
5894         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
5895
5896 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5897
5898         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
5899         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
5900         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
5901
5902 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5903
5904         * forward.c (__pthread_cond_broadcast_2_0,
5905         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
5906         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
5907         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
5908
5909 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5910
5911         * sysdeps/sh/tcb-offsets.sym: Add PID.
5912         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
5913         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
5914
5915 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
5916
5917         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
5918         include <sysdep-cancel.h>, vfork is no cancellation point.
5919         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
5920         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
5921         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
5922
5923 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
5924
5925         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
5926         libc_hidden_def.
5927         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
5928         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
5929         Likewise.
5930         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
5931         Likewise.
5932         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
5933         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
5934         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
5935         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
5936         of DO_CALL_VIA_BREAK.  Work around a gas problem.
5937
5938         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
5939         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
5940         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
5941         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
5942         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
5943         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
5944
5945         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
5946         a local register for saving old PID.  Negate PID in parent upon exit.
5947
5948         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
5949         tcb-offsets.h.
5950         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5951         before syscall, set to the old value in the parent afterwards.
5952         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
5953         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
5954         tcb-offsets.h.
5955         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5956         before syscall, set to the old value in the parent afterwards.
5957         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
5958         * sysdeps/s390/tcb-offsets.sym: Add PID.
5959
5960         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
5961         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
5962         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
5963         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
5964         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
5965         * sysdeps/sparc/tcb-offsets.sym: Add PID.
5966
5967 2004-03-10  Andreas Schwab  <schwab@suse.de>
5968
5969         * sysdeps/ia64/tcb-offsets.sym: Add PID.
5970         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
5971         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
5972
5973 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
5974
5975         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
5976         * tst-cancel21.c (do_one_test): Likewise.
5977         Reported by Gordon Jin <gordon.jin@intel.com>.
5978
5979 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
5980
5981         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
5982         if non-zero and set to INT_MIN if zero.
5983         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
5984         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
5985         (SAVE_PID, RESTORE_PID): Define.
5986         (__vfork): Use it.
5987         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
5988         Use relative path to avoid including NPTL i386/vfork.S.
5989         (SAVE_PID, RESTORE_PID): Define.
5990         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
5991         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
5992         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
5993         tst-vfork2x.
5994         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
5995         * tst-vfork1.c: New test.
5996         * tst-vfork2.c: New test.
5997         * tst-vfork1x.c: New test.
5998         * tst-vfork2x.c: New test.
5999
6000 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
6001
6002         * sysdeps/i386/tcb-offsets.sym: Add PID.
6003         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6004         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
6005         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
6006
6007 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
6008
6009         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
6010
6011 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
6012
6013         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
6014         _rtld_global_ro.
6015
6016 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
6017
6018         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
6019         _rtld_global_ro.
6020
6021         * tst-once4.c: Remove unnecessary macro definition.
6022
6023         * tst-mutex7.c (do_test): Limit thread stack size.
6024         * tst-once2.c (do_test): Likewise.
6025         * tst-tls3.c (do_test): Likewise.
6026         * tst-tls1.c (do_test): Likewise.
6027         * tst-signal3.c (do_test): Likewise.
6028         * tst-kill6.c (do_test): Likewise.
6029         * tst-key4.c (do_test): Likewise.
6030         * tst-join4.c (do_test): Likewise.
6031         * tst-fork1.c (do_test): Likewise.
6032         * tst-context1.c (do_test): Likewise.
6033         * tst-cond2.c (do_test): Likewise.
6034         * tst-cond10.c (do_test): Likewise.
6035         * tst-clock2.c (do_test): Likewise.
6036         * tst-cancel10.c (do_test): Likewise.
6037         * tst-basic2.c (do_test): Likewise.
6038         * tst-barrier4.c (do_test): Likewise.
6039
6040 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
6041
6042         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
6043
6044 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
6045
6046         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6047         (__pthread_cond_timedwait): Optimize wakeup test.
6048         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6049         (__pthread_cond_wait): Likewise.
6050         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
6051         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6052         Likewise.
6053
6054 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
6055
6056         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6057         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
6058         the atomic instruction needed.
6059         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
6060         (__lll_mutex_lock_wait): Likewise.
6061
6062 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
6063
6064         * Makefile (tests): Add tst-cond14 and tst-cond15.
6065         * tst-cond14.c: New file.
6066         * tst-cond15.c: New file.
6067
6068 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
6069
6070         * sysdeps/pthread/createthread.c (create_thread): Remove use of
6071         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
6072         needs to be implemented differently to be useful.
6073
6074 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
6075
6076         * pthread_attr_setschedparam.c: Don't test priority against limits
6077         here.  Set ATTR_FLAG_SCHED_SET flag.
6078         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
6079         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
6080         from parent thread to child.  If attribute is used and scheduling
6081         parameters are not inherited, copy parameters from attribute or
6082         compute them.  Check priority value.
6083         * pthread_getschedparam.c: If the parameters aren't known yet get
6084         them from the kernel.
6085         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
6086         ATTR_FLAG_POLICY_SET flag for thread.
6087         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
6088         and ATTR_FLAG_POLICY_SET.
6089
6090         * sysdeps/pthread/createthread.c: Use tgkill if possible.
6091
6092         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
6093         fail if stack address hasn't been set.  Just return 0.
6094
6095 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
6096
6097         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
6098         libpthread for the files in this list.
6099         (CFLAGS-tst-unload): Removed.
6100         * tst-unload.c (do_test): Don't use complete path for
6101         LIBPHREAD_SO.
6102
6103         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
6104         tst-_res1mod2.
6105
6106 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
6107
6108         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6109         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
6110         operation per round is needed.
6111         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
6112         (__lll_mutex_lock_wait): Likewise.
6113
6114 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
6115
6116         * tst-cancel9.c (cleanup): Don't print to stderr.
6117
6118 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6119
6120         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
6121
6122 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
6123
6124         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
6125         (__syscall_error_handler2): Call CDISABLE.
6126         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
6127         (__syscall_error_handler2): Call CDISABLE.
6128
6129         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
6130         Release lock before the loop, don't reacquire it.
6131
6132         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
6133
6134 2004-02-19  Andreas Schwab  <schwab@suse.de>
6135
6136         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
6137         Fix last change.
6138
6139 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
6140
6141         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
6142         (pthread_barrier_wait): After wakeup, release lock only when the
6143         last thread stopped using the barrier object.
6144         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
6145         (pthread_barrier_wait): Likewise.
6146         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
6147         Likewise.
6148         * Makefile (tests): Add tst-barrier4.
6149         * tst-barrier4.c: New file.
6150
6151         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6152         (__pthread_cond_timedwait): Perform timeout test while holding
6153         internal lock to prevent wakeup race.
6154         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
6155         * sysdeps/pthread/pthread_cond_timedwait.c
6156         (__pthread_cond_timedwait): Likewise.
6157         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6158         (__pthread_cond_timedwait): Likewise.
6159
6160 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
6161
6162         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
6163         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
6164         * Makefile (tests): Add tst-rwlock13.
6165         * tst-rwlock13.c: New test.
6166
6167 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
6168
6169         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6170         (__condvar_tw_cleanup): Little optimization.
6171         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
6172
6173 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
6174
6175         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
6176         libpthread as "lib" parameter to SHLIB_COMPAT.
6177         (__novmx_siglongjmp): Fix typo in function name.
6178         (__novmx_longjmp): Fix typo in function name.
6179
6180 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
6181
6182         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
6183         __builtin_expect.
6184
6185         * sysdeps/generic/pt-longjmp.c: Moved to...
6186         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
6187
6188 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
6189
6190         * Makefile (libpthread-routines): Add pt-cleanup.
6191         * pt-longjmp.c: Removed.
6192         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
6193         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
6194         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
6195         Version longjmp, siglongjmp for GLIBC_2.3.4.
6196         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
6197
6198 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
6199
6200         * sysdeps/pthread/pthread_cond_timedwait.c
6201         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
6202         Reuse code.  Add __builtin_expects.
6203
6204         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6205         (__pthread_cond_timedwait): Get internal lock in case timeout has
6206         passed before the futex syscall.
6207         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6208
6209 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
6210
6211         * allocatestack.c: Pretty printing.
6212
6213         * sysdeps/pthread/createthread.c (create_thread): Don't add
6214         CLONE_DETACHED bit if it is not necessary.
6215
6216 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
6217
6218         * pthread_getattr_np.c: Include ldsodefs.h.
6219
6220 2004-01-16  Richard Henderson  <rth@redhat.com>
6221
6222         * allocatestack.c: Don't declare __libc_stack_end.
6223         * init.c (__pthread_initialize_minimal_internal): Likewise.
6224         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
6225
6226 2004-01-15  Richard Henderson  <rth@redhat.com>
6227
6228         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
6229         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
6230         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
6231         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
6232         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
6233         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
6234         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
6235         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
6236
6237 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
6238
6239         * init.c (pthread_functions): Make array const.
6240
6241 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
6242
6243         * allocatestack.c (__make_stacks_executable): Change interface.
6244         Check parameters.  Pass parameter on to libc counterpart.
6245         * pthreadP.h: Change declaration.
6246
6247 2004-01-13  Richard Henderson  <rth@redhat.com>
6248
6249         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
6250         prototype form.
6251         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
6252         Likewise.
6253
6254         * sysdeps/alpha/Makefile: New file.
6255         * sysdeps/alpha/tcb-offsets.sym: New file.
6256         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
6257         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
6258
6259         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
6260         on powerpc version.
6261
6262 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
6263
6264         * Makefile (tests): Add tst-backtrace1.
6265         * tst-backtrace1.c: New test.
6266
6267 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
6268
6269         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
6270         register as second parameter to the REGISTER macro.
6271         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
6272         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
6273         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
6274         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
6275         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
6276         of thread register as second parameter to REGISTER macro in 64 case.
6277
6278 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
6279
6280         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
6281         (CFLAGS-getpid.o): Defined.
6282         (CFLAGS-getpid.os): Defined.
6283
6284 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
6285
6286         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
6287         returned for main thread does not overlap with any other VMA.
6288         Patch by Jakub Jelinek.
6289
6290 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
6291
6292         * tst-raise1.c: Include stdio.h.
6293
6294 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
6295
6296         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
6297         setting with __ASSUME_TGKILL || defined __NR_tgkill.
6298         If pid is 0, set it to selftid.
6299         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
6300         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
6301         != 0, return self->tid without doing a syscall.
6302         * descr.h (struct pthread): Move pid field after tid.
6303
6304         * Makefile (tests): Add tst-raise1.
6305         * tst-raise1.c: New file.
6306
6307 2003-12-23  Roland McGrath  <roland@redhat.com>
6308
6309         * tst-oddstacklimit.c: New file.
6310         * Makefile (tests): Add it.
6311         (tst-oddstacklimit-ENV): New variable.
6312
6313         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
6314         value up to page size for __default_stacksize.
6315
6316 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
6317
6318         * Makefile (tests): Add tst-eintr5.
6319         * tst-eintr5.c: New file.
6320
6321         * eintr.c (eintr_source): Prevent sending signal to self.
6322
6323         * tst-eintr2.c (tf1): Improve error message.
6324
6325 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
6326
6327         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
6328         * sysdeps/unix/sysv/linux/getpid.c: New file.
6329         * pthread_cancel.c: Add comment explaining use of PID field.
6330         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6331         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
6332         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
6333         temporarily to signal the field must not be relied on and updated
6334         by getpid().
6335         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
6336         temporarily negative.
6337         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6338
6339 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
6340
6341         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
6342         (eintr_source): If ARG != NULL, use pthread_kill.
6343         * tst-eintr1.c: Adjust for this change.
6344         * tst-eintr2.c: Likewise.
6345         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
6346         * tst-eintr3.c: New file.
6347         * tst-eintr4.c: New file.
6348
6349 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
6350
6351         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
6352         if CANCELSTATE_BITMASK is set.
6353         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
6354         Likewise.
6355
6356         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
6357         (tests-reverse): Add tst-cancel23.
6358         * tst-cancel22.c: New test.
6359         * tst-cancel23.c: New test.
6360
6361 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
6362
6363         * tst-eintr1.c: Better error messages.
6364
6365         * Makefile (tests): Add tst-eintr2.
6366         * tst-eintr2.c: New file.
6367
6368 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
6369
6370         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
6371         (CFLAGS-tst-cancelx21.c): Set.
6372         * tst-cancel21.c: New test.
6373         * tst-cancelx21.c: New test.
6374
6375         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
6376         comparison operand.
6377         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
6378         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
6379         * pt-longjmp.c: Include jmpbuf-unwind.h.
6380         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
6381         _JMPBUF_UNWINDS.  Adjust compared pointers.
6382         * init.c (__pthread_initialize_minimal_internal): Initialize
6383         pd->stackblock_size.
6384         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
6385         * sysdeps/alpha/jmpbuf-unwind.h: New file.
6386         * sysdeps/i386/jmpbuf-unwind.h: New file.
6387         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
6388         * sysdeps/s390/jmpbuf-unwind.h: New file.
6389         * sysdeps/sh/jmpbuf-unwind.h: New file.
6390         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
6391         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
6392         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
6393         (_JMPBUF_CFA_UNWINDS): Remove.
6394         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
6395
6396 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
6397
6398         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
6399         (CFLAGS-tst-cancelx20.c): Set.
6400         * tst-cancel20.c: New test.
6401         * tst-cancelx20.c: New test.
6402
6403 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
6404
6405         * init.c (__pthread_initialize_minimal_internal): Don't treat
6406         architectures with separate register stack special here when
6407         computing default stack size.
6408
6409 2003-12-17  Roland McGrath  <roland@redhat.com>
6410
6411         * Makefile (tst-cancelx7-ARGS): New variable.
6412         Reportd by Greg Schafer <gschafer@zip.com.au>.
6413
6414 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
6415
6416         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
6417         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
6418         (tst-stack3-ENV): Set.
6419         ($(objpfx)tst-stack3-mem): New.
6420         * tst-stack3.c: New test.
6421
6422 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
6423
6424         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
6425         Add unwind directives.  Drop unused .regstk directive.
6426         (_fini_EPILOG_BEGINS): Add unwind directives.
6427
6428 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
6429
6430         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
6431         Assume parameter is a pointer.
6432         (lll_futex_wake): Likewise.
6433         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
6434         Likewise.
6435         (lll_futex_wake): Likewise.
6436         Reported by Boris Hu.
6437         * sysdeps/unix/sysv/linux/unregister-atfork.c
6438         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
6439
6440         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
6441
6442 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
6443
6444         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
6445         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
6446         __rtld_lock_initialize for ld.so lock.
6447         Patch in part by Adam Li <adam.li@intel.com>.
6448
6449 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
6450
6451         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
6452         in $(gnulib).  Also, remove stale comment.
6453
6454 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
6455
6456         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
6457         advantage of new syscall stub and optimize accordingly.
6458
6459         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
6460         from SYS_futex, to match expectations of
6461         sysdep.h:DO_INLINE_SYSCALL.
6462         (lll_futex_clobbers): Remove.
6463         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
6464         (lll_futex_wake): Likewise.
6465         (lll_futex_requeue): Likewise.
6466         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
6467         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
6468         Jelinek).
6469         (__lll_mutex_lock): Likewise.
6470         (__lll_mutex_cond_lock): Likewise.
6471         (__lll_mutex_timed_lock): Likewise.
6472         (__lll_mutex_unlock): Likewise.
6473         (__lll_mutex_unlock_force): Likewise.
6474
6475         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
6476         comes before the include of <sysdep.h>.
6477         (THREAD_SELF_SYSINFO): New macro.
6478         (THREAD_SYSINFO): Likewise.
6479         (INIT_SYSINFO): New macro.
6480         (TLS_INIT_TP): Call INIT_SYSINFO.
6481
6482         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
6483
6484         * sysdeps/pthread/createthread.c (create_thread): Use
6485         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
6486         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
6487         THREAD_SELF_SYSINFO instead of open code.
6488         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
6489         (THREAD_SYSINFO): Likewise.
6490
6491         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
6492
6493         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
6494
6495 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
6496
6497         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
6498         instead of .init.  Patch by David Mosberger.
6499
6500 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
6501
6502         * sysdeps/pthread/configure.in: Remove broken declaration in C
6503         cleanup handling check.
6504
6505 2003-11-30  Andreas Jaeger  <aj@suse.de>
6506
6507         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
6508         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
6509         Likewise.
6510
6511 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
6512
6513         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
6514         * pthread_attr_destroy.c: Include shlib-compat.h.
6515         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
6516         is set in iattr->flags.
6517         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
6518
6519 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
6520
6521         * Makefile (distribute): Add tst-cleanup4aux.c.
6522
6523         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
6524         include.
6525
6526 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
6527
6528         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
6529         pthread_cond_signal.
6530
6531         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
6532         store mutex address if the current value is ~0l.
6533         * sysdeps/pthread/pthread_cond_timedwait.c
6534         (__pthread_cond_timedwait): Likewise.
6535         * sysdeps/pthread/pthread_cond_broadcast.c
6536         (__pthread_cond_broadcast): Don't use requeue for pshared
6537         condvars.
6538
6539         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
6540         (__pthread_cond_wait): Don't store mutex address if the current
6541         value is ~0l.
6542         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6543         (__pthread_cond_timedwait): Likewise.
6544         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
6545         (__pthread_cond_broadcast): Don't use requeue for pshared
6546         condvars.
6547
6548         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
6549         element with ~0l for pshared condvars, with NULL otherwise.
6550
6551         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6552         (__pthread_cond_wait): Don't store mutex address if the current
6553         value is ~0l.
6554         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6555         (__pthread_cond_timedwait): Likewise.
6556         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6557         (__pthread_cond_broadcast): Don't use requeue for pshared
6558         condvars.
6559
6560         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
6561         * tst-cond12.c: New file.
6562         * tst-cond13.c: New file.
6563
6564 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
6565
6566         * sysdeps/pthread/configure.in: Make missing forced unwind support
6567         fatal.
6568
6569 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
6570
6571         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
6572
6573 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
6574
6575         * Makefile: Add magic to clean up correctly.
6576
6577 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
6578
6579         * unwind.c (FRAME_LEFT): Define.
6580         (unwind_stop): Handle old style cleanups here.
6581         (__pthread_unwind): Handle old style cleanups only if
6582         !HAVE_FORCED_UNWIND.
6583         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
6584         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
6585         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
6586         ($(objpfx)tst-cleanupx4): Likewise.
6587         * tst-cleanup4.c: New test.
6588         * tst-cleanup4aux.c: New.
6589         * tst-cleanupx4.c: New test.
6590
6591 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
6592
6593         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
6594         lll_mutex_*lock macros to skip atomic operations on some archs.
6595
6596 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
6597
6598         * sysdeps/pthread/tst-timer.c (main): Initialize
6599         sigev2.sigev_value as well.
6600
6601 2003-10-15  Roland McGrath  <roland@redhat.com>
6602
6603         * sysdeps/pthread/configure.in: Barf if visibility attribute support
6604         is missing.
6605         * sysdeps/pthread/configure: Regenerated.
6606
6607 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6608
6609         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
6610         locking macros.  No distinction between normal and mutex locking
6611         anymore.
6612         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
6613         Merge bits from lowlevelmutex.S we still need.
6614         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
6615         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
6616         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
6617         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
6618         new mutex implementation.
6619         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
6620         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6621         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6622         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6623         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
6624         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6625         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6626         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
6627         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6628         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
6629         symbol for entry point to avoid cancellation.
6630
6631 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
6632
6633         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
6634         changes.
6635         (SAVE_OLDTYPE_0): Fix a typo.
6636
6637 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
6638
6639         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6640         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
6641
6642 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6643
6644         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
6645         correct offset.
6646
6647 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
6648
6649         * Makefile (tests): Add tst-cancel19.
6650         * tst-cancel19.c: New test.
6651
6652 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6653
6654         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
6655         restoring of the old cancellation type.
6656
6657 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
6658
6659         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
6660
6661 2003-09-27  Wolfram Gloger  <wg@malloc.de>
6662
6663         * sysdeps/pthread/malloc-machine.h: New file
6664
6665 2003-09-24  Roland McGrath  <roland@redhat.com>
6666
6667         * allocatestack.c (__make_stacks_executable): Don't ignore return
6668         value from _dl_make_stack_executable.
6669
6670 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
6671
6672         * allocatestack.c (__make_stacks_executable): Also change
6673         permission of the currently unused stacks.
6674
6675         * allocatestack.c (change_stack_perm): Split out from
6676         __make_stacks_executable.
6677         (allocate_stack): If the required permission changed between the time
6678         we started preparing the stack and queueing it, change the permission.
6679         (__make_stacks_executable): Call change_stack_perm.
6680
6681         * Makefile: Build tst-execstack-mod locally.
6682         * tst-execstack-mod.c: New file.
6683
6684 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
6685
6686         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
6687
6688 2003-09-23  Roland McGrath  <roland@redhat.com>
6689
6690         * tst-execstack.c: New file.
6691         * Makefile (tests): Add it.
6692         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
6693         (LDFLAGS-tst-execstack): New variable.
6694
6695         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
6696         whether to use PROT_EXEC for stack mmap.
6697         (__make_stacks_executable): New function.
6698         * pthreadP.h: Declare it.
6699         * init.c (__pthread_initialize_minimal_internal): Set
6700         GL(dl_make_stack_executable_hook) to that.
6701
6702 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6703
6704         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
6705         recommendation from AMD re avoidance of lock prefix.
6706
6707 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
6708
6709         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
6710         lll_futex_timed_wait instead of lll_futex_wait.
6711         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
6712         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
6713         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
6714         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
6715         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
6716         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
6717         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
6718         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
6719         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
6720         Completely revamp the locking macros.  No distinction between
6721         normal and mutex locking anymore.
6722         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
6723         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
6724         __lll_lock_timedwait): Fix prototypes.
6725         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
6726         __lll_lock_timedwait): Likewise.
6727         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
6728         macros, add __builtin_expect.
6729         (lll_mutex_timedlock): Likewise.  Fix return value.
6730         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
6731         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
6732         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
6733         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
6734         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
6735         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
6736         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
6737         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
6738
6739 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6740
6741         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6742         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
6743         operation if possible.
6744
6745         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
6746         like jumping over the lock prefix.
6747
6748 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
6749
6750         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
6751         locking macros.  No distinction between normal and mutex locking
6752         anymore.
6753         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6754         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6755         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
6756         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
6757         locking.  Merge bits from lowlevelmutex.S we still need.
6758         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
6759         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
6760         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
6761         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
6762         * Makefile (routines): Remove libc-lowlevelmutex.
6763         (libpthread-rountines): Remove lowlevelmutex.
6764         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
6765         for new mutex implementation.
6766         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6767         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6768         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6769         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6770         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6771         Likewise.
6772         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6773         Likewise.
6774         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6775         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6776         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
6777         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6778         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6779         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6780         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6781         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6782         Likewise.
6783         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6784         Likewise.
6785         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
6786         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6787         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6788         Don't use requeue.
6789         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6790         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
6791
6792 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
6793
6794         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
6795         in parameters of asm with output parameters.
6796
6797         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
6798         type of DECR parameter to int.
6799         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
6800
6801 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
6802
6803         * tst-attr3.c (tf, do_test): Print stack start/end/size and
6804         guardsize for each thread.
6805
6806 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6807
6808         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
6809         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6810         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
6811
6812         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
6813         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
6814         NULL.
6815         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
6816         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
6817         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6818         (pthread_getaffinity_np): Add hidden_def.
6819
6820         * Makefile (tests): Add tst-attr3.
6821         * tst-attr3.c: New test.
6822
6823         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
6824
6825 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6826
6827         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
6828         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
6829
6830 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6831
6832         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
6833         * tst-align.c: Include tst-stack-align.h.
6834         (tf, do_test): Use TEST_STACK_ALIGN macro.
6835
6836 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
6837
6838         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
6839         variable.
6840
6841 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
6842
6843         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
6844         stack-related values for the initial thread.
6845
6846 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6847
6848         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
6849
6850 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
6851
6852         * pthread_mutex_lock.c: Minor code rearrangements.
6853
6854 2003-09-05  Roland McGrath  <roland@redhat.com>
6855
6856         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
6857         Instead, include ../nptl_db/db_info.c to do its magic.
6858         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
6859         (__pthread_pthread_key_2ndlevel_size): Likewise.
6860         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
6861         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
6862         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
6863         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
6864         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
6865         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
6866         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
6867         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
6868         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
6869         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
6870         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
6871         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
6872         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
6873         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
6874         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
6875         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
6876         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
6877
6878 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
6879
6880         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
6881         of pthread_t to be compatible with LT.
6882         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6883         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6884         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6885         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6886         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
6887         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6888         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6889
6890 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
6891
6892         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
6893
6894 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
6895
6896         * unwind-forcedunwind.c: Move to...
6897         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
6898         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
6899         * sysdeps/pthread/jmpbuf-unwind.h: New file.
6900         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
6901         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
6902         * unwind.c: Include jmpbuf-unwind.h.
6903         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
6904
6905 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
6906
6907         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
6908         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
6909         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
6910         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
6911         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6912         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
6913         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
6914         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
6915         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
6916         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
6917         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
6918         function.
6919         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
6920         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
6921         * Makefile (tests): Add tst-stack2.
6922         * tst-stack2.c: New test.
6923         * tst-stack1.c: Include limits.h and sys/param.h.
6924         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
6925
6926         * pthread_condattr_setpshared.c: Include errno.h.
6927         (pthread_condattr_setpshared): Return EINVAL if pshared
6928         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
6929
6930         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
6931         defined symbol for entry point to avoid cancellation.
6932         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6933         Likewise.
6934         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
6935         Likewise.
6936         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6937         Likewise.
6938         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
6939         Likewise.
6940         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
6941         Likewise.
6942         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
6943         __close_nocancel, __read_nocancel, __write_nocancel,
6944         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
6945         libpthread.so or librt.so, define to corresponding function
6946         without _nocancel suffix.
6947         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
6948         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
6949         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
6950
6951         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
6952
6953 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
6954
6955         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
6956         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
6957
6958         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
6959         in subsections has a symbol associated with it.
6960
6961         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
6962         defined symbol for entry point to avoid cancellation.
6963         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
6964
6965 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6966
6967         * Makefile (tests): Add tst-tls5.
6968         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
6969         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
6970         ($(objpfx)tst-tls5): New.
6971         ($(objpfx)tst-tls6.out): Likewise.
6972         (tests): Depend on $(objpfx)tst-tls6.out.
6973         * tst-tls3.c: Include stdint.h and pthreaddef.h.
6974         (do_test): Check pthread_self () return value alignment.
6975         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
6976         (tf): Check pthread_self () return value alignment.
6977         * tst-tls5.c: New test.
6978         * tst-tls5.h: New.
6979         * tst-tls5mod.c: New.
6980         * tst-tls5moda.c: New.
6981         * tst-tls5modb.c: New.
6982         * tst-tls5modc.c: New.
6983         * tst-tls5modd.c: New.
6984         * tst-tls5mode.c: New.
6985         * tst-tls5modf.c: New.
6986         * tst-tls6.sh: New test.
6987
6988         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
6989         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
6990         * init.c (pthread_functions): Initialize them.
6991         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
6992         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
6993         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
6994         pthread_cond_timedwait@@GLIBC_2.3.2.
6995
6996 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6997
6998         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
6999         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
7000         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
7001         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
7002         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
7003         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
7004
7005         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
7006
7007         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
7008         _POSIX_THREAD_PRIORITY_SCHEDULING.
7009         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
7010
7011 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
7012
7013         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
7014         nested function, use static inline function from libio.h.
7015         Code by Richard Henderson.
7016
7017         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
7018         weak.
7019
7020 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
7021
7022         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
7023         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
7024         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
7025         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
7026         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
7027         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
7028         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
7029         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
7030         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
7031         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
7032         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
7033         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
7034         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
7035         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
7036         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
7037         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
7038         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
7039         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
7040         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
7041         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
7042         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
7043         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
7044         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
7045         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
7046         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
7047         * sysdeps/sparc/tls.h: New file.
7048         * sysdeps/sparc/tcb-offsets.sym: New file.
7049         * sysdeps/sparc/Makefile: New file.
7050         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
7051         * init.c [__sparc__] (__NR_set_tid_address): Define.
7052
7053 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
7054
7055         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
7056         _IO_release_lock): Define.
7057
7058 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
7059
7060         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
7061         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
7062
7063 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
7064
7065         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
7066         (__pthread_cleanup_class): Add missing return types of member
7067         functions.
7068
7069 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
7070
7071         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7072         (lll_mutex_unlock_force): Add memory barrier between store and futex
7073         syscall.
7074
7075 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
7076
7077         * tst-cancel4.c (do_test): Also unlink tempfname and remove
7078         tempmsg in first loop.
7079
7080 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
7081
7082         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7083         _POSIX_THREAD_PRIORITY_SCHEDULING.
7084         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7085
7086 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
7087
7088         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
7089         (__rtld_lock_default_lock_recursive,
7090         __rtld_lock_default_unlock_recursive): Define.
7091         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
7092         __rtld_lock_unlock_recursive): Define using
7093         GL(_dl_rtld_*lock_recursive).
7094         * init.c (__pthread_initialize_minimal_internal): Initialize
7095         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
7096         Lock GL(_dl_load_lock) the same number of times as
7097         GL(_dl_load_lock) using non-mt implementation was nested.
7098
7099         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
7100         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
7101
7102 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
7103
7104         * tst-cancel17.c (do_test): Make len2 maximum of page size and
7105         PIPE_BUF.
7106
7107 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
7108
7109         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
7110
7111 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
7112
7113         * sysdeps/pthread/createthread.c (do_clone): Move error handling
7114         to first syscall error check.  Move syscall error check for tkill
7115         into __ASSUME_CLONE_STOPPED #ifdef.
7116
7117 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
7118
7119         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
7120         is not defined, do explicit synchronization.
7121         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
7122         is not defined also unlock pd->lock for non-debugging case in case
7123         it is necessary.
7124         * pthread_create.c (start_thread): Always get and release pd->lock
7125         if __ASSUME_CLONE_STOPPED is not defined.
7126         (start_thread_debug): Removed.  Adjust users.
7127         * allocatestack.c (allocate_stack): Always initialize lock if
7128         __ASSUME_CLONE_STOPPED is not defined.
7129         * Makefile (tests): Add tst-sched1.
7130         * tst-sched1.c: New file.
7131
7132         * sysdeps/pthread/createthread.c (do_clone): Only use
7133         sched_setschduler and pass correct parameters.
7134
7135 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
7136
7137         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
7138         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
7139         PTHREAD_STACK_MIN in comments.
7140
7141 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
7142
7143         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7144         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
7145         argument.
7146         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
7147         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
7148         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
7149         (__pthread_cleanup_upto): Fix prototype.
7150         (_longjmp_unwind): Adjust caller.
7151         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
7152         Change second argument to const struct pointer.
7153         * tst-sem8.c (main): Remove unused s2 and s3 variables.
7154         * tst-sem9.c (main): Likewise.
7155         * unwind.c: Include string.h for strlen prototype.
7156
7157 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
7158
7159         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7160         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
7161         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
7162         Define HAVE_CMOV.
7163         Patch by Nicholas Miell <nmiell@attbi.com>.
7164
7165 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
7166
7167         * init.c (__pthread_initialize_minimal_internal): Initialize
7168         GL(dl_init_static_tls).
7169         * pthreadP.h (__pthread_init_static_tls): New prototype.
7170         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
7171         New functions.
7172         * Makefile (tests): Add tst-tls4.
7173         (modules-names): Add tst-tls4moda and tst-tls4modb.
7174         ($(objpfx)tst-tls4): Link against libdl and libpthread.
7175         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
7176         tst-tls4modb.so.
7177         * tst-tls4.c: New file.
7178         * tst-tls4moda.c: New file.
7179         * tst-tls4modb.c: New file.
7180
7181 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
7182
7183         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
7184         before __timer_dealloc.
7185         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
7186         Don't call list_unlink.
7187
7188 2003-07-29  Roland McGrath  <roland@redhat.com>
7189
7190         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
7191
7192 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
7193
7194         * tst-cancel17.c (do_test): Check if aio_cancel failed.
7195         Don't reuse struct aiocb A if it failed.
7196         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
7197         not just one byte, as that does not block.
7198
7199 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
7200
7201         * sysdeps/pthread/unwind-resume.c: New file.
7202         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
7203         unwind-resume in csu subdir.
7204         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
7205         exceptions.
7206         (librt-sysdep_routines, librt-shared-only-routines): Add
7207         rt-unwind-resume.
7208         * sysdeps/pthread/rt-unwind-resume.c: New file.
7209         * unwind-forcedunwind.c: New file.
7210         * Makefile (libpthread-routines): Add unwind-forcedunwind.
7211         (libpthread-shared-only-routines): Likewise.
7212         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
7213         * pthreadP.h (pthread_cancel_init): New prototype.
7214         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
7215
7216         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
7217         attr argument const struct pthread_attr *.
7218
7219         * res.c (__res_state): Return __resp.
7220         * descr.h: Include resolv.h.
7221         (struct pthread): Add res field.
7222         * pthread_create.c: Include resolv.h.
7223         (start_thread): Initialize __resp.
7224         * Makefile (tests): Add tst-_res1.
7225         (module-names): Add tst-_res1mod1, tst-_res1mod2.
7226         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
7227         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
7228         libpthread.
7229         * tst-_res1.c: New file.
7230         * tst-_res1mod1.c: New file.
7231         * tst-_res1mod2.c: New file.
7232
7233 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
7234
7235         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
7236
7237         * Makefile: Define various *-no-z-defs variables for test DSOs
7238         which has undefined symbols.
7239
7240 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
7241
7242         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
7243         Retry if the stwcx fails to store once_control.
7244
7245 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
7246
7247         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
7248         pthread_attr_setaffinity.
7249         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
7250         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
7251         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
7252         * pthread_attr_destroy.c: Free cpuset element if allocated.
7253         * pthread_create.c: Pass iattr as additional parameter to
7254         create_thread.
7255         * sysdeps/pthread/createthread.c: If attribute is provided and
7256         a new thread is created with affinity set or scheduling parameters,
7257         start thread with CLONE_STOPPED.
7258         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
7259         pthread_attr_setaffinity.
7260         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
7261         cpuset element.
7262
7263 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
7264
7265         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
7266
7267 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
7268
7269         * sysdeps/pthread/configure.in: Require CFI directives also for
7270         ppc and s390.
7271
7272 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
7273
7274         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
7275         Add cfi directives.
7276
7277 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7278
7279         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
7280         CLEANUP_JMP_BUF.
7281         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
7282         registers as variables.  Call __pthread_mutex_unlock_usercnt.
7283         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7284         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
7285         not self pointer in __writer.  Compare with TID to determine
7286         deadlocks.
7287         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7288         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
7289         Likewise.
7290         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
7291         Likewise.
7292         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
7293         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7294         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
7295         macros also when compiling librt.
7296
7297 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
7298
7299         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
7300         -fasynchronous-unwind-tables.
7301         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
7302         (PSEUDO): Add cfi directives.
7303         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
7304         Likewise.
7305         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
7306         Likewise.
7307
7308 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
7309
7310         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
7311         __pthread_unregister_cancel): Add prototypes and hidden_proto.
7312         * unwind.c (__pthread_unwind_next): Add hidden_def.
7313         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
7314         Likewise.
7315         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
7316         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
7317         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
7318         Likewise.
7319         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
7320         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
7321         Likewise.
7322         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
7323         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
7324         __pthread_unregister_cancel and __pthread_unwind_next.
7325
7326 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
7327
7328         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
7329         different symbol for the cancellation syscall wrapper and
7330         non-cancellation syscall wrapper.
7331         (PSEUDO_END): Define.
7332
7333 2003-07-05  Richard Henderson  <rth@redhat.com>
7334
7335         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
7336         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
7337         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7338         return actual return value from the syscall, not 0.
7339
7340 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
7341
7342         * descr.h (struct pthread): Add pid field.
7343         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
7344         (__reclaim_stacks): Likewise.
7345         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
7346         also check for PID of the signal source.
7347         (__pthread_initialize_minimal_internal): Also initialize pid field
7348         of initial thread's descriptor.
7349         * pthread_cancel.c: Use tgkill instead of tkill if possible.
7350         * sysdeps/unix/sysv/linux/fork.c: Likewise.
7351         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
7352         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
7353         * sysdeps/unix/sysv/linux/raise.c: Likewise.
7354
7355 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
7356
7357         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
7358         Fix use of parameter.
7359         (__libc_cleanup_pop): Likewise.
7360
7361 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
7362
7363         * init.c (sigcancel_handler): Change parameters to match handler
7364         for SA_SIGACTION.  Check signal number and code to recognize
7365         invalid invocations.
7366
7367 2003-07-03  Roland McGrath  <roland@redhat.com>
7368
7369         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
7370         Apply sizeof (struct pthread) bias to r13 value.
7371
7372 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
7373
7374         * sysdeps/pthread/configure.in: Require CFI directives.
7375
7376         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
7377         definition.
7378         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
7379         libpthread compilation.
7380         * unwind.c (__pthread_unwind): Add hidden_def.
7381         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
7382
7383 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
7384
7385         * libc-cancellation.c (__libc_cleanup_routine): Define.
7386         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
7387         (__pthread_cleanup_pop): Define.
7388
7389 2003-07-01  Richard Henderson  <rth@redhat.com>
7390
7391         * sysdeps/alpha/elf/pt-initfini.c: New file.
7392         * sysdeps/alpha/pthread_spin_lock.S: New file.
7393         * sysdeps/alpha/pthread_spin_trylock.S: New file.
7394         * sysdeps/alpha/pthreaddef.h: New file.
7395         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
7396         * sysdeps/alpha/tls.h: New file.
7397         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
7398         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
7399         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
7400         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
7401         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
7402         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
7403         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
7404         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
7405         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
7406         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
7407
7408 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
7409
7410         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
7411         cleanup support and unwind info.
7412
7413 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
7414
7415         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
7416         Use correct cleanup handler registration.  Add unwind info.
7417         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
7418         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
7419         * tst-once3.c: Add cleanup handler and check it is called.
7420         * tst-once4.c: Likewise.
7421         * tst-oncex3.c: New file.
7422         * tst-oncex4.c: New file.
7423         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
7424
7425 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
7426
7427         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
7428
7429 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
7430
7431         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
7432         (tf_msgsnd): Likewise.
7433
7434         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
7435         premature returns a bit more.
7436
7437 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
7438
7439         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
7440         definition to the front.
7441
7442         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
7443         the cleanup functions to make the names unique.  Fix dwarf opcode
7444         un unwind table.
7445         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
7446         functions to make the names unique.  Fix CFA offset for two blocks.
7447
7448 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
7449
7450         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
7451         missing closing braces.
7452         Patch by Christophe Saout <christophe@saout.de>.
7453
7454 2003-06-24  Roland McGrath  <roland@redhat.com>
7455
7456         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
7457
7458 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
7459
7460         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
7461         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
7462
7463         * pthreadP.h: Declare __find_thread_by_id.
7464         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
7465         * pthread_clock_gettime.c: Allow using other thread's clock.
7466         * pthread_clock_settime.c: Likewise.
7467         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
7468         * Makefile: Add rules to build and run tst-clock2.
7469         * tst-clock2.c: New file.
7470
7471 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
7472
7473         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
7474         to use exception-based cleanup handler.
7475         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7476
7477         * tst-cond8.c (ch): Announce that we are done.
7478
7479         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
7480
7481         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
7482         Also test aio_suspend with timeout value.
7483
7484 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
7485
7486         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
7487         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
7488         attribute_hidden.
7489
7490         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
7491         (__pthread_mutex_lock_internal): Likewise.
7492         (__pthread_mutex_unlock_internal): Likewise.
7493         (__pthread_mutex_unlock_usercnt): Declare.
7494         * pthread_mutex_destroy.c: Always fail if used in any way.
7495         * pthread_mutex_init.c: Update comment.
7496         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
7497         * pthread_mutex_timedlock.c: Adjust __nusers.
7498         * pthread_mutex_trylock.c: Adjust __nusers.
7499         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
7500         and public interfaces are wrapper with pass additional parameter.
7501         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
7502         parameter zero.
7503         * tst-mutex8.c: New file.
7504         * Makefile (tests): Add tst-mutex8.
7505         * sysdeps/pthread/pthread_cond_timedwait.c: Call
7506         __pthread_mutex_unlock_usercnt.
7507         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7508         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7509         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7510         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7511         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7512         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
7513         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7514         Add __nusers.
7515         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7516         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7517         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7518         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7519         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7520
7521         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
7522         * pthread_mutex_timedlock.c: Likewise.
7523         * pthread_mutex_trylock.c: Adjust __nusers.
7524         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
7525         * tst-mutex9.c: New file.
7526         * Makefile (tests): Add tst-mutex9.
7527         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
7528         * sysdeps/ia64/tls.h: Likewise.
7529         * sysdeps/powerpc/tls.h: Likewise.
7530         * sysdeps/s390/tls.h: Likewise.
7531         * sysdeps/sh/tls.h: Likewise.
7532         * sysdeps/x86_64/tls.h: Likewise.
7533         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7534         Change type of __owner.
7535         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7536         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7537         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7538         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7539         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7540
7541 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
7542
7543         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
7544         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
7545
7546         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
7547         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
7548         instead of nr to lll_futex_wake.  Only set errno and return -1
7549         if err < 0.
7550
7551         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
7552         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7553         return actual return value from the syscall, not 0.
7554
7555 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
7556
7557         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
7558         find a random value.
7559         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
7560         errno==EIDRM.
7561
7562         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
7563         compat_timer_settime.
7564         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
7565         compat_timer_gettime.
7566         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
7567         compat_timer_getoverrun.
7568         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
7569         compat_timer_delete.
7570
7571         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
7572         error-checking mutex detect busy mutexes.
7573
7574 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7575
7576         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
7577         Add ax to clobber list.
7578         (lll_mutex_cond_lock): Likewise.
7579         (lll_mutex_unlock): Likewise.
7580         (lll_lock): Likewise.
7581         (lll_unlock): Likewise.
7582
7583         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
7584         * tst-cancel18.c: New file.
7585         * tst-cancelx18.c: New file.
7586
7587         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
7588         and tcdrain.
7589
7590         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
7591         * tst-cancel17.c: New file.
7592         * tst-cancelx17.c: New file.
7593
7594         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7595         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7596         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7597
7598         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
7599
7600 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
7601
7602         * sysdeps/pthread/createthread.c (create_thread): Set
7603         header.multiple_threads unconditionally.
7604         * allocatestack.c (allocate_stack): Likewise.
7605         * descr.h (struct pthread): Add header.multiple_threads
7606         unconditionally.
7607         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
7608         Define for librt.  #error if neither libpthread, libc nor librt.
7609         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
7610         Likewise.
7611         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
7612         CDISABLE): Likewise.
7613         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
7614         CDISABLE): Likewise.
7615         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
7616         CDISABLE): Likewise.
7617         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
7618         CDISABLE): Likewise.  Access header.multiple_threads outside of
7619         libc and libpthread.
7620         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
7621         Likewise.
7622         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
7623         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
7624
7625 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7626
7627         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
7628         Also test early cancellation before the thread reaches the cancellation
7629         point.
7630
7631         * Makefile: Compile forward.c with exceptions.
7632
7633         * sysdeps/unix/sysv/linux/sleep.c: New file.
7634
7635 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
7636
7637         * Makefile: Add CFLAGS definition to compile function wrappers
7638         duplicated from libc with exceptions.
7639         * tst-cancel4.c: Also check cancellation handlers.
7640
7641         * Makefile: Add rules to build and run tst-cancel16 and
7642         tst-cancelx16.  Add missing CFLAGS definitions.
7643         * tst-cancel16.c: New file.
7644         * tst-cancelx16.c: New file.
7645
7646 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
7647
7648         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7649         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
7650         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
7651         (DL_SYSINFO_IMPLEMENTATION): Likewise.
7652
7653         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
7654         (LIBC_CANCEL_RESET): Likewise.
7655         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
7656         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
7657         librt-cancellation.
7658         (CFLAGS-libcrt-cancellation.c): Define.
7659         * sysdeps/pthread/librt-cancellation.c: New file.
7660         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
7661         macros also when compiling librt.
7662         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
7663         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
7664         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
7665         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
7666         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
7667         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
7668         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7669
7670         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
7671         compat_timer_create.
7672
7673 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
7674
7675         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
7676
7677         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7678         __register_atfork.
7679         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
7680         Add libc_hidden_def.
7681
7682 2003-06-13  Roland McGrath  <roland@redhat.com>
7683
7684         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
7685         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
7686
7687 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
7688
7689         * allocatestack.c (queue_stack): Always inline.
7690         * ptreadhP.h (__do_cancel): Likewise.
7691
7692 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
7693
7694         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
7695         a typo.
7696
7697 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
7698
7699         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7700         (__pthread_cond_signal): Remove incorrect second addition for
7701         cond_lock!=0.
7702
7703 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
7704
7705         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7706         (__pthread_cond_signal): Use correct futex pointer in
7707         __lll_mutex_lock_wait call.
7708
7709         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7710         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
7711
7712 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
7713
7714         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
7715         cancelable.
7716         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7717         Likewise.
7718
7719         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
7720         hand-written CFI generation code.  Since ENTRY/END also initiated
7721         CFI frames this caused two CFI sets to be generated.
7722
7723 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
7724
7725         * cleanup_routine.c: New file.
7726         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
7727         * sysdeps/pthread/pthread.h: Add support for fully exception-based
7728         cleanup handling.
7729         * Makefile (libpthread-routines): Add cleanup_routine.
7730         Add more CFLAGS variables to compile with exceptions.  Add comments
7731         why which file needs unwind tables.
7732         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
7733         tests.
7734         * tst-cancelx1.c: New file.
7735         * tst-cancelx2.c: New file.
7736         * tst-cancelx3.c: New file.
7737         * tst-cancelx4.c: New file.
7738         * tst-cancelx5.c: New file.
7739         * tst-cancelx6.c: New file.
7740         * tst-cancelx7.c: New file.
7741         * tst-cancelx8.c: New file.
7742         * tst-cancelx9.c: New file.
7743         * tst-cancelx10.c: New file.
7744         * tst-cancelx11.c: New file.
7745         * tst-cancelx12.c: New file.
7746         * tst-cancelx13.c: New file.
7747         * tst-cancelx14.c: New file.
7748         * tst-cancelx15.c: New file.
7749         * tst-cleanupx0.c: New file.
7750         * tst-cleanupx0.expect: New file.
7751         * tst-cleanupx1.c: New file.
7752         * tst-cleanupx2.c: New file.
7753         * tst-cleanupx3.c: New file.
7754
7755         * tst-cleanup0.c: Make standard compliant.
7756         * tst-cleanup1.c: Likewise.
7757
7758         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
7759         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7760         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7761         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7762         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7763         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7764         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
7765         CLEANUP_JMP_BUF.
7766         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7767         * tst-cancel12.c: New file.
7768         * tst-cancel13.c: New file.
7769         * tst-cancel14.c: New file.
7770         * tst-cancel15.c: New file.
7771         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
7772         and tst-cancel15.
7773
7774         * tst-cancel1.c: Add some comments.
7775
7776         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
7777         timeout correctly.
7778
7779 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
7780
7781         * Makefile (CFLAGS-pthread_cancel.c): Define.
7782
7783 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
7784
7785         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
7786         Change type of __writer element to int.
7787         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7788         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7789         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7790         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7791         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7792         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
7793         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7794         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
7795         Compare with TID to determine deadlocks.
7796         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
7797         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7798         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
7799         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7800         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7801         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7802         Likewise.
7803         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7804         Likewise.
7805         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7806         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7807         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
7808         Likewise.
7809         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
7810         Likewise.
7811         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7812         * Makefile (tests): Add tst-rwlock12.
7813         * tst-rwlock12.c: New file.
7814
7815 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
7816
7817         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
7818         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
7819         Remove bogus hidden_proto.
7820         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
7821         Likewise.
7822         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
7823         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
7824         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
7825         ___lll_mutex_timedlock): Likewise.
7826
7827 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
7828
7829         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7830         (__pthread_cond_signal): Add some code to eventually handle
7831         cond_lock!=0.
7832
7833 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
7834
7835         * Makefile (tests): Add tst-exec4.
7836         (tst-exec4-ARGS): Define.
7837         * tst-exec4.c: New file.
7838
7839 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
7840
7841         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7842         Also fail if tv_nsec < 0.
7843         (__lll_timedwait_tid): Likewise.
7844         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
7845         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
7846         Likewise.
7847         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
7848         Likewise.
7849         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
7850         Likewise.
7851         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7852         Likewise.
7853         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
7854         Likewise.
7855         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
7856         Likewise.
7857
7858         * Makefile (tests): Add tst-sem8 and tst-sem9.
7859         * tst-sem8.c: New file.
7860         * tst-sem9.c: New file.
7861         * sem_open.c: Fix creation of in_use record if the file exists but
7862         no internal record.
7863
7864         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
7865         definitions.
7866
7867         * sysdeps/pthread/timer_create.c (timer_create): In case
7868         evp==NULL, assign timer ID to sival_ptr.
7869
7870         * descr.h (struct pthread_unwind_buf): Change type of prev element to
7871         struct pthread_unwind_buf *.
7872         (struct pthread): Likewise for cleanup_jmp_buf element.
7873
7874         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
7875         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
7876         * unwind.c (__pthread_unwind_next): Likewise.
7877
7878 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
7879
7880         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7881         (lll_futex_timed_wait): Use int for futex value parameter.
7882         (lll_futex_wake): Likewise.
7883         (lll_futex_requeue): Likewise.
7884
7885         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7886         Replace one memory operation with one register operation.
7887
7888         * tst-join4.c (do_test): Fix error message.
7889
7890         * tst-rwlock6.c (do_test): Use correct format specifier.
7891
7892         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7893         (__lll_mutex_lock_wait): Replace one memory operation with one
7894         register operation.
7895         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
7896         (__lll_mutex_lock_wait): Likewise.
7897
7898         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7899         (__lll_mutex_cond_lock): Add one to value parameter of
7900         __lll_lock_wait to reflect reality in the futex syscall.
7901         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7902         (lll_mutex_cond_lock): Likewise.
7903
7904 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7905
7906         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
7907         New function.
7908         (lll_mutex_cond_lock): Define.
7909
7910 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
7911
7912         * Makefile (tests): Add tst-signal6.
7913         * tst-signal6.c: New file.
7914
7915         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
7916         (__lll_mutex_unlock_force): New function
7917         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7918
7919         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7920         (__lll_mutex_unlock_force): New function.
7921         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7922
7923         * tst-rwlock7.c (do_test): Use correct format specifier.
7924
7925         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
7926         Find break parameter in correct asm argument.
7927
7928 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
7929
7930         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
7931         Remove out4.
7932         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
7933         error occured.
7934         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7935         Add __mutex.
7936         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
7937         lll_futex_requeue, lll_mutex_unlock_force): Define.
7938
7939 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7940
7941         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7942         (pthread_cond_t): Add __mutex.
7943         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
7944         lll_futex_requeue, lll_mutex_unlock_force): Define.
7945
7946 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7947
7948         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
7949         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
7950         Add __mutex field.
7951         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
7952         Define.
7953         (lll_futex_wait, lll_futex_wake): Define.
7954         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
7955         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
7956         FUTEX_REQUEUE instead of FUTEX_WAIT.
7957         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7958         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
7959         mutex which was used in condvar structure.  Call
7960         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
7961         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7962
7963         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
7964         include tcb-offsets.h.  Read wakeup value in locked region.
7965         Use the value of gbr register as THREAD_ID.
7966         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7967         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7968         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7969
7970         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
7971         macros.
7972
7973 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
7974
7975         * sysdeps/pthread/pthread_cond_broadcast.c
7976         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
7977
7978 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
7979
7980         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
7981         typo in register name.
7982         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
7983         correctly.  Actually use requeue.  Little optimization.
7984         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
7985         mutex address early.  Handle cancellation state as 32-bit value.
7986         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7987         Remove unnecessary label.
7988
7989 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
7990
7991         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
7992         instead of FUTEX_WAIT.
7993         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
7994         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7995         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7996         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7997         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7998         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
7999         used in condvar structure.  Call __pthread_mutex_cond_lock instead
8000         of __pthread_mutex_lock_internal.
8001         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8002         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8003         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
8004         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
8005         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8006         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8007         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
8008         Add pthread_mutex_cond_lock.
8009         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
8010         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
8011         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
8012         lll_mutex_cond_lock.
8013         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
8014         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8015         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8016         Add __mutex field.
8017         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8018         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
8019
8020         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
8021         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
8022
8023         * pthreadP.h: Declare __pthread_mutex_cond_lock.
8024         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
8025         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
8026         macro don't define aliases.
8027
8028         * cancellation.c: Remove __pthread_enable_asynccancel_2.
8029         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
8030         * sysdeps/pthread/pthread_cond_timedwait.c: Use
8031         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
8032         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8033         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8034         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
8035         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8036         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8037
8038 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
8039
8040         * sem_open.c: Fix one endless loop.  Implement correct semantics
8041         wrt opening the same semaphore more then once.
8042         * sem_close.c: Adjust for sem_open change.
8043         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
8044         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
8045         * Makefile (tests): Add tst-sem7.
8046         * tst-sem7.c: New file.
8047
8048 2003-05-16  Roland McGrath  <roland@redhat.com>
8049
8050         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
8051         uninitialized variable braino.
8052
8053 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
8054
8055         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
8056         test for syscall availability.
8057
8058         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
8059         __no_posix_timers to -1 if the syscalls don't exist.
8060
8061         * pthread_join.c (pthread_join): Set tid field of the joined
8062         thread to -1.  This isn't necessary but helps to recognize some
8063         error conditions with almost no cost.
8064
8065         * allocatestack.c (FREE_P): Also negative values indicate an
8066         unused stack.
8067
8068         * unwind.c: Include <unistd.h>.
8069
8070 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
8071
8072         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
8073
8074 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
8075
8076         * Makefile (crti-objs, crtn-objs): New variables.
8077         (omit-deps, extra-objs): Add crtn.
8078         ($(objpfx)libpthread.so): Depend on both crti and crtn
8079         and links to them in multidir.
8080         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
8081
8082 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
8083
8084         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
8085         (lll_mutex_unlock): Use atomic_exchange_rel.
8086
8087 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
8088
8089         * cond-perf.c (cons): Add missing locking around setting of alldone.
8090
8091 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
8092
8093         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
8094         related macros.
8095         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8096
8097 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
8098
8099         * tst-sem6.c: New file.
8100         * Makefile (tests): Add tst-sem6.
8101
8102         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
8103         Use atomic_exchange_rel instead of atomic_exchange.
8104         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
8105         Likewise.
8106
8107         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
8108         code for lll_futex_wait and lll_futex_wake in static apps.  Use
8109         vsyscall is possible.
8110
8111         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
8112         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
8113         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
8114         pthread_setaffinity_np.
8115         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
8116         and pthread_setaffinity_np.
8117         * Makefile (libpthread-routines): Add pthread_getaffinity and
8118         pthread_setaffinity.
8119
8120         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
8121         use it in case mmap to allocate the stack fails.
8122         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
8123         ARCH_MAP_FLAGS here.
8124         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
8125         ARCH_RETRY_MMAP.
8126
8127 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
8128
8129         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
8130         handler implementation.  It is now lockless in fork().
8131         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
8132         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
8133         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
8134         declare the __fork_*_lists.
8135         (struct fork_handler): Include pointers to all three functions.
8136         Add next, refcntr and need_signal elements.
8137         (__fork_handlers): New declaration.
8138         (__register_atfork_malloc): Remove declaration.
8139         (HAVE_register_atfork_malloc): Remove definition.
8140         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
8141         __pthread_child_handler variable.
8142         (__libc_pthread_init): Use __register_atfork instead of explicitly
8143         adding to the list.
8144         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
8145         and lll_futex_wake.
8146         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8147
8148         * unwind.c (unwind_cleanup): Print error message and then abort.  This
8149         function must never be reached.
8150
8151         * cond-perf.c: New file.
8152
8153 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
8154
8155         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
8156
8157 2003-05-04  Roland McGrath  <roland@redhat.com>
8158
8159         * Makefile ($(objpfx)../libc.so): New target.
8160
8161 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
8162
8163         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
8164         (pthread_condattr_t): Size is only an int, don't use long for
8165         alignment.
8166         (pthread_mutexattr_t): Likewise.
8167         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8168         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
8169         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8170
8171 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
8172
8173         * sysdeps/i386/tls.h: Define THREAD_ID.
8174         * sysdeps/ia64/tls.h: Likewise.
8175         * sysdeps/powerpc/tls.h: Likewise.
8176         * sysdeps/s390/tls.h: Likewise.
8177         * sysdeps/sh/tls.h: Likewise.
8178         * sysdeps/x86_64/tls.h: Likewise.
8179         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
8180         record ownership.
8181         * pthread_mutex_timedlock.c: Likewise.
8182         * pthread_mutex_trylock.c: Likewise.
8183         * pthread_mutex_unlock.c: Likewise.
8184         * pthread_rwlock_trywrlock.c: Likewise.
8185         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
8186         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8187         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8188         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8189
8190         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
8191         flag.
8192
8193 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
8194
8195         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8196         (__SIZEOF_PTHREAD_COND_T): Define to 48.
8197         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
8198         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
8199         Make __align long long instead of long.
8200         (pthread_rwlock_t): Formatting.
8201         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
8202         (pthread_rwlock_t): Formatting.
8203         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
8204         (pthread_cond_t): Make __align long long instead of long.
8205         (pthread_rwlock_t): Move __flags field to the same position as in
8206         linuxthreads.
8207
8208 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
8209
8210         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
8211         * tst-rwlock7.c (do_test): Likewise.
8212
8213 2003-04-26  Roland McGrath  <roland@redhat.com>
8214
8215         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
8216
8217 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
8218
8219         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
8220         sizeof (struct pthread).
8221         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
8222         1 struct pthread.
8223         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
8224         to 0.
8225         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
8226         struct pthread.
8227         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
8228         to 32-bit bytes.
8229         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
8230         tcbp.
8231         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
8232         unneccessarily.
8233         (NO_TLS_OFFSET): Define.
8234         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
8235         add TLS_TCB_SIZE unnecessarily.
8236
8237 2003-04-22  Roland McGrath  <roland@redhat.com>
8238
8239         * Makeconfig (shared-thread-library): Reverse link order to work
8240         around linker bug.
8241
8242 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
8243
8244         * semaphore.h: Fix typo in comment.
8245
8246 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
8247
8248         * sysdeps/pthread/sigfillset.c: New file.
8249
8250         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
8251         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
8252         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
8253         * sysdeps/pthread/sigaction.c: Likewise.
8254         * sysdeps/pthread/sigprocmask.c: New file.
8255         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
8256         __SIGRTMIN+1.
8257         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
8258         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
8259         in this case.
8260
8261 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
8262
8263         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
8264         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
8265
8266         * sysdeps/unix/sysv/linux/unregister-atfork.c
8267         (__unregister_atfork): Don't free memory not allocated dynamically.
8268
8269         * semaphore.h: Remove __THROW marker from cancellation points.
8270         * nptl/sysdeps/pthread/pthread.h: Likewise.
8271
8272 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
8273
8274         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
8275         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
8276         __THROW.
8277
8278 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
8279
8280         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
8281
8282 2003-04-15  Roland McGrath  <roland@redhat.com>
8283
8284         * forward.c (__pthread_unwind): Tweak to avoid warning.
8285
8286 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
8287
8288         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
8289
8290 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
8291
8292         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
8293         overflow CFA advance instructions.
8294         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8295
8296 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
8297
8298         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
8299         * sysdeps/i386/pthread_spin_lock.c: Likewise.
8300         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
8301         defined.
8302
8303         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
8304         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
8305         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
8306         DW_CFA_advance_loc for .Laddl-.Lsubl.
8307
8308 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
8309
8310         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
8311         position-independent unwind data for static libraries.
8312         Add missing unwind info.  Add comments.
8313
8314         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
8315         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8316         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8317         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8318
8319 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
8320
8321         * Makefile: Make sure all cancellation points are compiled with
8322         exception and asynchronous unwind tables.
8323
8324         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
8325         which mishandles loading of global object addresses in PIC.
8326         (THREAD_SETMEM_NC): Likewise.
8327
8328 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
8329
8330         * pthread.h: Define new data structure for cleanup buffer.  Declare
8331         new cleanup handler interfaces.
8332         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
8333         (struct pthread): Add cleanup_jmp_buf pointer.  Define
8334         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
8335         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
8336         it.  Declare old cleanup handler installation functions.
8337         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
8338         handling.
8339         * cleanup_defer.c: Likewise.
8340         * cleanup_compat.c: New file.  Old cleanup code.
8341         * cleanup_def_compat.c: New file.  Old cleanup code.
8342         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
8343         if own thread descriptor.
8344         * unwind.c: New file.
8345         * forward.c: Add __pthread_unwind.
8346         * init.c (pthread_functions): Add __pthread_unwind.
8347         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
8348         Add ptr___pthread_unwind.
8349         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
8350         and unwind function.
8351         * Makefile (libpthread-routines): Add cleanup_compat,
8352         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
8353         table generation if necessary.
8354         * version.c: Record whether unwind support is compiled in.
8355         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
8356         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
8357         handler interfaces.
8358         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
8359         complication to generate unwind information for syscall wrappers.
8360         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
8361         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
8362         __cleanup_fct_attribute.
8363
8364         * Makefile: Add rules to build and run tst-cleanup0.
8365         * tst-cleanup0.c: New file.
8366         * tst-cleanup0.expect: New file.
8367
8368         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
8369         caller.  Optimize to avoid often unecessary local variable.
8370
8371 2003-04-11  Roland McGrath  <roland@redhat.com>
8372
8373         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
8374         sets variable `multidir'; include that.
8375         (generated): Add it.
8376         ($(objpfx)$(multidir)/crti.o): New target.
8377         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
8378
8379 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
8380
8381         * tst-attr2.c (do_test): Add cast to avoid warning.
8382         * tst-mutex4.c (do_test): Likewise.
8383
8384 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
8385
8386         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
8387         in child.
8388
8389 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
8390
8391         * Makefile (tests): Add tst-detach1.
8392         * tst-detach1.c: New file.
8393
8394 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
8395
8396         * sysdeps/pthread/pthread.h: Remove duplicate
8397         pthread_cleanup_{push,pop} definitions.
8398
8399         * tst-barrier2.c: Eliminate warnings.
8400         * tst-cancel4.c: Likewise.
8401         * tst-cond4.c: Likewise.
8402         * tst-cond6.c: Likewise.
8403         * tst-detach1.c: Likewise.
8404         * tst-rwlock4.c: Likewise.
8405         * tst-rwlock6.c: Likewise.
8406         * tst-rwlock7.c: Likewise.
8407         * tst-sem3.c: Likewise.
8408         * tst-spin2.c: Likewise.
8409         * tst-umask1.c: Likewise.
8410
8411 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
8412
8413         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
8414
8415 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
8416
8417         * descr.h (struct pthread): Move cancelhandling member to the front.
8418
8419 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
8420
8421         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
8422         malloc_parent, and malloc_child statically.
8423         (__register_atfork_malloc): New function.
8424         (free_mem): Don't free any of the malloc_* variables on the list.
8425         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
8426         Define HAVE_register_atfork_malloc.
8427
8428 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
8429
8430         * sysdeps/pthread/createthread.c (create_thread): Add some more
8431         comments explaining when to set multiple_threads and when not.
8432
8433         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
8434         THREAD_ATOMIC_BIT_SET if not already defined.
8435         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
8436         THREAD_ATOMIC_BIT_SET:
8437         * sysdeps/x86_64/tls.h: Likewise.
8438         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
8439         THREAD_ATOMIC_CMPXCHG_VAL.
8440         (_pthread_cleanup_pop_restore): Likewise.
8441         * cancellation.c (__pthread_enable_asynccancel): Likewise.
8442         (__pthread_enable_asynccancel_2): Likewise.
8443         (__pthread_disable_asynccancel): Likewise.
8444         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8445         (__libc_disable_asynccancel): Likewise.
8446         * init.c (sigcancel_handler): Likewise.
8447         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
8448         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
8449
8450 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
8451
8452         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
8453         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8454         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
8455         * Makefile (tests): Add tst-cancel11.
8456         * tst-cancel11.c: New file.
8457
8458 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
8459
8460         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
8461         round, not the first.  Use specific_used flag instead of local
8462         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
8463         (__free_tcb): Don't call deallocate_tsd here.
8464         (start_thread): Call deallocate_tsd here.
8465         * pthread_setspecific.c: Set specific_used flag really only when
8466         needed.
8467         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
8468         * tst-tsd3.c: New file.
8469         * tst-tsd4.c: New file.
8470
8471 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8472
8473         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
8474         Use atomic_exchange_and_add instead of __lll_add.
8475         (__lll_mutex_timedlock): Likewise.
8476         Patch by Ian Wienand.
8477
8478 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
8479
8480         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8481         (SINGLE_THREAD_P): Fix typo.
8482         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
8483
8484 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8485
8486         * Makefile (tests): Add tst-align.
8487         * tst-align.c: New file.
8488         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
8489
8490         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
8491         function correctly.
8492
8493         * tst-tsd2.c: Add casts to avoid warnings.
8494
8495 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
8496
8497         * descr.h (struct pthread): Move most often used elements to the front.
8498
8499 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
8500
8501         * Makefile (libpthread-routines): Add pthread_atfork.
8502         (libpthread-static-only-routines): Add pthread_atfork.
8503
8504 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
8505
8506         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
8507         of TLS_DTV_AT_TP.
8508         (INSTALL_DTV): Add parens.
8509         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
8510         Use passed descr instead of THREAD_SELF.
8511         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
8512         (__lll_mutex_timedlock_wait): Correct expected value after
8513         spurious wakeup.
8514         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
8515         Release lock before waking up the waiters.
8516         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
8517         criteria.  Reorderstruct passed to cleanup handler.  Fix
8518         handling of cancellation and failung pthread_mutex_unlock call.
8519         Use __pthread_enable_asynccancel_2 instead of
8520         __pthread_enable_asynccancel.
8521         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8522         Return result of lock re-get if it fails.
8523         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
8524         for __pthread_cleanup_push.
8525         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
8526         completely broken rwlock implementation.
8527         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8528         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8529         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8530         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
8531         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8532         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
8533         versioned_symbol macro.
8534         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
8535         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8536
8537 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
8538
8539         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
8540         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
8541         and __helper_tid.
8542         (struct timer): Remove th and bar field.
8543         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
8544         debugging code.  Create only one helper thread.
8545         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
8546         helper thread.
8547         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
8548         Renamed.  Define statically.  Use thread info from siginfo.
8549         (__helper_once): New variable.
8550         (__helper_tid): New variable.
8551         (__reset_helper_control): New function.
8552         (__start_helper_thread): New function.
8553
8554         * pthread_create.c (start_thread): Don't use setjmp inside
8555         __builtin_expect to work around gcc bug.
8556
8557         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
8558         timer_delete syscall fails, but not with ENOSYS, set
8559         __no_posix_timers.
8560
8561         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
8562         (timer_settime): Fix typo.
8563         * sysdeps/unix/sysv/linux/timer_getoverr.c
8564         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
8565
8566 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
8567
8568         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
8569         offset of cleanupbuf.__prev.
8570
8571 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
8572
8573         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
8574         of included file.
8575
8576 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
8577
8578         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
8579         NULL provide default definition to syscall.
8580
8581 2003-03-25  Roland McGrath  <roland@redhat.com>
8582
8583         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
8584         (timer_id2ptr): Fix typo.
8585
8586 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
8587
8588         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
8589         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
8590         * sysdeps/ia64/pthreaddef.h: Likewise.
8591         * sysdeps/powerpc/pthreaddef.h: Likewise.
8592         * sysdeps/s390/pthreaddef.h: Likewise.
8593         * sysdeps/sh/pthreaddef.h: Likewise.
8594         * sysdeps/x86_64/pthreaddef.h: Likewise.
8595         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
8596         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
8597         being changed.
8598         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
8599         SIGTIMER is not unblocked.
8600         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
8601         RT signal taken.
8602         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
8603         be send.
8604         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
8605         pass pointer through as ID.
8606         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
8607         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
8608         * sysdeps/unix/sysv/linux/timer_create.c: New file.
8609         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
8610         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
8611         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
8612         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
8613         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
8614         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
8615         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
8616         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
8617         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
8618         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
8619         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
8620         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
8621         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
8622         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
8623         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
8624         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
8625         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
8626         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
8627         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
8628         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
8629         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
8630         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
8631         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
8632         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
8633         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
8634         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
8635         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
8636         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
8637         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
8638         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
8639
8640         * pthreadP.h: Remove FRAME_LEFT definition.
8641         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
8642         already left frame.  Programs which have this problem are not POSIX
8643         compliant.
8644         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
8645
8646 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
8647
8648         * sysdeps/pthread/tst-timer.c: Check return values of the
8649         functions we test.
8650
8651 2003-03-23  Roland McGrath  <roland@redhat.com>
8652
8653         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
8654         * tst-tls3mod.c: Likewise.
8655         * tst-tls1.c: Likewise.
8656         * tst-tls2.c: Likewise.
8657
8658         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
8659         undefined behavior.
8660
8661         * tst-join5.c (tf1, tf2): Add a cast.
8662
8663         * Makeconfig (includes): Append -I$(..)nptl to this variable.
8664
8665         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
8666         Don't test anything.
8667         * tst-cond4.c: Likewise.
8668         * tst-cond6.c: Likewise.
8669         * tst-flock2.c: Likewise.
8670         * tst-mutex4.c: Likewise.
8671         * tst-rwlock4.c: Likewise.
8672         * tst-signal1.c: Likewise.
8673         * tst-spin2.c: Likewise.
8674         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
8675
8676         * tst-mutex4.c: Use test-skeleton.c.
8677         * tst-spin2.c: Likewise.
8678         * tst-sysconf.c: Likewise.
8679         * tst-barrier2.c: Likewise.
8680         * tst-cond4.c: Likewise.
8681         * tst-cond6.c: Likewise.
8682         * tst-rwlock4.c: Likewise.
8683         * tst-unload.c: Likewise.
8684         * tst-flock2.c (do_test): Use return instead of exit.
8685
8686 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
8687
8688         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
8689
8690 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
8691
8692         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8693         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
8694         instead of __lll_compare_and_swap.
8695         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
8696         Likewise.
8697         Removed definition if __lll_compare_and_swap.
8698
8699         * cancellation.c: Adjust for new form of compare&exchange macros.
8700         * cleanup_defer.c: Likewise.
8701         * init.c: Likewise.
8702         * libc-cancellation.c: Likewise.
8703         * old_pthread_cond_broadcast.c: Likewise.
8704         * old_pthread_cond_signal.c: Likewise.
8705         * old_pthread_cond_timedwait.c: Likewise.
8706         * old_pthread_cond_wait.c: Likewise.
8707         * pthread_cancel.c: Likewise.
8708         * pthread_create.c: Likewise.
8709         * pthread_detach.c: Likewise.
8710         * pthread_join.c: Likewise.
8711         * pthread_key_delete.c: Likewise.
8712         * pthread_setcancelstate.c: Likewise.
8713         * pthread_setcanceltype.c: Likewise.
8714         * pthread_timedjoin.c: Likewise.
8715         * pthread_tryjoin.c: Likewise.
8716         * sysdeps/pthread/createthread.c: Likewise.
8717
8718 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
8719
8720         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
8721         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
8722         definitions.  Replace uses with calls to atomic_* functions.
8723         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
8724         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
8725         __lll_test_and_set calls with atomic_exchange_and_add and
8726         atomic_exchange calls respectively.
8727         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
8728         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
8729         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
8730         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
8731         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
8732         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
8733         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
8734
8735         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
8736         returns the old value.
8737
8738 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
8739
8740         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
8741         int for variable OLDVAL and correct inline assembler contraint.
8742         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
8743         type int for variable OLD.
8744
8745         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
8746         only for s390-32.
8747         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8748         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
8749         instead of multiple_threads field in the TCB.
8750
8751 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
8752
8753         * sysdeps/i386/i686/bits/atomic.h: Removed.
8754         * sysdeps/i386/i586/bits/atomic.h: Removed.
8755         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
8756         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
8757         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
8758         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
8759         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
8760         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
8761         * atomic.h: Removed.  Moved to glibc.
8762
8763         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
8764         support for clock selection.
8765
8766         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
8767         signalling waiters.
8768
8769 2003-03-18  Roland McGrath  <roland@redhat.com>
8770
8771         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8772         Add __lll_rel_instr first.  Add memory clobber.
8773         (lll_mutex_unlock): Use __lll_test_and_set.
8774         From Paul Mackerras <paulus@samba.org>.
8775
8776         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
8777         unconditionally.
8778         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8779         (SINGLE_THREAD_P):  Add `header.' prefix.
8780         From Paul Mackerras <paulus@samba.org>.
8781
8782         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
8783         pthread_timedjoin_np to ...
8784         (libpthread: GLIBC_2.3.3): ... here.
8785         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
8786
8787         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8788         Avoid shadowing VAL variable.
8789
8790         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8791         New macro.
8792
8793 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
8794
8795         * Makefile (tests): Add tst-cond11.
8796         * tst-cond11.c: New file.
8797
8798         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
8799         struct passed to cleanup handler to eliminate one more
8800         instruction.
8801         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8802
8803         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8804         (pthrad_cond_t): Replace __unused field with __clock.
8805
8806         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
8807         waken all waiters in cleanup handler.
8808         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8809         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8810
8811         * pthread_condattr_getclock.c: New file.
8812         * pthread_condattr_setclock.c: New file.
8813         * sysdeps/pthread/pthread.h: Declare these new functions.
8814         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
8815         * Makefile (libpthread-routines): Add the new functions.
8816         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
8817         Renamed field to value.  Document use of the bits.
8818         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
8819         change.
8820         * pthread_condattr_setpshared.c: Likewise.
8821         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
8822         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
8823         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8824         Add __clock field.
8825         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8826         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8827         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8828         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8829         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
8830         Implement clock selection.
8831         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8832         * pthread-errnos.sym: Add ENOSYS.
8833         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8834         _POSIX_CLOCK_SELECTION.
8835         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8836
8837         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
8838         invalid .size directive.
8839
8840 2003-03-17  Roland McGrath  <roland@redhat.com>
8841
8842         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
8843         Formatting tweaks.
8844
8845 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8846
8847         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
8848         Use __lll_add instead of spelling it out.  Use protected symbol names.
8849         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
8850         Use __lll_add.
8851         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
8852         Renamed from lll_compare_and_swap.  Use new name where necessary.
8853         (__lll_add): Defined.
8854         (__lll_dec_if_positive): Defined.
8855         (__lll_test_and_set): Defined.
8856         * sysdeps/ia64/pthread_spin_init.c: Removed.
8857         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
8858         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
8859         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
8860         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
8861         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
8862         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
8863         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
8864         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
8865         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
8866         __sync_lock_release_si.
8867         Patch by Jakub Jelinek.
8868
8869         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
8870         Fix timeout handling.
8871         (__lll_timedwait_tid): Likewise.
8872         (lll_unlock_wake_cb): Wake up other waiters if necessary.
8873         Patch by Jakub Jelinek.
8874
8875         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
8876
8877 2003-03-17  Roland McGrath  <roland@redhat.com>
8878
8879         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
8880         * sysdeps/pthread/pthread_spin_init.c: New file.
8881         * sysdeps/pthread/pthread_spin_unlock.c: New file.
8882         * sysdeps/powerpc/Makefile: New file.
8883         * sysdeps/powerpc/pthread_spin_lock.c: New file.
8884         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
8885         * sysdeps/powerpc/pthreaddef.h: New file.
8886         * sysdeps/powerpc/tcb-offsets.sym: New file.
8887         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
8888         * sysdeps/powerpc/tls.h: New file.
8889         * sysdeps/powerpc/bits/atomic.h: New file.
8890         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
8891         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
8892         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
8893
8894         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
8895         * sysdeps/unix/sysv/linux/sem_post.c: New file.
8896         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
8897         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
8898         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
8899         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
8900         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
8901         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
8902         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
8903         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
8904         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
8905         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
8906         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
8907         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
8908         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
8909
8910         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
8911         not gettimeofday.
8912         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
8913         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8914         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
8915         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
8916         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8917
8918 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8919
8920         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
8921         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8922         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8923         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8924         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
8925
8926 2003-03-16  Roland McGrath  <roland@redhat.com>
8927
8928         * tst-fork4.c: Include <string.h>.
8929         * tst-signal2.c: Likewise.
8930         * tst-mutex5.c (do_test): exit -> return.
8931         * tst-mutex2.c: Include <stdlib.h>.
8932
8933 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
8934
8935         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8936         (__lll_mutex_timedlock_wait): Correct expected value after
8937         spurious wakeup.  Otherwise we would never wait again.
8938
8939         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
8940         zone versus inline asm stupidity.  Use correct instructions.
8941
8942         * tst-rwlock6.c: Add some more status output.
8943
8944 2003-03-15  Roland McGrath  <roland@redhat.com>
8945
8946         * sysdeps/pthread/configure.in: New file.
8947         * sysdeps/pthread/configure: New file (generated).
8948
8949 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8950
8951         * allocatestack.c (allocate_stack): Store the exact stack size of
8952         user allocated stacks.
8953
8954 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
8955
8956         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
8957         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
8958         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8959         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
8960         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
8961         Use `header.' prefix.
8962         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8963
8964 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8965
8966         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
8967         __builtin_frame_address, use stack pointer.
8968
8969         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
8970         instead of __builtin_frame_pointer.
8971
8972 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8973
8974         * tst-basic1.c (do_test): Add cast to avoid warning.
8975         * tst-basic2.c (do_test): Likewise.
8976
8977         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
8978         amount of stack correction.
8979
8980         * tst-fork4.c: Use test-skeleton.c.
8981
8982 2003-03-14  Roland McGrath  <roland@redhat.com>
8983
8984         * init.c: Fix typo "#eli" for "#else".
8985
8986 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
8987
8988         * allocatestack.c (__stack_user): Use hidden_data_def.
8989         * pthread_create.c (__pthread_keys): Likewise.
8990
8991         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
8992
8993 2003-03-14  Roland McGrath  <roland@redhat.com>
8994
8995         * tst-fork4.c: New file.
8996         * Makefile (tests): Add it.
8997
8998         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
8999         we always define the padding space.
9000         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
9001         stopped supporting its own extensions fully.
9002         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
9003         struct also called `header', so `header.multiple_threads' is the field
9004         name to use on all machines.
9005         * allocatestack.c (allocate_stack): Use `header.' prefix.
9006         * sysdeps/pthread/createthread.c (create_thread): Likewise.
9007         * pthread_create.c (__pthread_create_2_1): Likewise.
9008         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
9009         (THREAD_SELF): Likewise.
9010         * sysdeps/x86_64/tls.h: Likewise.
9011         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
9012         (SINGLE_THREAD_P): Likewise.
9013         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
9014         (SINGLE_THREAD_P): Likewise.
9015         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
9016         (SINGLE_THREAD_P): Likewise.
9017
9018         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
9019         value directly.
9020
9021 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
9022
9023         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
9024         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
9025
9026         * pthread_create.c (start_thread): setjmp is expected to return 0.
9027
9028         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
9029         (THREAD_GETMEM_NC): Likewise.
9030
9031 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
9032
9033         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
9034         and the size of the stack which must be allocated is a multiple,
9035         allocate one more page.
9036         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
9037         MULTI_PAGE_ALIASING.
9038
9039 2003-03-13  Roland McGrath  <roland@redhat.com>
9040
9041         * pthread_create.c (start_thread): Set EXITING_BIT after the
9042         event-reporting (and destructors), not before.
9043
9044 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
9045
9046         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
9047         lll_futex_wake): Declare register variables as long int instead of
9048         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
9049         Make syscall arguments clobbered by the syscall.
9050         (lll_futex_wait): Define using lll_futex_timed_wait.
9051
9052         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
9053         to void *.
9054
9055         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
9056         PPID if [! NDEBUG].
9057
9058         * allocatestack.c (nptl_ncreated): Only declare if
9059         COLORING_INCREMENT != 0.
9060
9061         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
9062         (__libc_enable_asynccancel_2): Remove prototype.
9063
9064         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
9065         ctid to match kernel.
9066
9067 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
9068
9069         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
9070         libc_multiple_threads.
9071         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
9072         __libc_multiple_threads to...
9073         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
9074
9075         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
9076         versioning.
9077         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
9078         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
9079
9080         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
9081         (__pthread_once_internal): Define.
9082
9083         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
9084         macros instead of .symver directly.
9085         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
9086         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
9087
9088         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
9089         * sysdeps/x86_64/tcb-offsets.sym: New file.
9090         * sysdeps/x86_64/Makefile: New file.
9091
9092         * sysdeps/i386/tcb-offsets.sym: Add SELF.
9093         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
9094         to access own pthread_t in TCB.
9095         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9096         Likewise.
9097         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9098         Likewise.
9099         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9100
9101 2003-03-12  Roland McGrath  <roland@redhat.com>
9102
9103         * pthread-errnos.sym: New file.
9104         * Makefile (gen-as-const-headers): New variable, list that file.
9105         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
9106         header <pthread-errnos.h> instead of defining errno values here.
9107         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
9108         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
9109         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
9110         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9111         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9112         Likewise.
9113         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9114         Likewise.
9115         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
9116         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9117         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9118         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9119         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
9120         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
9121         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
9122         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
9123         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
9124         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
9125         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
9126         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
9127         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
9128         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
9129         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
9130         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
9131         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
9132         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
9133         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
9134         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
9135         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
9136         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
9137         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
9138         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
9139         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
9140         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
9141         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
9142
9143         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
9144         CLONE_CHILD_SETTID worked.
9145
9146 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
9147
9148         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
9149         file.
9150         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
9151         file.
9152
9153         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
9154         (pthread_cond_t): Add padding.
9155
9156         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
9157         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
9158         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
9159
9160         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
9161         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
9162         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
9163         (__pthread_rwlock_timedrdlock): Likewise.
9164         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
9165         (__pthread_rwlock_wrlock): Likewise.
9166         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
9167         (__pthread_rwlock_rdlock): Likewise.
9168
9169         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
9170
9171         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
9172         result of lock re-get if it fails.
9173
9174 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
9175
9176         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
9177         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
9178         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
9179         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
9180         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
9181         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9182         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
9183         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
9184         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
9185         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
9186
9187         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
9188         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
9189
9190         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
9191         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
9192         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
9193         (create_thread): Likewise.
9194         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
9195         * init.c (__pthread_initialize_minimal_internal): Initialize
9196         __libc_multiple_threads_ptr if necessary.
9197         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
9198         __pthread_multiple_threads and __libc_multiple_threads_ptr.
9199         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
9200         __libc_multiple_threads.
9201         (__libc_pthread_init): Return pointer to __libc_pthread_init if
9202         necessary.
9203
9204         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
9205         (THREAD_SETMEM_NC): Likewise.
9206
9207         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
9208         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
9209         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
9210         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
9211
9212         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
9213         Eliminate one entire instruction.
9214
9215         * cancellation.c (__pthread_enable_asynccancel_2): New function.
9216         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
9217         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
9218         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
9219         instead of __pthread_enable_asynccancel.
9220         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
9221         (__pthread_cond_wait): Likewise.
9222         * sysdeps/pthread/pthread_cond_timedwait.c
9223         (__pthread_cond_timedwait): Likewise.
9224         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
9225
9226         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
9227         (__condvar_cleanup): Wake up all waiters in case we got signaled
9228         after being woken up but before disabling asynchronous
9229         cancellation.
9230         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
9231         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
9232         (__condvar_cleanup): Likewise.
9233
9234         * init.c (__NR_set_tid_address): If already defined, don't redefine.
9235         Make it an error if architecture has no #if case.  Add x86-64.
9236
9237         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
9238         pt-initfini.s generation.
9239
9240         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
9241         (TLS_INIT_TP): Fix typo.
9242
9243 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
9244
9245         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
9246         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
9247
9248         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
9249         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
9250         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
9251         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
9252         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
9253         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
9254         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
9255         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
9256
9257 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
9258
9259         * sysdeps/pthread/pthread_cond_timedwait.c
9260         (__pthread_cond_timedwait): Return the result of the final
9261         locking.  If it succeeds, the regular function return value.
9262
9263         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
9264         Return result of the final locking.
9265         * version.c (__nptl_main): Work around problems with the strange
9266         INTERNAL_SYSCALL macro on ppc32.
9267         * init.c (__pthread_initialize_minimal_internal): Unblock
9268         SIGCANCEL in case the parent blocked it.
9269         Reported by Paul Mackerras <paulus@samba.org>.
9270
9271         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
9272         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
9273         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
9274
9275 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
9276
9277         * sysdeps/pthread/pthread_cond_timedwait.c
9278         (__pthread_cond_timedwait): Unlock and fail if
9279         __pthread_mutex_unlock_internal failed.
9280
9281         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
9282         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
9283         Use ARCH_CLONE.
9284         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
9285         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
9286         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
9287         ALLOCATE_STACK): New macros.
9288         (TLS_TPADJ): New macro.
9289         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
9290         (allocate_stack): Handle TLS_DTV_AT_TP and
9291         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
9292         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
9293         Don't set PD->self.
9294         * init.c [__ia64__] (__NR_set_tid_address): Define.
9295
9296         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
9297         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
9298         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
9299         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
9300         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
9301         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
9302         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
9303         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
9304         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
9305         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
9306         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
9307         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
9308         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
9309         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
9310         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
9311         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
9312         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
9313         * sysdeps/ia64/bits/atomic.h: New file.
9314         * sysdeps/ia64/Makefile: New file.
9315         * sysdeps/ia64/pthread_spin_init.c: New file.
9316         * sysdeps/ia64/pthread_spin_lock.c: New file.
9317         * sysdeps/ia64/pthread_spin_trylock.c: New file.
9318         * sysdeps/ia64/pthread_spin_unlock.c: New file.
9319         * sysdeps/ia64/pthreaddef.h: New file.
9320         * sysdeps/ia64/tcb-offsets.sym: New file.
9321         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
9322         * sysdeps/ia64/tls.h: New file.
9323
9324         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
9325         to syscall instead of no arguments.
9326
9327 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
9328
9329         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
9330         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
9331         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
9332         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
9333
9334         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
9335         unused code.
9336
9337         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
9338
9339         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
9340         lowlevelbarrier.sym.
9341         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
9342         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
9343         Include lowlevelbarrier.h and don't define offsets locally.
9344         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
9345
9346         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
9347         (__lll_mutex_lock_wait): Reverse order of first two parameters.
9348         (__lll_mutex_timedlock_wait): Likewise.
9349         (lll_mutex_lock): Adjust asm for that.
9350         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
9351         (lll_lock): Adjust asm for operand order change.
9352         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
9353         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
9354
9355         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
9356         Reverse order of parameters.
9357         (__lll_timedwait_tid): Remove regparms attribute.
9358         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
9359         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
9360
9361         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9362         (__lll_timedwait_tid): Remove one unnecessary instruction.
9363
9364         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
9365         __lll_mutex_timedlock_wait only for NOT_IN_libc.
9366         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
9367         lowlevelmutex.S.
9368
9369         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
9370         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
9371         for NOT_IN_libc.
9372         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
9373         lowlevellock.S.
9374
9375         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
9376         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
9377         for libc.so.
9378         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
9379         define LOCK here (if UP is not defined).  The actual code is in
9380         lowlevelmutex.S.
9381
9382         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
9383         LOCK is already defined.  Don't define lll_unlock_wake_cb and
9384         __lll_timedwait_tid for libc.so.
9385         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
9386         define LOCK here (if UP is not defined).  The actual code is in
9387         lowlevellock.S.
9388
9389         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
9390         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
9391         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
9392         instead of lowlevelsem.h.
9393         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
9394         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
9395         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
9396
9397         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
9398         lowlevelrwlock.sym.
9399         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
9400         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
9401         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
9402
9403         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
9404         register loading.
9405         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
9406         last changed.  D'oh.
9407
9408         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
9409
9410         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
9411         of __libc_locking_needed.
9412         (lll_trylock): Initialize %eax to zero.
9413
9414         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
9415         pthread_cond_t definition.
9416
9417 2003-03-10  Roland McGrath  <roland@redhat.com>
9418
9419         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
9420         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
9421         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
9422         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
9423         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
9424
9425         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
9426         Instead of setting PD->multiple_threads, set globals
9427         __pthread_multiple_threads and __libc_multiple_threads.
9428         * sysdeps/pthread/createthread.c (create_thread): Likewise.
9429         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
9430         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
9431
9432         * descr.h (struct pthread): Conditionalize first member on
9433         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
9434         containing an anonymous tcbhead_t.  Move `list' member out.
9435         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
9436         * allocatestack.c: Remove use of `header.data.' prefix.
9437         * pthread_create.c: Likewise.
9438         * init.c (__pthread_initialize_minimal_internal): Likewise.
9439         * sysdeps/pthread/createthread.c (create_thread): Likewise.
9440         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
9441         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
9442         * sysdeps/x86_64/tls.h: Likewise.
9443         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
9444         (SINGLE_THREAD_P): Likewise.
9445         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
9446         (SINGLE_THREAD_P): Likewise.
9447         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
9448         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
9449
9450 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
9451
9452         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
9453
9454         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
9455         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9456
9457         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
9458         leftovers from the ia32 code.
9459
9460         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
9461         memory load.
9462         (clear_once_control): Don't load %esi.
9463
9464         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
9465         handling.
9466
9467         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9468
9469         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
9470         * sysdeps/unix/sysv/linux/createthread.c: ...here.
9471
9472         * Makefile (tests): Add tst-cond10.
9473         * tst-cond10.c: New file.
9474
9475 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
9476
9477         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
9478         * tst-signal3.c (do_test): Likewise.
9479         * tst-sem5.c (do_test): Likewise.
9480         * tst-kill6.c (do_test): Likewise.
9481         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
9482
9483         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
9484         of inc/dec.
9485         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9486         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
9487         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
9488         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
9489         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9490         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9491         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9492         Likewise.
9493         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9494         Likewise.
9495         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
9496         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9497         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9498         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9499         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9500         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9501         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9502         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9503
9504         * allocatestack.c (allocate_stack): If mprotect() fails free the
9505         TLS memory.
9506
9507 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
9508
9509         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
9510
9511         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
9512         lll_wake_tid.  This was used only to work around kernel limits in
9513         the early days.
9514         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
9515         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
9516         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
9517         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
9518
9519         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
9520         (__pthread_initialize_minimal_internal): Change initialization of
9521         __static_tls_align_m1 appropriately.
9522         * pthreadP.h (__static_tls_align_m1): Renamed from
9523         __static_tls_align.
9524         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
9525         instead of __static_tls_align-1.
9526
9527 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
9528
9529         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
9530
9531         * pthread_create.c: Define __pthread_keys using nocommon
9532         attribute, not by placing it explicitly in bss.
9533         Remove DEFINE_DEALLOC definition.  Not needed anymore.
9534
9535         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
9536         Use it in mmap call to allocate stacks.
9537
9538         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
9539
9540         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
9541         result of the thread function.
9542
9543 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
9544
9545         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
9546         version is just fine.
9547
9548         * sysdeps/unix/sysv/linux/libc_pthread_init.c
9549         (__pthread_child_handler): Renamed from pthread_child_handler,
9550         exported, and marked hidden.  Change all users.
9551         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
9552         free __pthread_child_handler from child list.
9553
9554 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9555
9556         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
9557
9558         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
9559         Fix handling of cancellation and failing pthread_mutex_unlock call.
9560         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
9561         (__pthread_cond_wait): Likewise.
9562
9563         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
9564         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
9565         lll_futex_timed_wait call.
9566         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
9567         (pthread_rwlock_timedwrlock): Likewise.
9568
9569         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
9570         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
9571         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
9572
9573         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
9574         check of lll_futex_wake return value.
9575
9576 2003-03-03  Roland McGrath  <roland@redhat.com>
9577
9578         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
9579
9580         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9581         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
9582         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
9583
9584 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
9585
9586         * sysdeps/pthread/timer_create.c (timer_create): Return correct
9587         error for CPU clocks.
9588
9589         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
9590         _POSIX_MONOTONIC_CLOCK.
9591         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
9592
9593         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
9594         recent kernels.
9595
9596 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9597
9598         * descr.h (struct pthread): Move cleanup field to the front.
9599
9600 2003-03-01  Roland McGrath  <roland@redhat.com>
9601
9602         * sem_open.c (sem_open): Braino fix.
9603
9604 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9605
9606         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
9607         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
9608         __pthread_cleanup_pop functionality.
9609         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9610
9611         * descr.h (struct pthread): Move tid field to the front now that
9612         it is often used.
9613
9614         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
9615         (__lll_mutex_timedlock_wait): Remove.
9616         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9617         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
9618         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9619         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9620         (lll_unlock_wake_cb): Don't save and restore %esi.
9621         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9622         %esi.
9623         (__lll_timedwait_tid): Add alignment.
9624         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9625         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9626         %esi.
9627         (__lll_timedwait_tid): Removed.
9628         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
9629         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
9630         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
9631         (pthread_barrier_wait): Don't save, load, and restore %esi for
9632         last thread.
9633         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
9634         (__pthread_cond_signal): Don't save, load, and restore %esi.
9635         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
9636         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
9637         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
9638         Don't save, load, and restore %esi.
9639
9640 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
9641
9642         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
9643         Release lock before waking up the waiters.
9644
9645         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
9646
9647         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
9648         (reader_thread): Likewise.
9649
9650         * sysdeps/pthread/pthread_rwlock_unlock.c
9651         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
9652         to wake up readers if there are none.
9653
9654         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
9655         Release internal lock before wake threads.
9656
9657 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
9658
9659         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
9660         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
9661         predefined.
9662         * tst-rwlock9.c: Likewise.
9663         * tst-rwlock10.c: New file.
9664         * tst-rwlock11.c: New file.
9665
9666         * Makefile (tests): Add tst-dlsym1.
9667         * tst-dlsym1.c: New file.
9668
9669         * init.c (__pthread_initialize_minimal_internal): Set
9670         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
9671         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
9672
9673 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
9674
9675         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
9676
9677         * tst-cond2.c: Fix sychronization with child.
9678
9679         * tst-rwlock8.c (reader_thread): Remove unused variable.
9680
9681         * Makefile: Add rules to build and run tst-tls3.
9682         * tst-tls3.c: New file.
9683         * tst-tls3mod.c: New file.
9684
9685         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
9686         * tst-rwlock8.c: New file.
9687         * tst-rwlock9.c: New file.
9688         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
9689         complete broken rwlock implementation.
9690         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9691         Likewise.
9692         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9693         Likewise.
9694         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9695         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9696         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
9697         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
9698         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
9699         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
9700         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
9701
9702 2003-02-23  Roland McGrath  <roland@redhat.com>
9703
9704         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
9705
9706 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
9707
9708         * Makefile (tests): Add tst-context1.
9709         * tst-context1.c: New file.
9710
9711         * Makefile (tests): Add tst-tls1 and tst-tls2.
9712         * tst-tls1.c: New file.
9713         * tst-tls2.c: New file.
9714
9715         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
9716         for failed cmpxchg.
9717
9718         * pthread_create.c (start_thread): Set EXITING_BIT early.
9719
9720         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
9721         (THREAD_GETMEM_NC): Likewise.
9722
9723 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
9724
9725         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
9726         off 3 more bytes by using offset-less instructions when possible.
9727
9728         * Makefile: Add dependency for $(objpfx)version.d.
9729
9730         * eintr.c (eintr_source): Add unnecessary return but the compiler
9731         insists.
9732
9733         * tst-kill3.c: Include <unistd.h>.
9734
9735 2003-02-21  Roland McGrath  <roland@redhat.com>
9736
9737         * pthread_create.c (start_thread): Call __libc_thread_freeres.
9738
9739 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9740
9741         * Makefile (tests): Add tst-eintr1.
9742         (distribute): Add eintr.c.
9743         * tst-eintr1.c: New file.
9744         * eintr.c: New file.
9745
9746         * pthread_cancel.c (pthread_cancel): Use tkill directly.
9747
9748         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
9749         Disallow sending SIGCANCEL.
9750
9751         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
9752         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
9753         * tst-kill1.c: New file.
9754         * tst-kill2.c: New file.
9755         * tst-kill3.c: New file.
9756         * tst-kill5.c: New file.
9757         * tst-kill6.c: New file.
9758         * tst-basic7.c: Renamed to...
9759         * tst-kill4.c: ...this.
9760
9761 2003-02-21  Roland McGrath  <roland@redhat.com>
9762
9763         * Makefile (install-lib-ldscripts): New variable.
9764
9765 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9766
9767         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
9768         * pthread_cancel.c: Use INVALID_TD_P.
9769         * pthread_detach.c: Likewise.
9770         * pthread_getschedparam.c: Likewise.
9771         * pthread_setschedparam.c: Likewise.
9772         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
9773         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
9774         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
9775         * pthread_timedjoin.c: Likewise.
9776
9777         * tst-basic7.c: Include <signal.h>.
9778
9779         * pthread_join.c (pthread_join): Limited checking for invalid
9780         descriptors.
9781         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
9782
9783 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
9784
9785         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
9786         beginning of the loop.  Clear the entire first block of TSD.
9787         * Makefile (tests): Add tst-key4.
9788         * tst-key4.c: New file.
9789
9790 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
9791
9792         * Makefile (tests): Add tst-basic7.
9793         * tst-basic7.c: New file.
9794
9795         * pthread_create.c (deallocate_tsd): Mark as internal_function.
9796         Add some more __builtin_expect.
9797
9798         * pthreadP.h: Define dummy version of DEBUGGING_P.
9799
9800 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
9801
9802         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
9803         _POSIX_THREAD_PRIORITY_SCHEDULING.
9804         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
9805         _XOPEN_REALTIME_THREADS.
9806         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
9807
9808         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
9809         kernel returns EINVAL for PID <= 0, work around it.
9810
9811         * Makefile (tests): Add tst-signal5.
9812         * tst-signal5.c: New file.
9813
9814         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
9815         and LOGIN_NAME_MAX.
9816
9817         * tst-cancel1.c (tf): Block all signals.
9818
9819         * Makefile (tests): Add tst-basic6.
9820         * tst-basic6.c: New file.
9821
9822         * tst-basic1.c: Add test for process ID.
9823
9824         * Makefile (tests): Add tst-cancel10.
9825         * tst-cancel10.c: New file.
9826
9827         * Makefile (tests): Add tst-signal4.
9828         * tst-signal4.c: New file.
9829
9830         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
9831         __sigismember instead of sigismember.  Add __builtin_expect.
9832
9833 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
9834
9835         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
9836         pthread_setcancelstate, and pthread_rwlock_setpshared.
9837
9838         * tst-cancel7.c (do_test): Make sure the pid file exists before
9839         canceling the thread.
9840
9841         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
9842         pthread_rwlock_timedrdlock tests.
9843         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
9844         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9845         Check for invalid tv_nsec field.
9846         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9847         Likewise.
9848
9849         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
9850         recursive mutex of overflow.
9851
9852         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
9853
9854         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
9855         going into an endless loop.
9856         * Makefile (tests): Add tst-cancel9.
9857         * tst-cancel9.c: New file.
9858
9859         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
9860
9861 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
9862
9863         * tst-mutex5.c (do_test): Add more timedlock tests.
9864
9865         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
9866         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
9867
9868         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
9869         use INLINE_SYSCALL.  Error number is returned, not -1.
9870
9871         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
9872         and __deallocate_stack with internal_function.
9873         * pthread_create.c: Adjust definitions appropriately.
9874         * allocatestack.c: Likewise.
9875
9876         * pthread_join.c: Add one more __builtin_expect.
9877         * pthread_timedjoin.c: Likewise.
9878
9879         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
9880         not data of sequence number does not match.
9881         Add one __builtin_expect.
9882
9883         * Makefile (tests): Add tst-clock1.
9884         * tst-clock1.c: New file.
9885
9886         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
9887         negative arguments.
9888         * Makefile (tests): Add tst-basic5.
9889         * tst-basic5.c: New file.
9890
9891 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
9892
9893         * Makefile (tests): Add tst-basic4.
9894         * tst-basic4.c: New file.
9895
9896         * pthreadP.h: Add declaraction for __nptl_nthreads.
9897         * pthread_create.c: Define __nptl_nthreads
9898         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
9899         after thread is done.  If then zero, call exit(0).
9900         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9901         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
9902         * init.c (pthread_functions): Initialize ptr_nthreads.
9903         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
9904         (__reclaim_stacks): Decrement __nptl_nthreads.
9905         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
9906         Define.
9907         * Makefile (tests): Add tst-basic3.
9908         * tst-basic3.c: New file.
9909
9910         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
9911         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
9912         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
9913         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
9914         if asynchronous canceling is enabled.
9915         * pthread_join.c (pthread_join): When recognizing circular joins,
9916         take into account the other thread might be already canceled.
9917         * Makefile (tests): Add tst-join5.
9918         * tst-join5.c: New file.
9919
9920         * Makefile (tests): Add tst-join4.
9921         * tst-join4.c: New file.
9922
9923 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9924
9925         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
9926
9927 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9928
9929         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
9930         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
9931         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
9932         warning.
9933         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
9934         to avoid warning.
9935         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
9936         error if lll_futex_wake failed.
9937
9938 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9939
9940         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
9941         handling of cancellation and failung pthread_mutex_unlock call.
9942         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9943         * Makefile (tests): Add tst-cond8 and tst-cond9.
9944         * tst-cond8.c: New file.
9945         * tst-cond9.c: New file.
9946
9947         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
9948
9949         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
9950         non-standard initializers with __USE_GNU.
9951
9952         * Makefile (tests): Add tst-cleanup3.
9953         * tst-cleanup3.c: New file.
9954
9955 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
9956
9957         * Makefile (tests): Add tst-attr1 and tst-attr2.
9958         * tst-attr1.c: New file.
9959         * tst-attr2.c: New file.
9960
9961         * Makefile: Add rules to build and run tst-atfork2 test.
9962         * tst-atfork2.c: New file.
9963         * tst-atfork2mod.c: New file.
9964
9965         * sysdeps/unix/sysv/linux/unregister-atfork.c
9966         (__unregister_atfork): Free the memory allocated for the handlers
9967         after removing them from the lists.
9968
9969         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
9970         cleanup function.
9971
9972         * tst-atfork1.c (do_test): Wait for the child we forked.
9973         Report error in child.
9974
9975         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
9976
9977         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
9978
9979 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
9980
9981         * Makefile (tests): Add tst-cancel8.
9982         * tst-cancel8.c: New file.
9983
9984         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
9985         clearing of control variable.
9986         * Makefile (tests): Add tst-once3 and tst-once4.
9987         * tst-once3.c: New file.
9988         * tst-once4.c: New file.
9989
9990 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
9991
9992         * sysdeps/sh/Makefile: New file.
9993         * sysdeps/sh/bits/atomic.h: New file.
9994         * sysdeps/sh/pthread_spin_init.c: New file.
9995         * sysdeps/sh/pthread_spin_lock.c: New file.
9996         * sysdeps/sh/pthread_spin_trylock.S: New file.
9997         * sysdeps/sh/pthread_spin_unlock.S: New file.
9998         * sysdeps/sh/pthreaddef.h: New file.
9999         * sysdeps/sh/tcb-offsets.sym: New file.
10000         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
10001         * sysdeps/sh/tls.h: New file.
10002         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
10003         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
10004         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
10005         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
10006         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
10007         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
10008         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
10009         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
10010         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
10011         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
10012         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
10013         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
10014         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
10015         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
10016         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
10017         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
10018         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
10019         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
10020         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
10021         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
10022         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
10023         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
10024         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
10025         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
10026         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
10027         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
10028         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
10029         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
10030         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
10031         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
10032
10033 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
10034
10035         * tst-cond2.c: Rearrange code to not rely on behavior undefined
10036         according to POSIX.
10037
10038         * tst-basic2.c (do_test): Lock mutex before creating the thread.
10039
10040 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
10041
10042         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
10043         (TLS_GET_FS): New #define.
10044         (TLS_SET_FS): New #define.
10045         Correct value of __NR_set_thread_area.
10046
10047         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
10048
10049 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
10050
10051         * Makefile (tests): Add tst-popen1.
10052         * tst-popen1.c: New file.
10053
10054         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
10055         but inactive generalization.
10056         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
10057         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
10058         Minor optimization, remove one instruction.
10059         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
10060
10061 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
10062
10063         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
10064
10065 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
10066
10067         * init.c (__NR_set_tid_address): Add #ifdef for s390.
10068         * sysdeps/pthread/pthread_barrier_wait.c: New file.
10069         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
10070         * sysdeps/pthread/pthread_cond_signal.c: New file.
10071         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
10072         * sysdeps/pthread/pthread_cond_wait.c: New file.
10073         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
10074         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
10075         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
10076         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
10077         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
10078         * sysdeps/s390/Makefile: New file.
10079         * sysdeps/s390/bits/atomic.h: New file.
10080         * sysdeps/s390/pthread_spin_init.c: New file.
10081         * sysdeps/s390/pthread_spin_lock.c: New file.
10082         * sysdeps/s390/pthread_spin_trylock.c: New file.
10083         * sysdeps/s390/pthread_spin_unlock.c: New file.
10084         * sysdeps/s390/pthreaddef.h: New file.
10085         * sysdeps/s390/tcb-offsets.sym: New file.
10086         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
10087         * sysdeps/s390/tls.h: New file.
10088         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
10089         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
10090         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
10091         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
10092         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
10093         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
10094         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
10095         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
10096         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
10097         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
10098         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
10099         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
10100         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
10101         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
10102         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
10103         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
10104         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
10105         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
10106         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
10107         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
10108         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
10109         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
10110         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
10111
10112 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
10113
10114         * atomic.h: Add a couple more default implementations.
10115         (atomic_compare_and_exchange_acq): Use
10116         __arch_compare_and_exchange_32_acq in return value definition.  It
10117         always exists.
10118         (atomic_bit_set): Renamed from atomic_set_bit.
10119         Add missing atomic_ prefixes.
10120
10121         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
10122         thread library is available, use correct value to mark initialized
10123         once variable.
10124
10125 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
10126
10127         * allocatestack.c (allocate_stack): Use __getpagesize instead of
10128         __sysconf to determine pagesize.
10129
10130         * pthread_create.c: Include <atomic.h>.
10131         * allocatestack.c (allocate_stack): Implement coloring of the
10132         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
10133         size minus one.  Adjust users.
10134         * sysdeps/i386/i686/Makefile: New file.
10135
10136 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
10137
10138         * allocatestack.c: Improve comment throughout the file.
10139
10140         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
10141         (__lll_lock_wait): Add branch prediction.
10142         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
10143         (__lll_lock_wait): Likewise.
10144         (lll_unlock_wake_cb): Removed.
10145
10146 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
10147
10148         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
10149         _POSIX_THREAD_PRIORITY_SCHEDULING.
10150
10151 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
10152
10153         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
10154         Fix return type of ptr___pthread_getspecific.
10155
10156 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
10157
10158         * Makefile (tests): Add tst-umask1.
10159         (tst-umask1-ARGS): Define.
10160         * tst-umask1.c: New file.
10161
10162 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
10163
10164         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
10165         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
10166         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
10167         pthread_rwlock_unlock.
10168         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
10169         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
10170         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
10171         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
10172         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
10173         New file.
10174         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
10175         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
10176         New file.
10177         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
10178         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
10179         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
10180         New file.
10181         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
10182         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
10183         New file.
10184         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
10185         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
10186         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
10187         New file.
10188         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
10189         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
10190         New file.
10191         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
10192
10193         * Makefile (libpthread-routines): Remove lowlevelcond and
10194         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
10195         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
10196         and pthread_cond_broadcast.
10197         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
10198         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
10199         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
10200         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
10201         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
10202         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
10203         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
10204         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
10205         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
10206         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
10207         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
10208         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
10209         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
10210         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
10211         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
10212         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
10213         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
10214         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
10215         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
10216         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
10217         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
10218         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
10219         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
10220         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
10221         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
10222         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
10223         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
10224         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
10225         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
10226         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
10227         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
10228
10229         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
10230         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
10231         of the code is moved to ...
10232         * sysdeps/pthread/createthread.c: ...here.  New file.
10233
10234 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
10235
10236         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
10237         (__new_sem_post): Clear %eax before returning.
10238         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
10239
10240         * Makefile (tests): Add tst-cleanup2.
10241         * tst-cleanup2.c: New file.
10242
10243         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10244         Interpret first parameter correctly.
10245
10246 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
10247
10248         * Makefile (headers): Add bits/semaphore.h.
10249
10250 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
10251
10252         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
10253         if not SHARED.
10254
10255 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
10256
10257         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
10258         must be used and mapping failed.
10259         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
10260
10261         * Makefile (CFLAGS-pthread_self.os): Define this, not
10262         CFLAGS-pthread_self.c.
10263
10264 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
10265
10266         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
10267         lll_unlock_wake_cb.
10268
10269         * Makefile (libpthread-routines): Add version.  Add rules to build
10270         version.os and banner.h.
10271         * version.c: New file.
10272
10273 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
10274
10275         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
10276         the alias unconditional.
10277         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
10278
10279 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
10280
10281         * Makefile (CFLAGS-pthread_self.c): New definition.
10282
10283 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
10284
10285         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
10286         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
10287         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
10288         * init.c (__pthread_initialize_minimal_internal): Likewise.
10289
10290 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
10291
10292         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
10293
10294         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
10295         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
10296         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
10297         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
10298         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
10299         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
10300
10301 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
10302
10303         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
10304         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
10305         * tst-cancel-wrappers.sh: Remove all exceptions.
10306
10307 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
10308
10309         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
10310         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
10311
10312         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
10313         Use __libc_pthread_functions array if SHARED.
10314
10315         * pthreadP.h: Move pthread_cond_2_0_t definition to...
10316         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
10317
10318         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
10319         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
10320         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
10321         __libc_ptf_call instead of __libc_maybe_call.
10322         (PTF): New #define.
10323         (__libc_cleanup_region_start): Wrap function name with PTF call.
10324         (__libc_cleanup_region_end): Likewise.
10325         (__libc_cleanup_end): Likewise.
10326
10327         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
10328         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
10329         * pthread_key_create.c: Add __pthread_key_create_internal alias.
10330         * pthreadP.h: Add prototypes.
10331
10332         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
10333         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
10334         __pthread_rwlock_unlock aliases.
10335         * pthreadP.h: Add prototypes for new aliases.
10336
10337         * pthreadP.h (struct pthead_functions): Moved to...
10338         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
10339         * init.c (pthread_functions): Add initializers for new elements.
10340
10341         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
10342         __pthread_cleanup_pop_restore aliases.
10343         * pthreadP.h: Add prototypes.
10344
10345         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
10346         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
10347         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
10348         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
10349         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
10350         * pthreadP.h: Adjust prototypes and callers.
10351
10352 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
10353
10354         * Makefile (tests): Add tst-cancel7.
10355         (tst-cancel7-ARGS): New variable.
10356         * tst-cancel7.c: New file.
10357
10358         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
10359         around gcc defficiencies.
10360         * old_pthread_cond_signal.c: Likewise.
10361         * old_pthread_cond_timedwait.c: Likewise.
10362         * old_pthread_cond_wait.c: Likewise.
10363
10364         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
10365
10366 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
10367
10368         * Makefile (tests): Add tst-cond7.
10369         * tst-cond7.c: New file.
10370
10371         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
10372         (condvar_cleanup): Get condvar address from the right place.
10373
10374         * atomic.h: Correct definitions of atomic_full_barrier,
10375         atomic_read_barrier, atomic_write_barrier.
10376
10377         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
10378         race-free.
10379         * old_pthread_cond_signal.c: Likewise.
10380         * old_pthread_cond_timedwait.c: Likewise.
10381         * old_pthread_cond_wait.c: Likewise.
10382
10383 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
10384
10385         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
10386
10387 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
10388
10389         * pthreadP.h (pthread_cond_2_0_t): New type.
10390         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
10391         Use new type for the 2.0 condvar function prototypes.
10392         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
10393         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
10394         parameter.
10395         * old_pthread_cond_destroy.c: Likewise.
10396         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
10397         * old_pthread_cond_signal.c: Likewise.
10398         * old_pthread_cond_timedwait.c: Likewise.
10399         * old_pthread_cond_wait.c: Likewise.
10400
10401         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
10402         (__pthread_cond_wait): Don't save cancellation mode and seq value
10403         in same location.
10404
10405         * herrno.c (__h_errno_location): Don't define as weak.
10406
10407 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
10408
10409         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
10410         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
10411         and pthread_cond_wait.
10412         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
10413         Renamed to...
10414         (__pthread_cond_broadcast_2_0): ... this.
10415         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
10416         Renamed to...
10417         (__pthread_cond_destroy_2_0): ... this.
10418         * old_pthread_cond_init.c (__old_pthread_cond_init):
10419         Renamed to...
10420         (__pthread_cond_init_2_0): ... this.
10421         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
10422         Renamed to...
10423         (__pthread_cond_signal_2_0): ... this.
10424         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
10425         Renamed to...
10426         (__pthread_cond_wait_2_0): ... this.
10427         * pthread_cond_destroy.c: Include shlib-compat.h.
10428         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
10429         * pthread_cond_init.c: Include shlib-compat.h.
10430         (pthread_cond_init): Change strong_alias into versioned_symbol.
10431         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
10432         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
10433         fields.
10434         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
10435         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
10436         __pthread_cond_wait_2_0): New prototypes.
10437         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
10438         __old_pthread_cond_init, __old_pthread_cond_signal,
10439         __old_pthread_cond_wait): Removed.
10440         * init.c: Include shlib-compat.h.
10441         (pthread_functions): Guard ptr___pthread_attr_init_2_0
10442         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
10443         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
10444         ptr___pthread_cond_*_2_0 fields.
10445         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
10446         pthread_cond_*@GLIBC_2.0 compatibility symbols.
10447
10448         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
10449         LIBC_SIGACTION was not yet defined.
10450         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
10451         [!defined LIBC_SIGACTION] (__sigaction): New function and
10452         libc_hidden_weak.
10453         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
10454         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
10455
10456 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
10457
10458         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
10459
10460 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
10461
10462         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
10463         New, larger type definition.
10464         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
10465         implementation.
10466         * Versions [libpthread]: Add definitions for new pthread_cond_*
10467         interfaces for version GLIBC_2.3.2.
10468         * pthread_cond_init.c: Update initialization for new type definition.
10469         * Makefile (libpthread-routines): Remove pthread_cond_wait,
10470         pthread_cond_timedwait, pthread_cond_signal, and
10471         pthread_cond_broadcast.  Add old_pthread_cond_init,
10472         old_pthread_cond_destroy, old_pthread_cond_wait,
10473         old_pthread_cond_timedwait, old_pthread_cond_signal, and
10474         old_pthread_cond_broadcast.
10475         * old_pthread_cond_broadcast.c: New file.
10476         * old_pthread_cond_destroy.c: New file.
10477         * old_pthread_cond_init.c: New file.
10478         * old_pthread_cond_signal.c: New file.
10479         * old_pthread_cond_timedwait.c: New file.
10480         * old_pthread_cond_wait.c: New file.
10481         * pthreadP.h: Add prototypes for the compatibility interfaces.
10482
10483         * pthread_cond_destroy.c: Don't include <errno.h>.
10484
10485 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
10486
10487         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
10488         unnecessary zero offset when addressing MUTEX.
10489
10490 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10491
10492         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
10493         __register_atfork.
10494         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
10495         for __register_atfork.
10496
10497 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10498
10499         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
10500         instead of ASSEMBLER test macro.
10501
10502         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
10503         __libc_current_sigrtmax): Add libc_hidden_def.
10504
10505         * sysdeps/pthread/list.h: Remove assert.h include.
10506
10507 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10508
10509         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
10510         __pthread_initialize_minimal_internal not
10511         __pthread_initialize_minimal.
10512
10513 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
10514
10515         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
10516         __pthread_initialize_minimal as hidden.
10517
10518         * init.c (__pthread_initialize_minimal_internal): Don't mark as
10519         constructor.
10520
10521 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10522
10523         * Makefile ($(inst_libdir)/libpthread.so): Depend on
10524         $(common-objpfx)format.lds, include that into the output script.
10525         Fix comment.
10526         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
10527
10528 2002-12-28  Andreas Jaeger  <aj@suse.de>
10529
10530         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
10531         nsec resolution changes.
10532         (xstat64_conv): Likewise.
10533         (xstat32_conv): Likewise.
10534         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
10535         struct kernel_stat.
10536         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
10537         structs stat and stat64.
10538         * time/time.h (__timespec_defined): Define for __USE_MISC.
10539         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
10540
10541 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
10542
10543         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
10544         argument.
10545         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
10546         (pthread_exit): Use strong_alias to avoid warnings.
10547         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
10548         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
10549         ptr___pthread_attr_init_2_*.
10550         * init.c (pthread_functions): Adjust.
10551
10552 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
10553
10554         * forward.c: Make all functions available by default again.  It
10555         caused too much trouble.
10556
10557         * pt-siglongjmp.c: Removed.
10558
10559 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
10560
10561         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
10562         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
10563         * sysdeps/i386/Makefile: New file.
10564         * sysdeps/i386/tcb-offsets.sym: New file.
10565         * sysdeps/pthread/tcb-offsets.h: New file.
10566         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10567         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
10568
10569         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
10570         __register_atfork...
10571         (GLIBC_2.3.2): ...here.
10572
10573 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10574
10575         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
10576         pthread_attr_setstackaddr with __attribute_deprecated__.
10577
10578 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10579
10580         * pt-system.c (system): Remove cancellation handling.
10581         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
10582         cancellation routines.
10583
10584 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10585
10586         * descr.h: Include <dl-sysdep.h>.
10587         (struct pthread): Move header.data.list to the back of the struct.
10588         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
10589         (MULTIPLE_THREADS_OFFSET): Adjust offset.
10590         (SYSINFO_OFFSEET): Likewise.
10591
10592 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10593
10594         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
10595         Define.
10596         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
10597         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
10598         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
10599         (USE_DL_SYSINFO): Undef.
10600
10601 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
10602
10603         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
10604         $(common-objpfx)libc.so.
10605         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
10606         it is bigger than pipe buffer size even on arches with bigger
10607         page size.
10608         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
10609
10610 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
10611
10612         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
10613         correct errno access for case that USE___THREAD is not defined.
10614
10615 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
10616
10617         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
10618         Patch by Marijn Ros <marijn@mad.scientist.com>.
10619
10620 2002-12-22  Roland McGrath  <roland@redhat.com>
10621
10622         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
10623
10624 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
10625
10626         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
10627
10628 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
10629
10630         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
10631         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
10632         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
10633
10634         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
10635         of int $0x80.
10636         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10637         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
10638         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
10639         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10640         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10641         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
10642         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
10643         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
10644
10645         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
10646         sysenter.
10647         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
10648
10649         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
10650
10651         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
10652         in new TCB.
10653         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
10654         that sysinfo is properly initialized.
10655         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
10656         to 1 only for ld.so.
10657
10658         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
10659         RTLD_CORRECT_DYNAMIC_WEAK.
10660
10661 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
10662
10663         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
10664         Use return 0 as 6th argument to FORWARD4.
10665         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
10666
10667 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10668
10669         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
10670         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
10671         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
10672         (INIT_SYSINFO): New #define.
10673         (TLS_TP_INIT): Use INIT_SYSINFO.
10674         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10675         At test to make sure SYSINFO_OFFSET value is correct.
10676         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
10677
10678 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
10679
10680         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
10681         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
10682         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
10683         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
10684         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
10685         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
10686         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
10687
10688 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10689
10690         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
10691         macro instead of using int $0x80 directly.
10692
10693         * sysdeps/pthread/bits/stdio-lock.h: New file.
10694         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
10695         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
10696         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
10697         * Makefile (routines): Add libc-lowlevelmutex.
10698
10699         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
10700         __i686.get_pc_thunk.dx.
10701
10702 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10703
10704         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
10705         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
10706         ($(objpfx)tst-cancel-wrappers.out): New rule.
10707         * tst-cancel-wrappers.sh: New test.
10708         * tst-locale1.c: Include signal.h.
10709         (uselocale): Test static linking of __libc_current_sigrt*.
10710
10711 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
10712
10713         * Makefile (tests): Add tst-cancel6.
10714         * tst-cancel6.c: New file
10715
10716 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10717
10718         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
10719         Define meaningfully for assembler as well.
10720         * pthreadP.h (struct pthread_functions): Remove
10721         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
10722         and ptr_pthread_attr_init_2_1 fields.
10723         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
10724         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
10725         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
10726         (FORWARD3): Define using FORWARD4.
10727         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
10728         versions.
10729         * pt-system.c: Remove duplicate stdlib.h include.
10730
10731 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
10732
10733         * sem_init.c: Define sem_init@GLIBC_2.0.
10734         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
10735         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
10736
10737         * flockfile.c: Moved to...
10738         * sysdeps/pthread/flockfile.c: ...here.  New file.
10739         * funlockfile.c: Moved to...
10740         * sysdeps/pthread/funlockfile.c: ...here.  New file.
10741         * ftrylockfile.c: Moved to...
10742         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
10743
10744 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
10745
10746         * libc-cancellation.c: Guard both function with
10747         #if !defined NOT_IN_libc.
10748         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
10749         automatically provided pthread wrappers.
10750         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
10751         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
10752         nor in libpthread.
10753         * pt-open.c: Removed.
10754         * pt-fcntl.c: Removed.
10755         * pt-fsync.c: Removed.
10756         * pt-lseek.c: Removed.
10757         * pt-msgrcv.c: Removed.
10758         * pt-msgsnd.c: Removed.
10759         * pt-msync.c: Removed.
10760         * pt-nanosleep.c: Removed.
10761         * pt-open64.c: Removed.
10762         * pt-pause.c: Removed.
10763         * pt-pread.c: Removed.
10764         * pt-pread64.c: Removed.
10765         * pt-pwrite.c: Removed.
10766         * pt-pwrite64.c: Removed.
10767         * pt-read.c: Removed.
10768         * pt-recv.c: Removed.
10769         * pt-recvfrom.c: Removed.
10770         * pt-recvmsg.c: Removed.
10771         * pt-send.c: Removed.
10772         * pt-sendto.c: Removed.
10773         * pt-sigtimedwait.c: Removed.
10774         * pt-sigwait.c: Removed.
10775         * pt-wait.c: Removed.
10776         * pt-waitpid.c: Removed.
10777         * pt-write.c: Removed.
10778         * pt-accept.c: Removed.
10779         * pt-close.c: Removed.
10780         * pt-connect.c: Removed.
10781         * pt-lseek64.c: Removed.
10782         * pt-sendmsg.c: Removed.
10783         * pt-tcdrain.c: Removed.
10784
10785 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
10786
10787         * init.c (__pthread_initialize_minimal_internal): Renamed from
10788         __pthread_initialize_minimal.  Make old name an alias.  This
10789         converts a normal relocation into a relative relocation.
10790
10791         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
10792
10793         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
10794         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
10795         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
10796         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
10797         pt-sigwaitinfo, pt-waitid, and pt-writev.
10798         * pt-creat.c: Removed.
10799         * pt-poll.c: Removed.
10800         * pt-pselect.c: Removed.
10801         * pt-readv.c: Removed.
10802         * pt-select.c: Removed.
10803         * pt-sigpause.c: Removed.
10804         * pt-sigsuspend.c: Removed.
10805         * pt-sigwaitinfo.c: Removed.
10806         * pt-waitid.c: Removed.
10807         * pt-writev.c: Removed.
10808
10809         * init.c (pthread_functions): New variable.
10810         (__pthread_initialize_minimal): Pass pointer to pthread_functions
10811         (or NULL) to __libc_pthread_init.
10812         * forward.c: Rewrite to use __libc:pthread_functions array to get
10813         function addresses.
10814         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
10815         prototype.
10816         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10817         Take new parameter.  Copy content of variable pointed to by it
10818         to __libc_pthread_init.
10819
10820         * pthreadP.h (struct pthread_functions): New type.
10821         (__libc_pthread_init): Declare.
10822
10823         * pthread_attr_destroy.c: Add namespace protected alias.
10824         * pthread_attr_getdetachstate.c: Likewise.
10825         * pthread_attr_getinheritsched.c: Likewise.
10826         * pthread_attr_getschedparam.c: Likewise.
10827         * pthread_attr_getschedpolicy.c: Likewise.
10828         * pthread_attr_getscope.c: Likewise.
10829         * pthread_attr_setdetachstate.c: Likewise.
10830         * pthread_attr_setinheritsched.c: Likewise.
10831         * pthread_attr_setschedparam.c: Likewise.
10832         * pthread_attr_setschedpolicy.c: Likewise.
10833         * pthread_attr_setscope.c: Likewise.
10834         * pthread_cond_broadcast.c: Likewise.
10835         * pthread_cond_destroy.c: Likewise.
10836         * pthread_cond_init.c: Likewise.
10837         * pthread_cond_signal.c: Likewise.
10838         * pthread_cond_wait.c: Likewise.
10839         * pthread_condattr_destroy.c: Likewise.
10840         * pthread_condattr_init.c: Likewise.
10841         * pthread_equal.c: Likewise.
10842         * pthread_exit.c: Likewise.
10843         * pthread_getschedparam.c: Likewise.
10844         * pthread_self.c: Likewise.
10845         * pthread_setcancelstate.c: Likewise.
10846         * pthread_setschedparam.c: Likewise.
10847         * pthread_mutex_destroy.c: Likewise.
10848         * pthread_mutex_init.c: Likewise.
10849         * pthreadP.h: Add prototypes for the aliases.
10850
10851         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
10852         multiple_threads member in correct TCB to 1.
10853
10854         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
10855         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
10856         member of thread decriptor, otherwise return unconditionally 1.
10857
10858 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10859
10860         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
10861         regular Linux version.  Remove file.
10862         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
10863         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
10864         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
10865         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
10866         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
10867         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
10868         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
10869         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
10870         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
10871         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
10872         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
10873         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
10874         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
10875         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
10876         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
10877         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
10878         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
10879         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
10880         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
10881         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
10882         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
10883         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
10884         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
10885         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
10886         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
10887         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
10888         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
10889         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
10890         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
10891         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
10892
10893 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10894
10895         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
10896         * sysdeps/unix/sysv/linux/open.c: Removed.
10897         * sysdeps/unix/sysv/linux/fsync.c: Removed.
10898         * sysdeps/unix/sysv/linux/lseek.c: Removed.
10899         * sysdeps/unix/sysv/linux/msync.c: Removed.
10900         * sysdeps/unix/sysv/linux/read.c: Removed.
10901         * sysdeps/unix/sysv/linux/close.c: Removed.
10902         * sysdeps/unix/sysv/linux/creat.c: Removed.
10903         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
10904         * sysdeps/unix/sysv/linux/pause.c: Removed.
10905         * sysdeps/unix/sysv/linux/select.c: Removed.
10906         * sysdeps/unix/sysv/linux/write.c: Removed.
10907
10908 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10909
10910         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
10911         element in TCB to see whether locking is needed.
10912
10913         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
10914         MULTIPLE_THREADS_OFFSET value is correct.
10915
10916         * sysdeps/unix/sysv/linux/close.c: New file.
10917         * sysdeps/unix/sysv/linux/connect.S: New file.
10918         * sysdeps/unix/sysv/linux/creat.c: New file.
10919         * sysdeps/unix/sysv/linux/fsync.c: New file.
10920         * sysdeps/unix/sysv/linux/llseek.c: New file.
10921         * sysdeps/unix/sysv/linux/lseek.c: New file.
10922         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
10923         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
10924         * sysdeps/unix/sysv/linux/msync.c: New file.
10925         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
10926         * sysdeps/unix/sysv/linux/open.c: New file.
10927         * sysdeps/unix/sysv/linux/open64.c: New file.
10928         * sysdeps/unix/sysv/linux/pause.c: New file.
10929         * sysdeps/unix/sysv/linux/poll.c: New file.
10930         * sysdeps/unix/sysv/linux/pread.c: New file.
10931         * sysdeps/unix/sysv/linux/pread64.c: New file.
10932         * sysdeps/unix/sysv/linux/pselect.c: New file.
10933         * sysdeps/unix/sysv/linux/pwrite.c: New file.
10934         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
10935         * sysdeps/unix/sysv/linux/readv.c: New file.
10936         * sysdeps/unix/sysv/linux/recv.S: New file.
10937         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
10938         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
10939         * sysdeps/unix/sysv/linux/select.c: New file.
10940         * sysdeps/unix/sysv/linux/send.S: New file.
10941         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
10942         * sysdeps/unix/sysv/linux/sendto.S: New file.
10943         * sysdeps/unix/sysv/linux/sigpause.c: New file.
10944         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
10945         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
10946         * sysdeps/unix/sysv/linux/sigwait.c: New file.
10947         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
10948         * sysdeps/unix/sysv/linux/system.c: New file.
10949         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
10950         * sysdeps/unix/sysv/linux/wait.c: New file.
10951         * sysdeps/unix/sysv/linux/waitid.c: New file.
10952         * sysdeps/unix/sysv/linux/waitpid.c: New file.
10953         * sysdeps/unix/sysv/linux/writev.c: New file.
10954         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
10955
10956         * pt-readv.c: Fix comment.
10957
10958 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10959
10960         * tst-cleanup1.c: Include stdlib.h.
10961
10962         * tst-cancel5.c: New test.
10963         * Makefile (tests): Add tst-cancel5.
10964         (tst-cancel5): Link against libc.so libpthread.so in that order.
10965
10966 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
10967
10968         * forward.c (test_loaded): Prevent recursive calls.
10969
10970         * Makefile (routines): Add libc-cancellation.
10971         * libc-cancellation.c: New file.
10972         * descr.h (struct pthread): Add multiple_threads field.
10973         * allocatestack.c (allocate_stack): Initialize multiple_header field of
10974         new thread descriptor to 1.
10975         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
10976         Initialize multiple_thread field after successful thread creation.
10977         * cancellation.c (__do_cancel): Move to pthreadP.h.
10978         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
10979         (__pthread_disable_asynccancel): Add internal_function attribute.
10980         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
10981         * pthread_setcancelstate.c: Likewise.
10982         * pthread_setcanceltype.c: Likewise.
10983         * pthread_exit.c: Likewise.
10984         * pthreadP.h (CANCELLATION_P): Likewise.
10985         (__do_cancel): Define as static inline.
10986         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
10987         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
10988         declarations.
10989         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
10990         fields.  Define MULTIPLE_THREADS_OFFSET.
10991         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
10992         declaration.
10993         * sysdeps/unix/sysv/linux/accept.S: New file.
10994         * sysdeps/unix/sysv/linux/read.c: New file.
10995         * sysdeps/unix/sysv/linux/write.c: New file.
10996         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
10997         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
10998         initialization of __libc_locking_needed.
10999         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
11000         __libc_locking_needed, use multiple_threads field in TCB.
11001         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
11002
11003 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
11004
11005         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
11006         version.
11007         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
11008
11009         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
11010         access to __libc_locking_needed for PIC.
11011
11012 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
11013
11014         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
11015         declare for libc.so.
11016         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
11017         expression.
11018         (__libc_lock_lock): Put into statement expression.
11019         (__libc_lock_unlock): Remove trailing semicolon.
11020         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
11021
11022 2002-12-12  Roland McGrath  <roland@redhat.com>
11023
11024         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
11025         "m" constraint to refer to __libc_locking_needed.  Declare it here.
11026
11027 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
11028
11029         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
11030         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
11031         Initialize __libc_locking_needed.
11032         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
11033         instead of __register_pthread_fork_handler.
11034         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
11035         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
11036         fork-gen with libc_pthread_init.
11037         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
11038         of __register_pthread_fork_handler.
11039         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
11040         of __register_pthread_fork_handler.
11041         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
11042         __libc_locking_needed to determine whether lock prefix can be avoided.
11043         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
11044
11045 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
11046
11047         * Makefile (tests): Add tst-cleanup1.
11048         * tst-cleanup1.c: New file.
11049         * cancellation.c (__cleanup_thread): Removed.
11050         (__do_cancel): Remove call to __cleanup_thread.
11051         * pthreadP.h: Remove __cleanup_thread prorotype.
11052
11053         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
11054         Remember function and argument even if cancellation handler
11055         function is not available.
11056         (__libc_cleanup_region_end): Execute registered function directly if
11057         pthread functions are not available.
11058         (__libc_cleanup_end): Likewise.
11059
11060         * init.c (__pthread_initialize_minimal): Fix initialization in
11061         static lib by preventing gcc from being too clever.
11062
11063 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
11064
11065         * init.c (__pthread_initialize_minimal): Remove unneccesary
11066         sigaddset call.
11067
11068         * Makefile (tests): We can run tst-locale2 now.
11069
11070 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
11071
11072         * Versions: Remove duplicated sigwait entry.
11073
11074 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
11075
11076         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
11077         inside libpthread.
11078
11079         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
11080
11081         * pthreadP.h: Declare __pthread_enable_asynccancel and
11082         __pthread_disable_asynccancel.
11083         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
11084         (CANCEL_RESET): Use __pthread_disable_asynccancel.
11085         * cancellation.c (__pthread_enable_asynccancel): New function.
11086         (__pthread_disable_asynccancel): New function.
11087         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
11088         * pt-close.c: Likewise.
11089         * pt-connect.c: Likewise.
11090         * pt-creat.c: Likewise.
11091         * pt-fcntl.c: Likewise.
11092         * pt-fsync.c: Likewise.
11093         * pt-lseek.c: Likewise.
11094         * pt-lseek64.c: Likewise.
11095         * pt-msgrcv.c: Likewise.
11096         * pt-msgsnd.c: Likewise.
11097         * pt-msync.c: Likewise.
11098         * pt-nanosleep.c: Likewise.
11099         * pt-open.c: Likewise.
11100         * pt-open64.c: Likewise.
11101         * pt-pause.c: Likewise.
11102         * pt-poll.c: Likewise.
11103         * pt-pread.c: Likewise.
11104         * pt-pread64.c: Likewise.
11105         * pt-pselect.c: Likewise.
11106         * pt-pwrite.c: Likewise.
11107         * pt-pwrite64.c: Likewise.
11108         * pt-read.c: Likewise.
11109         * pt-readv.c: Likewise.
11110         * pt-recv.c: Likewise.
11111         * pt-recvfrom.c: Likewise.
11112         * pt-recvmsg.c: Likewise.
11113         * pt-select.c: Likewise.
11114         * pt-send.c: Likewise.
11115         * pt-sendmsg.c: Likewise.
11116         * pt-sendto.c: Likewise.
11117         * pt-sigpause.c: Likewise.
11118         * pt-sigsuspend.c: Likewise.
11119         * pt-sigtimedwait.c: Likewise.
11120         * pt-sigwait.c: Likewise.
11121         * pt-sigwaitinfo.c: Likewise.
11122         * pt-system.c: Likewise.
11123         * pt-tcdrain.c: Likewise.
11124         * pt-wait.c: Likewise.
11125         * pt-waitid.c: Likewise.
11126         * pt-waitpid.c: Likewise.
11127         * pt-write.c: Likewise.
11128         * pt-writev.c: Likewise.
11129         * pthread_join.c: Likewise.
11130         * pthread_timedjoin.c: Likewise.
11131
11132         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
11133         (__xpg_sigpause): New function.
11134         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
11135
11136 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
11137
11138         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
11139
11140         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
11141         _GI_pthread_cleanup_pop to pthreadP.h.
11142
11143         * ftrylockfile.c: Use _IO_lock_trylock instead of
11144         pthread_mutex_trylock.
11145
11146         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
11147         (CANCEL_RESET): Likewise.
11148         (__pthread_setcanceltype_): Declare.
11149         (__pthread_mutex_lock_internal): Declare.
11150         (__pthread_mutex_unlock_internal): Declare.
11151         (__pthread_once_internal): Declare.
11152         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
11153         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
11154
11155         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
11156         and pthread_mutex_unlock.
11157         * pthread_cond_wait.c: Likewise.
11158         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
11159         * pthread_mutex_unlock.c: Likewise.
11160
11161         * pthread_setcanceltype.c: Add additional alias
11162         __pthread_setcanceltype.
11163
11164         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
11165         * sem_open.c (sem_open): Likewise.
11166         Use __libc_open, __libc_write, and __libc_close instead of
11167         open, write, and close respectively.
11168
11169         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
11170         Rewrite as statement expression since it must return a value.
11171
11172         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
11173         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
11174         __pthread_kill.
11175
11176         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
11177         alias __pthread_once_internal.
11178
11179         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
11180
11181 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
11182
11183         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
11184         * tst-stdio1.c: New file.
11185         * tst-stdio2.c: New file.
11186
11187         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
11188
11189         * Makefile (tests): Comment out tst-locale2 for now.
11190         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
11191
11192         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
11193         -D_IO_MTSAFE_IO.
11194         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
11195         Use _IO_lock_init instead of explicit assignment.
11196
11197         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
11198         Define __libc_lock_* and __libc_lock_recursive macros with
11199         lowlevellock macros, not pthread mutexes.
11200
11201         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
11202         of pthread_mutex_lock.
11203         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
11204         instead of pthread_mutex_unlock.
11205
11206 2002-12-06  Roland McGrath  <roland@redhat.com>
11207
11208         * allocatestack.c (__stack_user): Use uninitialized defn.
11209         * init.c (__pthread_initialize_minimal): Initialize it here.
11210
11211 2002-12-05  Roland McGrath  <roland@redhat.com>
11212
11213         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
11214         string.
11215         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
11216
11217         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
11218         missing & here too.
11219
11220 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
11221
11222         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
11223         lowlevellock.
11224         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
11225         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
11226         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
11227         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
11228         for __libc_lock_* macros.
11229         * Makefile (routines): Add libc-lowlevellock.
11230
11231 2002-10-09  Roland McGrath  <roland@redhat.com>
11232
11233         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
11234         Under [__PIC__], call the function via the pointer fetched for
11235         comparison rather than a call by name that uses the PLT.
11236         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
11237         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
11238         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
11239         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
11240         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
11241
11242 2002-12-04  Roland McGrath  <roland@redhat.com>
11243
11244         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
11245
11246         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
11247         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
11248
11249         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
11250
11251 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
11252
11253         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
11254         a completely opaque, non-integer type.
11255         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
11256
11257 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
11258
11259         * sysdeps/i386/tls.h: Include stdlib.h.
11260         * sysdeps/x86_64/tls.h: Likewise.
11261
11262 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
11263
11264         * Makefile (tests): Add tst-locale2.
11265         (tests-static): Likewise.
11266         * tst-locale2.c: New file.
11267
11268         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
11269         volatile and add memory clobbers to lock operations.
11270
11271 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
11272
11273         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
11274         * sysdeps/i386/i486/bits/atomic.h: New file.
11275         * sysdeps/i386/i586/bits/atomic.h: New file.
11276         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
11277         include i486 version.
11278         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
11279         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
11280         Patch by Marijn Ros <marijn@mad.scientist.com>.
11281
11282         * allocatestack.c (get_cached_stack): Don't crash if we first
11283         found a stack with a larger size then needed.
11284         Reported by Hui Huang <hui.huang@sun.com>.
11285
11286         * Makefile (tests): Add tst-sysconf.
11287         * tst-sysconf.c: New file.
11288
11289         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
11290         PTHREAD_THREADS_MAX.
11291
11292 2002-12-02  Roland McGrath  <roland@redhat.com>
11293
11294         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
11295         Declare using hidden_proto instead of attribute_hidden, so there are
11296         non-.hidden static symbols for gdb to find.
11297         (__pthread_keys): Likewise.
11298         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
11299         * allocatestack.c (__stack_user): Likewise.
11300         * pthread_create.c (__pthread_keys): Likewise.
11301         (__nptl_threads_events, __nptl_last_event): Make these static instead
11302         of hidden.
11303         * pthread_key_create.c (__pthread_pthread_keys_max,
11304         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
11305
11306 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
11307
11308         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
11309         statically.
11310         * tst-locale1.c: New file.
11311
11312         * pthread_cond_timedwait.c: Include <stdlib.h>.
11313
11314         * Makefile (tests): Add tst-fork2 and tst-fork3.
11315         * tst-fork2.c: New file.
11316         * tst-fork3.c: New file.
11317
11318 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
11319
11320         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
11321
11322         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
11323         require it to 200112L.
11324
11325         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
11326         instruction only if HAVE_CMOV is defined.
11327         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
11328
11329         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
11330
11331         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
11332
11333         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
11334
11335         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
11336
11337 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
11338
11339         * sysdeps/x86_64/bits/atomic.h: New file.
11340
11341         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
11342         16-bit operations.
11343
11344         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
11345         possible since gettid cannot fail.
11346
11347         * sysdeps/x86_64/pthreaddef.h: New file.
11348
11349         * sysdeps/i386/pthreaddef.h (gettid): Removed.
11350
11351         * sysdeps/x86_64/pthread_spin_init.c: New file.
11352         * sysdeps/x86_64/pthread_spin_lock.c: New file.
11353         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
11354         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
11355
11356         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
11357         Add missing lock prefix.  Minute optimization.
11358
11359         * tst-spin2.c (main): Also check successful trylock call.
11360
11361         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
11362         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
11363
11364         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
11365         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
11366
11367         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
11368         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
11369         value in case of an error.  Add support for INTERNAL_SYSCALL.
11370
11371         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
11372         value in case of an error.
11373
11374         * sysdeps/x86_64/tls.h: New file.
11375
11376 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
11377
11378         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
11379         takes the array member name and the index as parameters.
11380         (THREAD_SETMEM_NC): Likewise.
11381         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
11382         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
11383         interfaces.
11384
11385         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
11386         to decide which code to use.
11387         (THREAD_SETMEM_NC): Likewise.
11388
11389         * allocatestack.c (queue_stack): Don't remove stack from list here.
11390         Do it in the caller.  Correct condition to prematurely terminate
11391         loop to free stacks.
11392         (__deallocate_stack): Remove stack from list here.
11393
11394 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
11395
11396         * Makefile (tests): Add tst-stack1.
11397         * tst-stack1.c: New file.
11398
11399         * allocatestack.c (allocate_stack): Initialize the TCB on a user
11400         provided stack.
11401
11402         * pthread_attr_getstack.c: Return bottom of the thread area.
11403
11404 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
11405
11406         * Makefile (libpthread-routines): Add pt-allocrtsig and
11407         pthread_kill_other_threads.
11408         * pt-allocrtsig.c: New file.
11409         * pthread_kill_other_threads.c: New file.
11410         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
11411         all three functions.
11412         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
11413         allocrtsig.
11414         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
11415         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
11416         and __libc_allocate_rtsig_private.
11417         * Versions (libpthread): Export pthread_kill_other_threads_np,
11418         __libc_current_sigrtmin, and __libc_current_sigrtmax.
11419
11420 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
11421
11422         * allocatestack.c (allocate_stack): stackaddr in attribute points to
11423         the end of the stack.  Adjust computations.
11424         When mprotect call fails dequeue stack and free it.
11425         * pthread_attr_setstack.c: Store top of the stack in stackaddr
11426         attribute.
11427         * pthread_getattr_np.c: Likewise.
11428
11429         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
11430         surprises.
11431
11432 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
11433
11434         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
11435         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11436
11437 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
11438
11439         * pthread_getspecific.c: Optimize access to first 2nd-level array.
11440         * pthread_setspecific.c: Likewise.
11441
11442 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
11443
11444         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
11445         definitions.  Get them from the official place.
11446         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
11447
11448         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
11449         Use new CLONE_ flags in clone() calls.
11450
11451         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
11452         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
11453
11454         * Versions: Add pthread_* functions for libc.
11455         * forward.c: New file.
11456
11457         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
11458         errno-loc.
11459         * herrno.c: New file.
11460         * res.c: New file.
11461
11462         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
11463         sem_trywait, and sem_timedwait.  Add herrno and res.
11464         * sem_init.c: Don't initialize lock and waiters members.
11465         * sem_open.c: Likewise.
11466         * sem_post.c: Removed.
11467         * sem_wait.c: Removed.
11468         * sem_trywait.c: Removed.
11469         * sem_timedwait.c: Removed.
11470         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
11471         Includes full implementations of sem_post, sem_wait, sem_trywait,
11472         and sem_timedwait.
11473         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
11474         for new implementation.
11475         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
11476         and waiters fields.
11477
11478         * tst-sem3.c: Improve error message.
11479         * tst-signal3.c: Likewise.
11480
11481         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
11482         to tell the kernel about the termination futex and to initialize tid
11483         member.  Don't initialize main_thread.
11484         * descr.h (struct pthread): Remove main_thread member.
11485         * cancelllation.c (__do_cancel): Remove code handling main thread.
11486         The main thread is not special anymore.
11487
11488         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
11489         size of the stacks to stack_cache_actsize.
11490
11491         * pt-readv.c: Add missing "defined".
11492         * pt-sigwait.c: Likewise.
11493         * pt-writev.c: Likewise.
11494
11495 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
11496
11497         * Versions: Export __connect from libpthread.
11498         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11499
11500         * Makefile (libpthread-routines): Add pt-raise.
11501         * sysdeps/unix/sysv/linux/raise.c: New file.
11502         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
11503         * sysdeps/generic/pt-raise.c: New file.
11504
11505         * pthread_cond_init.c: Initialize all data elements of the condvar
11506         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11507
11508         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
11509         * pthread_create.c: Likewise.
11510
11511         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
11512         * tst-key1.c: New file.
11513         * tst-key2.c: New file.
11514         * tst-key3.c: New file.
11515
11516         * Versions: Export pthread_detach for version GLIBC_2.0.
11517         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
11518
11519 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
11520
11521         * pthread_key_create.c: Terminate search after an unused key was found.
11522         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11523
11524         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
11525         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11526
11527 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
11528
11529         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
11530         dynamic lookup for errno in PIC.
11531
11532         * allocatestack.c (get_cached_stack): Rearrange code slightly to
11533         release the stack lock as soon as possible.
11534         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
11535         the static TLS block.
11536         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
11537
11538         * cancellation.c: Renamed from cancelation.c.
11539         * Makefile: Adjust accordingly.
11540         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
11541         * cleanup_defer.c: Use CANCELLATION_P.
11542         * pthread_testcancel.c: Likewise.
11543         * descr.h: Fix spelling in comments.
11544         * init.c: Likewise.
11545         * pthread_getattr_np.c: Likewise.
11546         * pthread_getschedparam.c: Likewise.
11547         * pthread_setschedparam.c: Likewise.
11548         * Versions: Likewise.
11549
11550         * pt-pselect.c: New file.
11551         * Makefile (libpthread-routines): Add pt-pselect.
11552         * Versions: Add pselect.
11553
11554         * tst-cancel4.c: New file.
11555         * Makefile (tests): Add tst-cancel4.
11556
11557 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
11558
11559         * pthread_mutex_lock.c: Always record lock ownership.
11560         * pthread_mutex_timedlock.c: Likewise.
11561         * pthread_mutex_trylock.c: Likewise.
11562
11563         * pt-readv.c: New file.
11564         * pt-writev.c: New file.
11565         * pt-creat.c: New file.
11566         * pt-msgrcv.c: New file.
11567         * pt-msgsnd.c: New file.
11568         * pt-poll.c: New file.
11569         * pt-select.c: New file.
11570         * pt-sigpause.c: New file.
11571         * pt-sigsuspend.c: New file.
11572         * pt-sigwait.c: New file.
11573         * pt-sigwaitinfo.c: New file.
11574         * pt-waitid.c: New file.
11575         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
11576         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
11577         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
11578         * Versions: Add all the new functions.
11579
11580         * tst-exit1.c: New file.
11581         * Makefile (tests): Add tst-exit1.
11582
11583         * sem_timedwait.c: Minor optimization for more optimal fastpath.
11584
11585 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
11586
11587         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
11588
11589         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
11590         call.  pthread_join is an official cancellation point.
11591         * pthread_timedjoin.c: Likewise.
11592
11593         * pthread_cond_wait.c: Revert order in which internal lock are dropped
11594         and the condvar's mutex are retrieved.
11595         * pthread_cond_timedwait.c: Likewise.
11596         Reported by dice@saros.East.Sun.COM.
11597
11598 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
11599
11600         * pthreadP.h: Cut out all type definitions and move them...
11601         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
11602         * pthreadP.h: Include <internaltypes.h>.
11603
11604         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
11605         performance tweaks.
11606
11607         * sem_trywait.c: Shuffle #includes around to get right order.
11608         * sem_timedwait.c: Likewise.
11609         * sem_post.c: Likewise.
11610         * sem_wait.c: Likewise.
11611
11612         * nptl 0.3 released.
11613
11614         * Makefile (tests): Add tst-signal3.
11615         * tst-signal3.c: New file.
11616
11617 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
11618
11619         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
11620         the asms modify the sem object.
11621         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
11622
11623         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
11624         the actual members.
11625         * pthreadP.h (struct sem): New type.  Actual semaphore type.
11626         * semaphoreP.h: Include pthreadP.h.
11627         * sem_getvalue.c: Adjust to sem_t change.
11628         * sem_init.c: Likewise.
11629         * sem_open.c: Likewise.
11630         * sem_post.c: Likewise.
11631         * sem_timedwait.c: Likewise.
11632         * sem_trywait.c: Likewise.
11633         * sem_wait.c: Likewise.
11634
11635 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
11636
11637         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
11638         * tst-basic2.c: New file.
11639         * tst-exec1.c: New file.
11640         * tst-exec2.c: New file.
11641         * tst-exec3.c: New file.
11642
11643         * tst-fork1.c: Remove extra */.
11644
11645         * nptl 0.2 released.  The API for IA-32 is complete.