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