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