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