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