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