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