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