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