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