908d39383eaa941661fdc9c3639abcc67a8c1ef7
[kopensolaris-gnu/glibc.git] / nptl / ChangeLog
1 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
2
3         * sysdeps/pthread/timer_create.c (timer_create): Use
4         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
5         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
6         THREAD_CPUTIME.
7
8 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
9
10         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
11         and _POSIX_THREAD_CPUTIME to zero.
12         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
13         * tst-barrier2.c: Fix testing for POSIX feature.
14         * tst-clock1.c: Likewise.
15         * tst-clock2.c: Likewise.
16         * tst-cond11.c: Likewise.
17         * tst-cond4.c: Likewise.
18         * tst-cond6.c: Likewise.
19         * tst-flock2.c: Likewise.
20         * tst-mutex4.c: Likewise.
21         * tst-mutex9.c: Likewise.
22         * tst-rwlock12.c: Likewise.
23         * tst-rwlock4.c: Likewise.
24         * tst-signal1.c: Likewise.
25         * tst-spin2.c: Likewise.
26         * sysdeps/pthread/posix-timer.h: Likewise.
27         * sysdeps/pthread/timer_create.c: Likewise.
28         * sysdeps/pthread/timer_routines.c: Likewise.
29
30 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
31
32         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
33         (__lll_mutex_timedlock_wait): Address futex correctly.
34
35         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
36         (__lll_mutex_timedlock_wait): I woken but cannot get the lock,
37         make sure 2 is stored in the futex and we looked at the old value.
38         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
39         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
40         which might very well made the code not working at all before.
41         [BZ #417]
42
43 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
44
45         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
46         allow SIGSETXID to be sent.
47         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
48         for SIGSETXID to be defined.
49         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
50         SIGSETXID cannot be blocked.
51
52         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
53         Add __extension__ to long long types.
54         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
55         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
56         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
57         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
58         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
59         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
60         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
61
62 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
63
64         * descr.h (struct pthread): Add stopped_start field.
65         * sysdeps/pthread/createthread.c (create_thread): Set
66         start_stopped flag in descriptor for new thread appropriately.
67         * pthread_create.c (start_thread): Only take lock to be stopped on
68         startup if stopped_start flag says so.
69
70 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
71
72         * pthread_create.c (__pthread_create_2_1): Remember whether thread
73         is created detached and if yes, do not try to free the stack in case
74         the thread creation failed.
75         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
76         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
77         case there has been no error.  [BZ #405]
78
79         * pthread_create.c (start_thread): Don't wait for scheduler data
80         etc to be set at the beginning of the function.  The cancellation
81         infrastructure must have been set up.  And enable async
82         cancellation before potentially going to sleep.  [BZ #401]
83
84 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
85
86         * Versions: Remove exports for pthread_set*id_np functions.
87         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
88         for now.
89         * Makefile: Don't build pthread_set*id code for now.
90
91 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
92
93         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
94         internal use.
95         * allocatestack.c (__nptl_setxid): New function.
96         * descr.h (struct xid_command): Define type.
97         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
98         (sighandler_setxid): New function.
99         (__pthread_initialize_minimal): Register sighandler_setxid for
100         SIGCANCEL.
101         * pt-allocrtsig.c: Update comment.
102         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
103         Declare __nptl_setxid.
104         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
105         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
106         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
107         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
108         and pthread_setresuid_np.
109         * pthread_setgid_np.c: New file.
110         * pthread_setuid_np.c: New file.
111         * pthread_setegid_np.c: New file.
112         * pthread_seteuid_np.c: New file.
113         * pthread_setregid_np.c: New file.
114         * pthread_setreuid_np.c: New file.
115         * pthread_setresgid_np.c: New file.
116         * pthread_setresuid_np.c: New file.
117         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
118         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
119         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
120         and pthread_setresuid_np.
121         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
122         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
123         pthread_setregid, and pthread_setresgid.
124
125 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
126
127         * allocatestack.c (allocate_stack): Return EAGAIN instead of
128         ENOMEM when out of memory.
129
130 2004-09-10  Roland McGrath  <roland@redhat.com>
131
132         [BZ #379]
133         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
134         code, since we don't try to use the broken CLONE_STOPPED any more.
135         * pthread_create.c (start_thread): Likewise.
136
137 2004-09-15  Richard Henderson  <rth@redhat.com>
138
139         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
140
141 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
142
143         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
144         (__libc_unwind_longjmp): Delete macro and declare as function.
145         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
146         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
147         nptl directory.
148         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
149         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
150         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
151
152 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
153
154         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
155         for __USE_XOPEN2K.
156         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
157         types also for __USE_XOPEN2K.
158         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
159         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
160         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
161         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
162         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
163         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
164         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
165         [BZ #320]
166
167 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
168
169         * sysdeps/pthread/pthread.h
170         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
171         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
172         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
173         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
174         [BZ #375]
175
176 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
177
178         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
179         PSEUDO to be used with . prefix.
180
181         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
182         Use atomic_increment instead of atomic_exchange_and_add.
183         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
184         Likewise.
185         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
186         Likewise.
187         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
188         Likewise.
189
190         * allocatestack.c (allocate_stack): Use atomic_increment_val
191         instead of atomic_exchange_and_add.
192         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
193         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
194         Likewise.
195         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
196         Likewise.
197
198         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
199         the initialization function might throw.
200
201 2005-09-05  Richard Henderson  <rth@redhat.com>
202
203         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
204         Move definition inside libpthread, libc, librt check.  Provide
205         definition for rtld.
206
207 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
208
209         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
210         waiters, awake all waiters on the associated mutex.
211
212 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
213
214         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
215         * sysdeps/i386/jmpbuf-unwind.h: Likewise
216         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
217         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
218         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
219         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
220         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
221         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
222         * unwind.c: Use it.
223
224         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
225         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
226         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
227         Likewise.
228         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
229         Decrement __nwaiters.  If pthread_cond_destroy has been called and
230         this is the last waiter, signal pthread_cond_destroy caller and
231         avoid using the pthread_cond_t structure after unlock.
232         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
233         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
234         Read clock type from the least significant bits of __nwaiters instead
235         of __clock.
236         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
237         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
238
239 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
240
241         [BZ #342]
242         * Makefile (tests): Add tst-cond20 and tst-cond21.
243         * tst-cond20.c: New test.
244         * tst-cond21.c: New test.
245         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
246         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
247         it unsigned int.
248         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
249         Likewise.
250         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
251         (pthread_cond_t): Likewise.
252         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
253         Likewise.
254         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
255         Likewise.
256         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
257         Likewise.
258         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
259         (cond_nwaiters): New.
260         (clock_bits): New.
261         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
262         if there are waiters not signalled yet.
263         Wait until all already signalled waiters wake up.
264         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
265         __nwaiters.  If pthread_cond_destroy has been called and this is the
266         last waiter, signal pthread_cond_destroy caller and avoid using
267         the pthread_cond_t structure after unlock.
268         (__pthread_cond_wait): Increment __nwaiters in the beginning,
269         decrement it when leaving.  If pthread_cond_destroy has been called
270         and this is the last waiter, signal pthread_cond_destroy caller.
271         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
272         Likewise.  Read clock type from the least significant bits of
273         __nwaiters instead of __clock.
274         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
275         whether clock ID can be encoded in COND_CLOCK_BITS bits.
276         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
277         clock type just from the last COND_CLOCK_BITS bits of value.
278         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
279         instead of __clock, just from second bit of condattr's value.
280
281 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
282
283         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
284         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
285         != 64.
286         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
287
288 2004-08-15  Roland McGrath  <roland@frob.com>
289
290         * pthread_atfork.c: Update copyright terms including special exception
291         for these trivial files, which are statically linked into executables
292         that use dynamic linking for the significant library code.
293
294 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
295
296         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
297         pthread_rwlock_rdlock.
298         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
299         Decrease __nr_readers_queued after reacquiring lock.
300         * sysdeps/pthread/pthread_rwlock_timedrdlock
301         (pthread_rwlock_timedrdlock): Likewise.
302         Reported by Bob Cook <bobcook47@hotmail.com>.
303
304 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
305
306         * tst-rwlock14.c (tf): Read main thread handle from *ARG
307         before pthread_barrier_wait.
308
309 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
310
311         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
312         Remove unnecessary exception handling data.
313
314 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
315
316         [BZ #284]
317         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
318         instead of clockid_t.
319
320 2004-07-21  Roland McGrath  <roland@redhat.com>
321
322         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
323
324 2004-07-19  Roland McGrath  <roland@redhat.com>
325
326         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
327
328 2004-07-02  Roland McGrath  <roland@redhat.com>
329
330         * configure: Don't exit.
331
332 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
333
334         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
335         (__pthread_cond_timedwait): Check for invalid nanosecond in
336         timeout value.
337
338 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
339
340         * Makefile: Add rules to build and run tst-fini1.
341         * tst-fini1.c: New file.
342         * tst-fini1mod.c: New file.
343
344 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
345
346         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
347         if no cancellation support is needed.
348         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
349         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
350         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
351         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
352         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
353         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
354         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
355         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
356         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
357
358         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
359         only if not already defined.
360
361 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
362
363         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
364         constraint "m" instead of "0" for futex.
365
366         * shlib-versions: Add powerpc64-.*-linux.*.
367
368 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
369
370         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
371         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
372         for valid tv_nsec.
373         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
374         1 billion and 64-bit tv_nsec which is valid when truncated to 32
375         bits.
376
377 2004-06-29  Roland McGrath  <roland@redhat.com>
378
379         * Banner: NPTL no longer has its own version number.
380         * Makefile (nptl-version): Variable removed.
381         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
382         using $(version), the glibc version number.
383
384 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
385
386         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
387         Fix branch offset for a PLT entry.
388         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
389         Likewise.
390         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
391         Likewise.
392         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
393         Likewise.
394         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
395         Likewise.
396
397 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
398
399         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
400         unconditionally.
401
402 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
403
404         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
405         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
406         instead of tv_sec.
407         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
408         (pthread_rwlock_timedrdlock): Likewise.
409
410 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
411
412         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
413         Set __r7 to val, not mutex.
414
415 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
416
417         * Makefile: Add rules to build tst-rwlock14.
418         * tst-rwlock14.c: New file.
419
420 2004-06-24  Boris Hu  <boris.hu@intel.com>
421
422         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
423         check.
424         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
425
426 2004-06-19  Andreas Jaeger  <aj@suse.de>
427
428         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
429         assembler in last patch.
430
431 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
432
433         * sysdeps/pthread/pthread_cond_timedwait.c
434         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
435         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
436         (__pthread_cond_timedwait): Check for invalid nanosecond in
437         timeout value.
438         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
439         * tst-cond19.c: New file.
440         * Makefile: Add rules to build and run tst-cond19.
441
442 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
443
444         * tst-context1.c (GUARD_PATTERN): Defined.
445         (tst_context_t): Define struct containing ucontext_t & guard words.
446         (ctx): Declare as an array of tst_context_t.
447         (fct): Verify uc_link & guard words are still valid.
448         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
449
450 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
451
452         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
453         Add __data.__futex field, reshuffle __data.__clock.
454         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
455         (__pthread_cond_signal): Increment __futex at the same time as
456         __wakeup_seq or __total_seq.  Pass address of __futex instead of
457         address of low 32-bits of __wakeup_seq to futex syscall.
458         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
459         (__pthread_cond_wait): Likewise.  Pass __futex value from before
460         releasing internal lock to FUTEX_WAIT.
461         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
462         (__pthread_cond_timedwait): Likewise.
463         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
464         (FUTEX_CMP_REQUEUE): Define.
465         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
466         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
467         Pass __futex value from before the unlock and __futex address instead
468         of address of low 32-bits of __wakeup_seq to futex syscall.
469         Fallback to FUTEX_WAKE all on any errors.
470
471 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
472
473         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
474         comment typo.
475         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
476         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
477         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
478         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
479         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
480
481 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
482
483         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
484         Add memory clobber to inline assembly.
485         (__lll_mutex_trylock): Likewise.
486         (__lll_mutex_cond_trylock): Likewise.
487
488 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
489
490         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
491         Pass val argument as 6th system call argument in %r7.
492
493 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
494
495         * Makefile (tests): Add tst-cond16.
496         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
497         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
498         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
499         Add __data.__futex field, reshuffle __data.__clock.
500         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
501         (__pthread_cond_signal): Increment __futex at the same time as
502         __wakeup_seq or __total_seq.  Pass address of __futex instead of
503         address of low 32-bits of __wakeup_seq to futex syscall.
504         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
505         (__pthread_cond_wait): Likewise.  Pass __futex value from before
506         releasing internal lock to FUTEX_WAIT.
507         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
508         (__pthread_cond_timedwait): Likewise.
509         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
510         (FUTEX_CMP_REQUEUE): Define.
511         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
512         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
513         Pass __futex value from before the unlock and __futex address instead
514         of address of low 32-bits of __wakeup_seq to futex syscall.
515         Fallback to FUTEX_WAKE all on any errors.
516         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
517         Define.
518         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
519         internally.  Return non-zero if error, zero if success.
520         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
521         Add __data.__futex field, reshuffle __data.__clock.
522         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
523         Define.
524         (lll_futex_requeue): Add val argument, return 1 unconditionally
525         for the time being.
526         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
527         Add __data.__futex field, reshuffle __data.__clock.
528         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
529         Define.
530         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
531         internally.  Return non-zero if error, zero if success.
532         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
533         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
534         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
535         Define.
536         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
537         internally.  Return non-zero if error, zero if success.
538         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
539         Add __data.__futex field, reshuffle __data.__clock.
540         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
541         Define.
542         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
543         internally.  Return non-zero if error, zero if success.
544         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
545         Add __data.__futex field, reshuffle __data.__clock.
546         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
547         Add __data.__futex field, reshuffle __data.__clock.
548         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
549         Increment __futex at the same time as __wakeup_seq or __total_seq.
550         Pass address of __futex instead of address of low 32-bits of
551         __wakeup_seq to futex syscall.
552         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
553         Pass __futex value from before releasing internal lock
554         to FUTEX_WAIT.
555         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
556         Likewise.  Avoid unnecessary shadowing of variables.
557         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
558         Set __futex to 2 * __total_seq.  Pass __futex value from before the
559         unlock and __futex address instead of address of low 32-bits of
560         __wakeup_seq to futex_requeue macro, adjust for new return value
561         meaning.
562         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
563         (__pthread_cond_signal): Increment __futex at the same time as
564         __wakeup_seq or __total_seq.  Pass address of __futex instead of
565         address of low 32-bits of __wakeup_seq to futex syscall.
566         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
567         (__pthread_cond_wait): Likewise.  Pass __futex value from before
568         releasing internal lock to FUTEX_WAIT.
569         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
570         (__pthread_cond_timedwait): Likewise.
571         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
572         (FUTEX_CMP_REQUEUE): Define.
573         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
574         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
575         Pass __futex value from before the unlock and __futex address instead
576         of address of low 32-bits of __wakeup_seq to futex syscall.
577         Fallback to FUTEX_WAKE all on any errors.
578
579 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
580
581         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
582         Add nop to align the end of critical section.
583         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
584
585 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
586
587         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
588         Add __broadcast_seq field.
589         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
590         all waiters as woken with woken_seq and bump broadcast counter.
591         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
592         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
593         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
594         Comment typo fixes.  Avoid returning -ETIMEDOUT.
595
596 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
597
598         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
599         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
600         Reported by Kaz Kojima.
601
602 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
603
604         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
605
606 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
607
608         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
609         __broadcast_seq with bc_seq after acquiring internal lock instead of
610         before it.
611
612 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
613
614         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
615         compilation.
616         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
617         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
618         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
619         (pthread_cond_t): Add __data.__broadcast_seq field.
620         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
621         (FRAME_SIZE): Define.
622         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
623         Comment typo fixes.
624         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
625         Define.
626         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
627         typo fixes.
628         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
629         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
630         fixes.
631
632 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
633
634         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
635         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
636         Add __broadcast_seq field.
637         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
638         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
639         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
640         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
641         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
642         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
643         all waiters as woken with woken_seq and bump broadcast counter.
644         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
645         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
646         __broadcast_seq field.
647         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
648         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
649         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
650         * pthread_cond_init.c: Initialize __broadcast_seq field.
651         * Makefile (tests): Add tst-cond17 and tst-cond18.
652         Add .NOTPARALLEL goal.
653         * tst-cond16.c: New file.  From Jakub.
654         * tst-cond17.c: New file.  From Jakub.
655         * tst-cond18.c: New file.  From Jakub.
656
657 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
658
659         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
660         unwind info.
661
662         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
663         Parametrize frame size.  Correct some unwind info.
664         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
665
666 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
667
668         * tst-stack3.c: Note testing functionality beyond POSIX.
669
670 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
671
672         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
673         Change conditional from ifdef to if.
674
675 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
676
677         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
678         SYSDEP_CANCEL_ERROR): Define.
679         (PSEUDO): Use it.
680
681 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
682
683         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
684
685 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
686
687         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
688
689 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
690
691         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
692         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
693         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
694         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
695
696 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
697
698         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
699         thread has all signals blocked.
700
701 2004-04-18  Andreas Jaeger  <aj@suse.de>
702
703         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
704         (SEM_VALUE_MAX): Add missing brace.
705
706 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
707
708         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
709         in rt subdir.
710         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
711         * sysdeps/pthread/tst-mqueue8x.c: New test.
712         * tst-cancel4.c: Update comment about message queues.
713
714         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
715         return it_value { 0, 0 }.
716         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
717         like SIGEV_SIGNAL.
718         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
719         assertion for SIGEV_NONE.
720         (thread_attr_compare): Compare all attributes, not just a partial
721         subset.
722
723 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
724
725         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
726
727 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
728
729         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
730         Just use a plain number.
731         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
732         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
733         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
734         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
735         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
736         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
737         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
738
739 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
740
741         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
742         frame info.
743         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
744
745 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
746
747         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
748         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
749         of calling sigwaitinfo.
750
751 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
752
753         * allocatestack.c (allocate_stack): Set reported_guardsize
754         unconditionally.
755         * pthread_getattr_np.c (pthread_getattr_np): Use
756         reported_guardsize instead of guardsize.
757         * descr.h (struct pthread): Add reported_guardsize field.
758
759 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
760
761         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
762
763 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
764
765         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
766
767 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
768
769         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
770         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
771         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
772         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
773         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
774         Define.
775         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
776         (_POSIX_MESSAGE_PASSING): Define.
777         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
778         (_POSIX_MESSAGE_PASSING): Define.
779         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
780         (_POSIX_MESSAGE_PASSING): Define.
781
782 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
783
784         * tst-context1.c (fct): Check whether correct stack is used.
785
786 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
787
788         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
789         matching constraints for asm mem parameters.
790
791         * tst-clock2.c (tf): Don't define unless needed.
792
793 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
794
795         * Makefile (link-libc-static): Use $(static-gnulib) instead of
796         $(gnulib).
797
798 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
799
800         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
801         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
802         * pthreadP.h: Declare __nptl_deallocate_tsd.
803         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
804         Adjust caller.
805
806         * Makefile (tests): Add tst-tsd5.
807         * tst-tsd5.c: New file.
808
809 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
810
811         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
812         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
813         is SHLIB_COMPAT check.
814         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
815         (__pthread_attr_getaffinity_old): Likewise.
816         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
817         (__pthread_getaffinity_old): Likewise.
818         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
819         (__pthread_setaffinity_old): Likewise.
820
821 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
822
823         * allocatestack.c (_make_stacks_executable): Call
824         _dl_make_stack_executable first.
825
826 2004-03-24  Roland McGrath  <roland@redhat.com>
827
828         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
829         constraint instead of "0".
830
831 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
832
833         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
834         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
835
836         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
837         code to avoid warning.
838
839 2004-03-24  Andreas Jaeger  <aj@suse.de>
840
841         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
842         (__pthread_attr_setaffinity_old): Remove const.
843
844 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
845
846         * sysdeps/unix/sysv/linux/smp.h: New file.
847         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
848         * init.c: Define __is_smp.
849         (__pthread_initialize_minimal_internal): Call is_smp_system to
850         initialize __is_smp.
851         * pthreadP.h: Declare __is_smp.
852         Define MAX_ADAPTIVE_COUNT is necessary.
853         * pthread_mutex_init.c: Add comment regarding __spins field.
854         * pthread_mutex_lock.c: Implement adaptive mutex type.
855         * pthread_mutex_timedlock.c: Likewise.
856         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
857         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
858         Add __spins field.
859         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
860         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
861         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
862         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
863         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
864         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
865         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
866         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
867         lll_mutex_cond_trylock.
868         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
869         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
870         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
871         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
872         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
873         Define BUSY_WAIT_NOP.
874         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
875         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
876
877         * tst-mutex5.c: Add support for testing adaptive mutexes.
878         * tst-mutex7.c: Likewise.
879         * tst-mutex5a.c: New file.
880         * tst-mutex7a.c: New file.
881         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
882
883         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
884         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
885         vgettimeofday call might destroy the content.
886
887         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
888         @pause in the loop.
889
890         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
891         No need to restrict type of ret.  Make it int.  Add comment.
892
893         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
894         Remove unnecessary setne instruction.
895
896 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
897
898         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
899         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
900         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
901         If realloc fails, break out of the loop.
902
903 2004-03-20  Andreas Jaeger  <aj@suse.de>
904
905         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
906         (__pthread_setaffinity_old): Fix interface.
907         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
908         (__pthread_getaffinity_old): Likewise.
909
910         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
911         (__pthread_setaffinity_new): Remove duplicate declaration.
912
913 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
914
915         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
916         the return value to a safe register.
917         (CDISABLE): Set the function argument correctly.
918
919 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
920
921         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
922         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
923         Rewrite so that only one locked memory operation per round is needed.
924         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
925         (pthread_barrier_wait): After wakeup, release lock only when the
926         last thread stopped using the barrier object.
927         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
928         (__pthread_cond_wait): Don't store mutex address if the current
929         value is ~0l.  Add correct cleanup support and unwind info.
930         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
931         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
932         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
933         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
934         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
935         Add correct cleanup support and unwind info.
936         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
937         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
938         information for syscall wrappers.
939
940 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
941
942         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
943         cpusetsize field, remove next.
944         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
945         parameter for size of the CPU set.
946         (pthread_setaffinity_np): Likewise.
947         (pthread_attr_getaffinity_np): Likewise.
948         (pthread_attr_setaffinity_np): Likewise.
949         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
950         interface change, keep compatibility code.
951         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
952         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
953         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
954         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
955         __pthread_getaffinity_np.
956         * Versions: Add version for changed interfaces.
957         * tst-attr3.c: Adjust test for interface change.
958         * pthread_getattr_np.c: Query the kernel about the affinity mask with
959         increasing buffer sizes.
960         * pthread_attr_destroy.c: Remove unused list handling.
961         * pthread_attr_init.c: Likewise.
962
963 2004-03-17  Roland McGrath  <roland@redhat.com>
964
965         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
966         first argument to clock_getres so we ever enable kernel timers.
967
968 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
969
970         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
971
972 2004-03-12  Richard Henderson  <rth@redhat.com>
973
974         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
975         oldvalue from CENABLE to CDISABLE.
976
977 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
978
979         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
980         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
981         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
982         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
983
984 2004-03-11  Richard Henderson  <rth@redhat.com>
985
986         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
987         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
988         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
989
990 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
991
992         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
993         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
994         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
995
996 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
997
998         * forward.c (__pthread_cond_broadcast_2_0,
999         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
1000         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
1001         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
1002
1003 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1004
1005         * sysdeps/sh/tcb-offsets.sym: Add PID.
1006         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
1007         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
1008
1009 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
1010
1011         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
1012         include <sysdep-cancel.h>, vfork is no cancellation point.
1013         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
1014         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
1015         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
1016
1017 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
1018
1019         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
1020         libc_hidden_def.
1021         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
1022         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
1023         Likewise.
1024         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
1025         Likewise.
1026         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
1027         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
1028         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
1029         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
1030         of DO_CALL_VIA_BREAK.  Work around a gas problem.
1031
1032         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
1033         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
1034         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
1035         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
1036         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
1037         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
1038
1039         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
1040         a local register for saving old PID.  Negate PID in parent upon exit.
1041
1042         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
1043         tcb-offsets.h.
1044         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1045         before syscall, set to the old value in the parent afterwards.
1046         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
1047         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
1048         tcb-offsets.h.
1049         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1050         before syscall, set to the old value in the parent afterwards.
1051         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
1052         * sysdeps/s390/tcb-offsets.sym: Add PID.
1053
1054         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
1055         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
1056         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
1057         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
1058         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
1059         * sysdeps/sparc/tcb-offsets.sym: Add PID.
1060
1061 2004-03-10  Andreas Schwab  <schwab@suse.de>
1062
1063         * sysdeps/ia64/tcb-offsets.sym: Add PID.
1064         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
1065         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
1066
1067 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
1068
1069         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
1070         * tst-cancel21.c (do_one_test): Likewise.
1071         Reported by Gordon Jin <gordon.jin@intel.com>.
1072
1073 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
1074
1075         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
1076         if non-zero and set to INT_MIN if zero.
1077         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
1078         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
1079         (SAVE_PID, RESTORE_PID): Define.
1080         (__vfork): Use it.
1081         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
1082         Use relative path to avoid including NPTL i386/vfork.S.
1083         (SAVE_PID, RESTORE_PID): Define.
1084         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
1085         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
1086         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
1087         tst-vfork2x.
1088         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
1089         * tst-vfork1.c: New test.
1090         * tst-vfork2.c: New test.
1091         * tst-vfork1x.c: New test.
1092         * tst-vfork2x.c: New test.
1093
1094 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
1095
1096         * sysdeps/i386/tcb-offsets.sym: Add PID.
1097         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1098         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
1099         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
1100
1101 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
1102
1103         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
1104
1105 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1106
1107         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1108         _rtld_global_ro.
1109
1110 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
1111
1112         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1113         _rtld_global_ro.
1114
1115         * tst-once4.c: Remove unnecessary macro definition.
1116
1117         * tst-mutex7.c (do_test): Limit thread stack size.
1118         * tst-once2.c (do_test): Likewise.
1119         * tst-tls3.c (do_test): Likewise.
1120         * tst-tls1.c (do_test): Likewise.
1121         * tst-signal3.c (do_test): Likewise.
1122         * tst-kill6.c (do_test): Likewise.
1123         * tst-key4.c (do_test): Likewise.
1124         * tst-join4.c (do_test): Likewise.
1125         * tst-fork1.c (do_test): Likewise.
1126         * tst-context1.c (do_test): Likewise.
1127         * tst-cond2.c (do_test): Likewise.
1128         * tst-cond10.c (do_test): Likewise.
1129         * tst-clock2.c (do_test): Likewise.
1130         * tst-cancel10.c (do_test): Likewise.
1131         * tst-basic2.c (do_test): Likewise.
1132         * tst-barrier4.c (do_test): Likewise.
1133
1134 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
1135
1136         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
1137
1138 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
1139
1140         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1141         (__pthread_cond_timedwait): Optimize wakeup test.
1142         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1143         (__pthread_cond_wait): Likewise.
1144         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1145         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1146         Likewise.
1147
1148 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
1149
1150         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1151         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
1152         the atomic instruction needed.
1153         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1154         (__lll_mutex_lock_wait): Likewise.
1155
1156 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
1157
1158         * Makefile (tests): Add tst-cond14 and tst-cond15.
1159         * tst-cond14.c: New file.
1160         * tst-cond15.c: New file.
1161
1162 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
1163
1164         * sysdeps/pthread/createthread.c (create_thread): Remove use of
1165         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
1166         needs to be implemented differently to be useful.
1167
1168 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
1169
1170         * pthread_attr_setschedparam.c: Don't test priority against limits
1171         here.  Set ATTR_FLAG_SCHED_SET flag.
1172         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
1173         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
1174         from parent thread to child.  If attribute is used and scheduling
1175         parameters are not inherited, copy parameters from attribute or
1176         compute them.  Check priority value.
1177         * pthread_getschedparam.c: If the parameters aren't known yet get
1178         them from the kernel.
1179         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
1180         ATTR_FLAG_POLICY_SET flag for thread.
1181         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
1182         and ATTR_FLAG_POLICY_SET.
1183
1184         * sysdeps/pthread/createthread.c: Use tgkill if possible.
1185
1186         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
1187         fail if stack address hasn't been set.  Just return 0.
1188
1189 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
1190
1191         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
1192         libpthread for the files in this list.
1193         (CFLAGS-tst-unload): Removed.
1194         * tst-unload.c (do_test): Don't use complete path for
1195         LIBPHREAD_SO.
1196
1197         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
1198         tst-_res1mod2.
1199
1200 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
1201
1202         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1203         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
1204         operation per round is needed.
1205         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1206         (__lll_mutex_lock_wait): Likewise.
1207
1208 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
1209
1210         * tst-cancel9.c (cleanup): Don't print to stderr.
1211
1212 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1213
1214         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
1215
1216 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
1217
1218         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1219         (__syscall_error_handler2): Call CDISABLE.
1220         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1221         (__syscall_error_handler2): Call CDISABLE.
1222
1223         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1224         Release lock before the loop, don't reacquire it.
1225
1226         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
1227
1228 2004-02-19  Andreas Schwab  <schwab@suse.de>
1229
1230         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1231         Fix last change.
1232
1233 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
1234
1235         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
1236         (pthread_barrier_wait): After wakeup, release lock only when the
1237         last thread stopped using the barrier object.
1238         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
1239         (pthread_barrier_wait): Likewise.
1240         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1241         Likewise.
1242         * Makefile (tests): Add tst-barrier4.
1243         * tst-barrier4.c: New file.
1244
1245         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1246         (__pthread_cond_timedwait): Perform timeout test while holding
1247         internal lock to prevent wakeup race.
1248         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1249         * sysdeps/pthread/pthread_cond_timedwait.c
1250         (__pthread_cond_timedwait): Likewise.
1251         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1252         (__pthread_cond_timedwait): Likewise.
1253
1254 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
1255
1256         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
1257         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
1258         * Makefile (tests): Add tst-rwlock13.
1259         * tst-rwlock13.c: New test.
1260
1261 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
1262
1263         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1264         (__condvar_tw_cleanup): Little optimization.
1265         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1266
1267 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
1268
1269         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
1270         libpthread as "lib" parameter to SHLIB_COMPAT.
1271         (__novmx_siglongjmp): Fix typo in function name.
1272         (__novmx_longjmp): Fix typo in function name.
1273
1274 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1275
1276         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
1277         __builtin_expect.
1278
1279         * sysdeps/generic/pt-longjmp.c: Moved to...
1280         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
1281
1282 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
1283
1284         * Makefile (libpthread-routines): Add pt-cleanup.
1285         * pt-longjmp.c: Removed.
1286         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
1287         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
1288         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
1289         Version longjmp, siglongjmp for GLIBC_2.3.4.
1290         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
1291
1292 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1293
1294         * sysdeps/pthread/pthread_cond_timedwait.c
1295         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
1296         Reuse code.  Add __builtin_expects.
1297
1298         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1299         (__pthread_cond_timedwait): Get internal lock in case timeout has
1300         passed before the futex syscall.
1301         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1302
1303 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
1304
1305         * allocatestack.c: Pretty printing.
1306
1307         * sysdeps/pthread/createthread.c (create_thread): Don't add
1308         CLONE_DETACHED bit if it is not necessary.
1309
1310 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
1311
1312         * pthread_getattr_np.c: Include ldsodefs.h.
1313
1314 2004-01-16  Richard Henderson  <rth@redhat.com>
1315
1316         * allocatestack.c: Don't declare __libc_stack_end.
1317         * init.c (__pthread_initialize_minimal_internal): Likewise.
1318         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
1319
1320 2004-01-15  Richard Henderson  <rth@redhat.com>
1321
1322         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
1323         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
1324         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
1325         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
1326         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
1327         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
1328         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
1329         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
1330
1331 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
1332
1333         * init.c (pthread_functions): Make array const.
1334
1335 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
1336
1337         * allocatestack.c (__make_stacks_executable): Change interface.
1338         Check parameters.  Pass parameter on to libc counterpart.
1339         * pthreadP.h: Change declaration.
1340
1341 2004-01-13  Richard Henderson  <rth@redhat.com>
1342
1343         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
1344         prototype form.
1345         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
1346         Likewise.
1347
1348         * sysdeps/alpha/Makefile: New file.
1349         * sysdeps/alpha/tcb-offsets.sym: New file.
1350         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1351         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
1352
1353         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
1354         on powerpc version.
1355
1356 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
1357
1358         * Makefile (tests): Add tst-backtrace1.
1359         * tst-backtrace1.c: New test.
1360
1361 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
1362
1363         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
1364         register as second parameter to the REGISTER macro.
1365         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
1366         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
1367         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
1368         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
1369         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
1370         of thread register as second parameter to REGISTER macro in 64 case.
1371
1372 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
1373
1374         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
1375         (CFLAGS-getpid.o): Defined.
1376         (CFLAGS-getpid.os): Defined.
1377
1378 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
1379
1380         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
1381         returned for main thread does not overlap with any other VMA.
1382         Patch by Jakub Jelinek.
1383
1384 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
1385
1386         * tst-raise1.c: Include stdio.h.
1387
1388 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
1389
1390         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
1391         setting with __ASSUME_TGKILL || defined __NR_tgkill.
1392         If pid is 0, set it to selftid.
1393         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
1394         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
1395         != 0, return self->tid without doing a syscall.
1396         * descr.h (struct pthread): Move pid field after tid.
1397
1398         * Makefile (tests): Add tst-raise1.
1399         * tst-raise1.c: New file.
1400
1401 2003-12-23  Roland McGrath  <roland@redhat.com>
1402
1403         * tst-oddstacklimit.c: New file.
1404         * Makefile (tests): Add it.
1405         (tst-oddstacklimit-ENV): New variable.
1406
1407         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
1408         value up to page size for __default_stacksize.
1409
1410 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
1411
1412         * Makefile (tests): Add tst-eintr5.
1413         * tst-eintr5.c: New file.
1414
1415         * eintr.c (eintr_source): Prevent sending signal to self.
1416
1417         * tst-eintr2.c (tf1): Improve error message.
1418
1419 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
1420
1421         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
1422         * sysdeps/unix/sysv/linux/getpid.c: New file.
1423         * pthread_cancel.c: Add comment explaining use of PID field.
1424         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1425         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
1426         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
1427         temporarily to signal the field must not be relied on and updated
1428         by getpid().
1429         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
1430         temporarily negative.
1431         * sysdeps/unix/sysv/linux/raise.c: Likewise.
1432
1433 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
1434
1435         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
1436         (eintr_source): If ARG != NULL, use pthread_kill.
1437         * tst-eintr1.c: Adjust for this change.
1438         * tst-eintr2.c: Likewise.
1439         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
1440         * tst-eintr3.c: New file.
1441         * tst-eintr4.c: New file.
1442
1443 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
1444
1445         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
1446         if CANCELSTATE_BITMASK is set.
1447         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
1448         Likewise.
1449
1450         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
1451         (tests-reverse): Add tst-cancel23.
1452         * tst-cancel22.c: New test.
1453         * tst-cancel23.c: New test.
1454
1455 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
1456
1457         * tst-eintr1.c: Better error messages.
1458
1459         * Makefile (tests): Add tst-eintr2.
1460         * tst-eintr2.c: New file.
1461
1462 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
1463
1464         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
1465         (CFLAGS-tst-cancelx21.c): Set.
1466         * tst-cancel21.c: New test.
1467         * tst-cancelx21.c: New test.
1468
1469         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
1470         comparison operand.
1471         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
1472         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
1473         * pt-longjmp.c: Include jmpbuf-unwind.h.
1474         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
1475         _JMPBUF_UNWINDS.  Adjust compared pointers.
1476         * init.c (__pthread_initialize_minimal_internal): Initialize
1477         pd->stackblock_size.
1478         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
1479         * sysdeps/alpha/jmpbuf-unwind.h: New file.
1480         * sysdeps/i386/jmpbuf-unwind.h: New file.
1481         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
1482         * sysdeps/s390/jmpbuf-unwind.h: New file.
1483         * sysdeps/sh/jmpbuf-unwind.h: New file.
1484         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
1485         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
1486         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
1487         (_JMPBUF_CFA_UNWINDS): Remove.
1488         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
1489
1490 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
1491
1492         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
1493         (CFLAGS-tst-cancelx20.c): Set.
1494         * tst-cancel20.c: New test.
1495         * tst-cancelx20.c: New test.
1496
1497 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
1498
1499         * init.c (__pthread_initialize_minimal_internal): Don't treat
1500         architectures with separate register stack special here when
1501         computing default stack size.
1502
1503 2003-12-17  Roland McGrath  <roland@redhat.com>
1504
1505         * Makefile (tst-cancelx7-ARGS): New variable.
1506         Reportd by Greg Schafer <gschafer@zip.com.au>.
1507
1508 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
1509
1510         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
1511         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
1512         (tst-stack3-ENV): Set.
1513         ($(objpfx)tst-stack3-mem): New.
1514         * tst-stack3.c: New test.
1515
1516 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
1517
1518         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
1519         Add unwind directives.  Drop unused .regstk directive.
1520         (_fini_EPILOG_BEGINS): Add unwind directives.
1521
1522 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
1523
1524         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
1525         Assume parameter is a pointer.
1526         (lll_futex_wake): Likewise.
1527         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
1528         Likewise.
1529         (lll_futex_wake): Likewise.
1530         Reported by Boris Hu.
1531         * sysdeps/unix/sysv/linux/unregister-atfork.c
1532         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
1533
1534         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
1535
1536 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
1537
1538         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
1539         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
1540         __rtld_lock_initialize for ld.so lock.
1541         Patch in part by Adam Li <adam.li@intel.com>.
1542
1543 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
1544
1545         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
1546         in $(gnulib).  Also, remove stale comment.
1547
1548 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
1549
1550         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
1551         advantage of new syscall stub and optimize accordingly.
1552
1553         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
1554         from SYS_futex, to match expectations of
1555         sysdep.h:DO_INLINE_SYSCALL.
1556         (lll_futex_clobbers): Remove.
1557         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
1558         (lll_futex_wake): Likewise.
1559         (lll_futex_requeue): Likewise.
1560         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
1561         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
1562         Jelinek).
1563         (__lll_mutex_lock): Likewise.
1564         (__lll_mutex_cond_lock): Likewise.
1565         (__lll_mutex_timed_lock): Likewise.
1566         (__lll_mutex_unlock): Likewise.
1567         (__lll_mutex_unlock_force): Likewise.
1568
1569         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
1570         comes before the include of <sysdep.h>.
1571         (THREAD_SELF_SYSINFO): New macro.
1572         (THREAD_SYSINFO): Likewise.
1573         (INIT_SYSINFO): New macro.
1574         (TLS_INIT_TP): Call INIT_SYSINFO.
1575
1576         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
1577
1578         * sysdeps/pthread/createthread.c (create_thread): Use
1579         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
1580         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
1581         THREAD_SELF_SYSINFO instead of open code.
1582         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
1583         (THREAD_SYSINFO): Likewise.
1584
1585         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
1586
1587         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
1588
1589 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
1590
1591         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
1592         instead of .init.  Patch by David Mosberger.
1593
1594 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
1595
1596         * sysdeps/pthread/configure.in: Remove broken declaration in C
1597         cleanup handling check.
1598
1599 2003-11-30  Andreas Jaeger  <aj@suse.de>
1600
1601         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
1602         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
1603         Likewise.
1604
1605 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
1606
1607         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
1608         * pthread_attr_destroy.c: Include shlib-compat.h.
1609         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
1610         is set in iattr->flags.
1611         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
1612
1613 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
1614
1615         * Makefile (distribute): Add tst-cleanup4aux.c.
1616
1617         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
1618         include.
1619
1620 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
1621
1622         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
1623         pthread_cond_signal.
1624
1625         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
1626         store mutex address if the current value is ~0l.
1627         * sysdeps/pthread/pthread_cond_timedwait.c
1628         (__pthread_cond_timedwait): Likewise.
1629         * sysdeps/pthread/pthread_cond_broadcast.c
1630         (__pthread_cond_broadcast): Don't use requeue for pshared
1631         condvars.
1632
1633         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1634         (__pthread_cond_wait): Don't store mutex address if the current
1635         value is ~0l.
1636         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1637         (__pthread_cond_timedwait): Likewise.
1638         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1639         (__pthread_cond_broadcast): Don't use requeue for pshared
1640         condvars.
1641
1642         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
1643         element with ~0l for pshared condvars, with NULL otherwise.
1644
1645         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1646         (__pthread_cond_wait): Don't store mutex address if the current
1647         value is ~0l.
1648         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1649         (__pthread_cond_timedwait): Likewise.
1650         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1651         (__pthread_cond_broadcast): Don't use requeue for pshared
1652         condvars.
1653
1654         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
1655         * tst-cond12.c: New file.
1656         * tst-cond13.c: New file.
1657
1658 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
1659
1660         * sysdeps/pthread/configure.in: Make missing forced unwind support
1661         fatal.
1662
1663 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
1664
1665         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
1666
1667 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
1668
1669         * Makefile: Add magic to clean up correctly.
1670
1671 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
1672
1673         * unwind.c (FRAME_LEFT): Define.
1674         (unwind_stop): Handle old style cleanups here.
1675         (__pthread_unwind): Handle old style cleanups only if
1676         !HAVE_FORCED_UNWIND.
1677         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
1678         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
1679         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
1680         ($(objpfx)tst-cleanupx4): Likewise.
1681         * tst-cleanup4.c: New test.
1682         * tst-cleanup4aux.c: New.
1683         * tst-cleanupx4.c: New test.
1684
1685 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
1686
1687         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
1688         lll_mutex_*lock macros to skip atomic operations on some archs.
1689
1690 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
1691
1692         * sysdeps/pthread/tst-timer.c (main): Initialize
1693         sigev2.sigev_value as well.
1694
1695 2003-10-15  Roland McGrath  <roland@redhat.com>
1696
1697         * sysdeps/pthread/configure.in: Barf if visibility attribute support
1698         is missing.
1699         * sysdeps/pthread/configure: Regenerated.
1700
1701 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1702
1703         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
1704         locking macros.  No distinction between normal and mutex locking
1705         anymore.
1706         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
1707         Merge bits from lowlevelmutex.S we still need.
1708         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
1709         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
1710         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
1711         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
1712         new mutex implementation.
1713         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
1714         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
1715         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1716         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1717         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1718         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1719         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1720         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1721         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1722         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
1723         symbol for entry point to avoid cancellation.
1724
1725 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
1726
1727         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
1728         changes.
1729         (SAVE_OLDTYPE_0): Fix a typo.
1730
1731 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
1732
1733         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
1734         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
1735
1736 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1737
1738         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
1739         correct offset.
1740
1741 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
1742
1743         * Makefile (tests): Add tst-cancel19.
1744         * tst-cancel19.c: New test.
1745
1746 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1747
1748         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
1749         restoring of the old cancellation type.
1750
1751 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
1752
1753         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
1754
1755 2003-09-27  Wolfram Gloger  <wg@malloc.de>
1756
1757         * sysdeps/pthread/malloc-machine.h: New file
1758
1759 2003-09-24  Roland McGrath  <roland@redhat.com>
1760
1761         * allocatestack.c (__make_stacks_executable): Don't ignore return
1762         value from _dl_make_stack_executable.
1763
1764 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
1765
1766         * allocatestack.c (__make_stacks_executable): Also change
1767         permission of the currently unused stacks.
1768
1769         * allocatestack.c (change_stack_perm): Split out from
1770         __make_stacks_executable.
1771         (allocate_stack): If the required permission changed between the time
1772         we started preparing the stack and queueing it, change the permission.
1773         (__make_stacks_executable): Call change_stack_perm.
1774
1775         * Makefile: Build tst-execstack-mod locally.
1776         * tst-execstack-mod.c: New file.
1777
1778 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
1779
1780         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
1781
1782 2003-09-23  Roland McGrath  <roland@redhat.com>
1783
1784         * tst-execstack.c: New file.
1785         * Makefile (tests): Add it.
1786         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
1787         (LDFLAGS-tst-execstack): New variable.
1788
1789         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
1790         whether to use PROT_EXEC for stack mmap.
1791         (__make_stacks_executable): New function.
1792         * pthreadP.h: Declare it.
1793         * init.c (__pthread_initialize_minimal_internal): Set
1794         GL(dl_make_stack_executable_hook) to that.
1795
1796 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1797
1798         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
1799         recommendation from AMD re avoidance of lock prefix.
1800
1801 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
1802
1803         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
1804         lll_futex_timed_wait instead of lll_futex_wait.
1805         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
1806         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
1807         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
1808         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
1809         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
1810         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
1811         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
1812         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
1813         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
1814         Completely revamp the locking macros.  No distinction between
1815         normal and mutex locking anymore.
1816         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1817         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
1818         __lll_lock_timedwait): Fix prototypes.
1819         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
1820         __lll_lock_timedwait): Likewise.
1821         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
1822         macros, add __builtin_expect.
1823         (lll_mutex_timedlock): Likewise.  Fix return value.
1824         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
1825         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
1826         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
1827         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
1828         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
1829         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
1830         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
1831         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
1832
1833 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1834
1835         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1836         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
1837         operation if possible.
1838
1839         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
1840         like jumping over the lock prefix.
1841
1842 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
1843
1844         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
1845         locking macros.  No distinction between normal and mutex locking
1846         anymore.
1847         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1848         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1849         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1850         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
1851         locking.  Merge bits from lowlevelmutex.S we still need.
1852         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1853         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1854         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
1855         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
1856         * Makefile (routines): Remove libc-lowlevelmutex.
1857         (libpthread-rountines): Remove lowlevelmutex.
1858         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
1859         for new mutex implementation.
1860         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1861         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1862         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1863         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1864         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1865         Likewise.
1866         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1867         Likewise.
1868         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1869         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1870         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
1871         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1872         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1873         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1874         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1875         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1876         Likewise.
1877         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1878         Likewise.
1879         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1880         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1881         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1882         Don't use requeue.
1883         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1884         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
1885
1886 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
1887
1888         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
1889         in parameters of asm with output parameters.
1890
1891         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
1892         type of DECR parameter to int.
1893         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
1894
1895 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
1896
1897         * tst-attr3.c (tf, do_test): Print stack start/end/size and
1898         guardsize for each thread.
1899
1900 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1901
1902         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
1903         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1904         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
1905
1906         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1907         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
1908         NULL.
1909         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
1910         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
1911         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1912         (pthread_getaffinity_np): Add hidden_def.
1913
1914         * Makefile (tests): Add tst-attr3.
1915         * tst-attr3.c: New test.
1916
1917         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
1918
1919 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1920
1921         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
1922         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
1923
1924 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1925
1926         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
1927         * tst-align.c: Include tst-stack-align.h.
1928         (tf, do_test): Use TEST_STACK_ALIGN macro.
1929
1930 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
1931
1932         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
1933         variable.
1934
1935 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
1936
1937         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
1938         stack-related values for the initial thread.
1939
1940 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1941
1942         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
1943
1944 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
1945
1946         * pthread_mutex_lock.c: Minor code rearrangements.
1947
1948 2003-09-05  Roland McGrath  <roland@redhat.com>
1949
1950         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
1951         Instead, include ../nptl_db/db_info.c to do its magic.
1952         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
1953         (__pthread_pthread_key_2ndlevel_size): Likewise.
1954         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
1955         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
1956         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
1957         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
1958         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
1959         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
1960         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
1961         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
1962         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
1963         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
1964         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
1965         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
1966         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
1967         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
1968         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
1969         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
1970         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
1971
1972 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
1973
1974         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
1975         of pthread_t to be compatible with LT.
1976         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1977         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1978         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1979         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1980         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1981         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1982         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1983
1984 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
1985
1986         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
1987
1988 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
1989
1990         * unwind-forcedunwind.c: Move to...
1991         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
1992         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
1993         * sysdeps/pthread/jmpbuf-unwind.h: New file.
1994         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
1995         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
1996         * unwind.c: Include jmpbuf-unwind.h.
1997         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
1998
1999 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
2000
2001         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
2002         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
2003         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
2004         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
2005         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2006         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
2007         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
2008         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
2009         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
2010         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
2011         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
2012         function.
2013         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
2014         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
2015         * Makefile (tests): Add tst-stack2.
2016         * tst-stack2.c: New test.
2017         * tst-stack1.c: Include limits.h and sys/param.h.
2018         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
2019
2020         * pthread_condattr_setpshared.c: Include errno.h.
2021         (pthread_condattr_setpshared): Return EINVAL if pshared
2022         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
2023
2024         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
2025         defined symbol for entry point to avoid cancellation.
2026         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2027         Likewise.
2028         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
2029         Likewise.
2030         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2031         Likewise.
2032         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
2033         Likewise.
2034         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2035         Likewise.
2036         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
2037         __close_nocancel, __read_nocancel, __write_nocancel,
2038         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
2039         libpthread.so or librt.so, define to corresponding function
2040         without _nocancel suffix.
2041         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
2042         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
2043         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
2044
2045         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
2046
2047 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
2048
2049         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
2050         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
2051
2052         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
2053         in subsections has a symbol associated with it.
2054
2055         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
2056         defined symbol for entry point to avoid cancellation.
2057         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
2058
2059 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2060
2061         * Makefile (tests): Add tst-tls5.
2062         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
2063         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
2064         ($(objpfx)tst-tls5): New.
2065         ($(objpfx)tst-tls6.out): Likewise.
2066         (tests): Depend on $(objpfx)tst-tls6.out.
2067         * tst-tls3.c: Include stdint.h and pthreaddef.h.
2068         (do_test): Check pthread_self () return value alignment.
2069         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
2070         (tf): Check pthread_self () return value alignment.
2071         * tst-tls5.c: New test.
2072         * tst-tls5.h: New.
2073         * tst-tls5mod.c: New.
2074         * tst-tls5moda.c: New.
2075         * tst-tls5modb.c: New.
2076         * tst-tls5modc.c: New.
2077         * tst-tls5modd.c: New.
2078         * tst-tls5mode.c: New.
2079         * tst-tls5modf.c: New.
2080         * tst-tls6.sh: New test.
2081
2082         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
2083         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
2084         * init.c (pthread_functions): Initialize them.
2085         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
2086         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
2087         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
2088         pthread_cond_timedwait@@GLIBC_2.3.2.
2089
2090 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2091
2092         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
2093         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
2094         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
2095         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
2096         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
2097         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2098
2099         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
2100
2101         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
2102         _POSIX_THREAD_PRIORITY_SCHEDULING.
2103         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2104
2105 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
2106
2107         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
2108         nested function, use static inline function from libio.h.
2109         Code by Richard Henderson.
2110
2111         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
2112         weak.
2113
2114 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
2115
2116         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
2117         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
2118         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
2119         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
2120         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
2121         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
2122         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
2123         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
2124         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
2125         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
2126         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
2127         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
2128         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
2129         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
2130         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
2131         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
2132         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
2133         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
2134         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
2135         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
2136         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
2137         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
2138         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
2139         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
2140         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
2141         * sysdeps/sparc/tls.h: New file.
2142         * sysdeps/sparc/tcb-offsets.sym: New file.
2143         * sysdeps/sparc/Makefile: New file.
2144         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
2145         * init.c [__sparc__] (__NR_set_tid_address): Define.
2146
2147 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
2148
2149         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
2150         _IO_release_lock): Define.
2151
2152 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
2153
2154         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
2155         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
2156
2157 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
2158
2159         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
2160         (__pthread_cleanup_class): Add missing return types of member
2161         functions.
2162
2163 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
2164
2165         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2166         (lll_mutex_unlock_force): Add memory barrier between store and futex
2167         syscall.
2168
2169 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
2170
2171         * tst-cancel4.c (do_test): Also unlink tempfname and remove
2172         tempmsg in first loop.
2173
2174 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
2175
2176         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2177         _POSIX_THREAD_PRIORITY_SCHEDULING.
2178         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2179
2180 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2181
2182         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
2183         (__rtld_lock_default_lock_recursive,
2184         __rtld_lock_default_unlock_recursive): Define.
2185         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
2186         __rtld_lock_unlock_recursive): Define using
2187         GL(_dl_rtld_*lock_recursive).
2188         * init.c (__pthread_initialize_minimal_internal): Initialize
2189         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
2190         Lock GL(_dl_load_lock) the same number of times as
2191         GL(_dl_load_lock) using non-mt implementation was nested.
2192
2193         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
2194         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
2195
2196 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
2197
2198         * tst-cancel17.c (do_test): Make len2 maximum of page size and
2199         PIPE_BUF.
2200
2201 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2202
2203         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
2204
2205 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
2206
2207         * sysdeps/pthread/createthread.c (do_clone): Move error handling
2208         to first syscall error check.  Move syscall error check for tkill
2209         into __ASSUME_CLONE_STOPPED #ifdef.
2210
2211 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
2212
2213         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
2214         is not defined, do explicit synchronization.
2215         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
2216         is not defined also unlock pd->lock for non-debugging case in case
2217         it is necessary.
2218         * pthread_create.c (start_thread): Always get and release pd->lock
2219         if __ASSUME_CLONE_STOPPED is not defined.
2220         (start_thread_debug): Removed.  Adjust users.
2221         * allocatestack.c (allocate_stack): Always initialize lock if
2222         __ASSUME_CLONE_STOPPED is not defined.
2223         * Makefile (tests): Add tst-sched1.
2224         * tst-sched1.c: New file.
2225
2226         * sysdeps/pthread/createthread.c (do_clone): Only use
2227         sched_setschduler and pass correct parameters.
2228
2229 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2230
2231         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
2232         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
2233         PTHREAD_STACK_MIN in comments.
2234
2235 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2236
2237         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2238         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
2239         argument.
2240         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
2241         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
2242         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
2243         (__pthread_cleanup_upto): Fix prototype.
2244         (_longjmp_unwind): Adjust caller.
2245         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
2246         Change second argument to const struct pointer.
2247         * tst-sem8.c (main): Remove unused s2 and s3 variables.
2248         * tst-sem9.c (main): Likewise.
2249         * unwind.c: Include string.h for strlen prototype.
2250
2251 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
2252
2253         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2254         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
2255         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
2256         Define HAVE_CMOV.
2257         Patch by Nicholas Miell <nmiell@attbi.com>.
2258
2259 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
2260
2261         * init.c (__pthread_initialize_minimal_internal): Initialize
2262         GL(dl_init_static_tls).
2263         * pthreadP.h (__pthread_init_static_tls): New prototype.
2264         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
2265         New functions.
2266         * Makefile (tests): Add tst-tls4.
2267         (modules-names): Add tst-tls4moda and tst-tls4modb.
2268         ($(objpfx)tst-tls4): Link against libdl and libpthread.
2269         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
2270         tst-tls4modb.so.
2271         * tst-tls4.c: New file.
2272         * tst-tls4moda.c: New file.
2273         * tst-tls4modb.c: New file.
2274
2275 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
2276
2277         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
2278         before __timer_dealloc.
2279         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
2280         Don't call list_unlink.
2281
2282 2003-07-29  Roland McGrath  <roland@redhat.com>
2283
2284         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
2285
2286 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
2287
2288         * descr.h: Don't include lowlevellock.h, pthreaddef.h and dl-sysdep.h
2289         if __need_struct_pthread_size, instead define lll_lock_t.
2290
2291 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
2292
2293         * tst-cancel17.c (do_test): Check if aio_cancel failed.
2294         Don't reuse struct aiocb A if it failed.
2295         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
2296         not just one byte, as that does not block.
2297
2298 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
2299
2300         * sysdeps/pthread/unwind-resume.c: New file.
2301         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
2302         unwind-resume in csu subdir.
2303         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
2304         exceptions.
2305         (librt-sysdep_routines, librt-shared-only-routines): Add
2306         rt-unwind-resume.
2307         * sysdeps/pthread/rt-unwind-resume.c: New file.
2308         * unwind-forcedunwind.c: New file.
2309         * Makefile (libpthread-routines): Add unwind-forcedunwind.
2310         (libpthread-shared-only-routines): Likewise.
2311         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
2312         * pthreadP.h (pthread_cancel_init): New prototype.
2313         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
2314
2315         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
2316         attr argument const struct pthread_attr *.
2317
2318         * res.c (__res_state): Return __resp.
2319         * descr.h: Include resolv.h.
2320         (struct pthread): Add res field.
2321         * pthread_create.c: Include resolv.h.
2322         (start_thread): Initialize __resp.
2323         * Makefile (tests): Add tst-_res1.
2324         (module-names): Add tst-_res1mod1, tst-_res1mod2.
2325         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
2326         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
2327         libpthread.
2328         * tst-_res1.c: New file.
2329         * tst-_res1mod1.c: New file.
2330         * tst-_res1mod2.c: New file.
2331
2332 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
2333
2334         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
2335
2336         * Makefile: Define various *-no-z-defs variables for test DSOs
2337         which has undefined symbols.
2338
2339 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
2340
2341         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2342         Retry if the stwcx fails to store once_control.
2343
2344 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
2345
2346         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
2347         pthread_attr_setaffinity.
2348         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
2349         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
2350         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
2351         * pthread_attr_destroy.c: Free cpuset element if allocated.
2352         * pthread_create.c: Pass iattr as additional parameter to
2353         create_thread.
2354         * sysdeps/pthread/createthread.c: If attribute is provided and
2355         a new thread is created with affinity set or scheduling parameters,
2356         start thread with CLONE_STOPPED.
2357         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
2358         pthread_attr_setaffinity.
2359         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2360         cpuset element.
2361
2362 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
2363
2364         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
2365
2366 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
2367
2368         * sysdeps/pthread/configure.in: Require CFI directives also for
2369         ppc and s390.
2370
2371 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
2372
2373         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2374         Add cfi directives.
2375
2376 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2377
2378         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
2379         CLEANUP_JMP_BUF.
2380         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
2381         registers as variables.  Call __pthread_mutex_unlock_usercnt.
2382         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2383         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
2384         not self pointer in __writer.  Compare with TID to determine
2385         deadlocks.
2386         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2387         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2388         Likewise.
2389         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2390         Likewise.
2391         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
2392         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2393         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
2394         macros also when compiling librt.
2395
2396 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
2397
2398         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
2399         -fasynchronous-unwind-tables.
2400         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2401         (PSEUDO): Add cfi directives.
2402         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
2403         Likewise.
2404         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2405         Likewise.
2406
2407 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
2408
2409         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
2410         __pthread_unregister_cancel): Add prototypes and hidden_proto.
2411         * unwind.c (__pthread_unwind_next): Add hidden_def.
2412         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
2413         Likewise.
2414         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2415         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2416         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2417         Likewise.
2418         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
2419         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2420         Likewise.
2421         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
2422         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
2423         __pthread_unregister_cancel and __pthread_unwind_next.
2424
2425 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
2426
2427         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
2428         different symbol for the cancellation syscall wrapper and
2429         non-cancellation syscall wrapper.
2430         (PSEUDO_END): Define.
2431
2432 2003-07-05  Richard Henderson  <rth@redhat.com>
2433
2434         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
2435         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
2436         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2437         return actual return value from the syscall, not 0.
2438
2439 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
2440
2441         * descr.h (struct pthread): Add pid field.
2442         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
2443         (__reclaim_stacks): Likewise.
2444         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
2445         also check for PID of the signal source.
2446         (__pthread_initialize_minimal_internal): Also initialize pid field
2447         of initial thread's descriptor.
2448         * pthread_cancel.c: Use tgkill instead of tkill if possible.
2449         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2450         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
2451         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2452         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2453
2454 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
2455
2456         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
2457         Fix use of parameter.
2458         (__libc_cleanup_pop): Likewise.
2459
2460 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
2461
2462         * init.c (sigcancel_handler): Change parameters to match handler
2463         for SA_SIGACTION.  Check signal number and code to recognize
2464         invalid invocations.
2465
2466 2003-07-03  Roland McGrath  <roland@redhat.com>
2467
2468         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
2469         Apply sizeof (struct pthread) bias to r13 value.
2470
2471 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
2472
2473         * sysdeps/pthread/configure.in: Require CFI directives.
2474
2475         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
2476         definition.
2477         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
2478         libpthread compilation.
2479         * unwind.c (__pthread_unwind): Add hidden_def.
2480         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
2481
2482 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2483
2484         * libc-cancellation.c (__libc_cleanup_routine): Define.
2485         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
2486         (__pthread_cleanup_pop): Define.
2487
2488 2003-07-01  Richard Henderson  <rth@redhat.com>
2489
2490         * sysdeps/alpha/elf/pt-initfini.c: New file.
2491         * sysdeps/alpha/pthread_spin_lock.S: New file.
2492         * sysdeps/alpha/pthread_spin_trylock.S: New file.
2493         * sysdeps/alpha/pthreaddef.h: New file.
2494         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
2495         * sysdeps/alpha/tls.h: New file.
2496         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
2497         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
2498         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
2499         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
2500         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
2501         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
2502         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
2503         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
2504         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
2505         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
2506
2507 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2508
2509         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
2510         cleanup support and unwind info.
2511
2512 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
2513
2514         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2515         Use correct cleanup handler registration.  Add unwind info.
2516         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
2517         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
2518         * tst-once3.c: Add cleanup handler and check it is called.
2519         * tst-once4.c: Likewise.
2520         * tst-oncex3.c: New file.
2521         * tst-oncex4.c: New file.
2522         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
2523
2524 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
2525
2526         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
2527
2528 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
2529
2530         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
2531         (tf_msgsnd): Likewise.
2532
2533         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
2534         premature returns a bit more.
2535
2536 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
2537
2538         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
2539         definition to the front.
2540
2541         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
2542         the cleanup functions to make the names unique.  Fix dwarf opcode
2543         un unwind table.
2544         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
2545         functions to make the names unique.  Fix CFA offset for two blocks.
2546
2547 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
2548
2549         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
2550         missing closing braces.
2551         Patch by Christophe Saout <christophe@saout.de>.
2552
2553 2003-06-24  Roland McGrath  <roland@redhat.com>
2554
2555         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
2556
2557 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
2558
2559         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
2560         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
2561
2562         * pthreadP.h: Declare __find_thread_by_id.
2563         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
2564         * pthread_clock_gettime.c: Allow using other thread's clock.
2565         * pthread_clock_settime.c: Likewise.
2566         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2567         * Makefile: Add rules to build and run tst-clock2.
2568         * tst-clock2.c: New file.
2569
2570 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
2571
2572         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
2573         to use exception-based cleanup handler.
2574         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2575
2576         * tst-cond8.c (ch): Announce that we are done.
2577
2578         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
2579
2580         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
2581         Also test aio_suspend with timeout value.
2582
2583 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
2584
2585         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
2586         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
2587         attribute_hidden.
2588
2589         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
2590         (__pthread_mutex_lock_internal): Likewise.
2591         (__pthread_mutex_unlock_internal): Likewise.
2592         (__pthread_mutex_unlock_usercnt): Declare.
2593         * pthread_mutex_destroy.c: Always fail if used in any way.
2594         * pthread_mutex_init.c: Update comment.
2595         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
2596         * pthread_mutex_timedlock.c: Adjust __nusers.
2597         * pthread_mutex_trylock.c: Adjust __nusers.
2598         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
2599         and public interfaces are wrapper with pass additional parameter.
2600         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
2601         parameter zero.
2602         * tst-mutex8.c: New file.
2603         * Makefile (tests): Add tst-mutex8.
2604         * sysdeps/pthread/pthread_cond_timedwait.c: Call
2605         __pthread_mutex_unlock_usercnt.
2606         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2607         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2608         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2609         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2610         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2611         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
2612         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2613         Add __nusers.
2614         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2615         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2616         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2617         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2618         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2619
2620         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
2621         * pthread_mutex_timedlock.c: Likewise.
2622         * pthread_mutex_trylock.c: Adjust __nusers.
2623         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
2624         * tst-mutex9.c: New file.
2625         * Makefile (tests): Add tst-mutex9.
2626         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
2627         * sysdeps/ia64/tls.h: Likewise.
2628         * sysdeps/powerpc/tls.h: Likewise.
2629         * sysdeps/s390/tls.h: Likewise.
2630         * sysdeps/sh/tls.h: Likewise.
2631         * sysdeps/x86_64/tls.h: Likewise.
2632         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2633         Change type of __owner.
2634         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2635         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2636         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2637         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2638         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2639
2640 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
2641
2642         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
2643         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
2644
2645         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
2646         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
2647         instead of nr to lll_futex_wake.  Only set errno and return -1
2648         if err < 0.
2649
2650         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
2651         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2652         return actual return value from the syscall, not 0.
2653
2654 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
2655
2656         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
2657         find a random value.
2658         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
2659         errno==EIDRM.
2660
2661         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
2662         compat_timer_settime.
2663         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
2664         compat_timer_gettime.
2665         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
2666         compat_timer_getoverrun.
2667         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
2668         compat_timer_delete.
2669
2670         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
2671         error-checking mutex detect busy mutexes.
2672
2673 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2674
2675         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
2676         Add ax to clobber list.
2677         (lll_mutex_cond_lock): Likewise.
2678         (lll_mutex_unlock): Likewise.
2679         (lll_lock): Likewise.
2680         (lll_unlock): Likewise.
2681
2682         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
2683         * tst-cancel18.c: New file.
2684         * tst-cancelx18.c: New file.
2685
2686         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
2687         and tcdrain.
2688
2689         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
2690         * tst-cancel17.c: New file.
2691         * tst-cancelx17.c: New file.
2692
2693         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
2694         * sysdeps/unix/sysv/linux/sigwait.c: New file.
2695         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
2696
2697         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
2698
2699 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
2700
2701         * sysdeps/pthread/createthread.c (create_thread): Set
2702         header.multiple_threads unconditionally.
2703         * allocatestack.c (allocate_stack): Likewise.
2704         * descr.h (struct pthread): Add header.multiple_threads
2705         unconditionally.
2706         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
2707         Define for librt.  #error if neither libpthread, libc nor librt.
2708         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
2709         Likewise.
2710         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
2711         CDISABLE): Likewise.
2712         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
2713         CDISABLE): Likewise.
2714         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
2715         CDISABLE): Likewise.
2716         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
2717         CDISABLE): Likewise.  Access header.multiple_threads outside of
2718         libc and libpthread.
2719         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
2720         Likewise.
2721         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
2722         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
2723
2724 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2725
2726         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
2727         Also test early cancellation before the thread reaches the cancellation
2728         point.
2729
2730         * Makefile: Compile forward.c with exceptions.
2731
2732         * sysdeps/unix/sysv/linux/sleep.c: New file.
2733
2734 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
2735
2736         * Makefile: Add CFLAGS definition to compile function wrappers
2737         duplicated from libc with exceptions.
2738         * tst-cancel4.c: Also check cancellation handlers.
2739
2740         * Makefile: Add rules to build and run tst-cancel16 and
2741         tst-cancelx16.  Add missing CFLAGS definitions.
2742         * tst-cancel16.c: New file.
2743         * tst-cancelx16.c: New file.
2744
2745 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
2746
2747         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2748         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
2749         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
2750         (DL_SYSINFO_IMPLEMENTATION): Likewise.
2751
2752         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
2753         (LIBC_CANCEL_RESET): Likewise.
2754         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
2755         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
2756         librt-cancellation.
2757         (CFLAGS-libcrt-cancellation.c): Define.
2758         * sysdeps/pthread/librt-cancellation.c: New file.
2759         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
2760         macros also when compiling librt.
2761         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2762         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2763         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2764         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2765         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2766         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2767         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2768
2769         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
2770         compat_timer_create.
2771
2772 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
2773
2774         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
2775
2776         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
2777         __register_atfork.
2778         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
2779         Add libc_hidden_def.
2780
2781 2003-06-13  Roland McGrath  <roland@redhat.com>
2782
2783         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
2784         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
2785
2786 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
2787
2788         * allocatestack.c (queue_stack): Always inline.
2789         * ptreadhP.h (__do_cancel): Likewise.
2790
2791 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
2792
2793         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
2794         a typo.
2795
2796 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
2797
2798         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2799         (__pthread_cond_signal): Remove incorrect second addition for
2800         cond_lock!=0.
2801
2802 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
2803
2804         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2805         (__pthread_cond_signal): Use correct futex pointer in
2806         __lll_mutex_lock_wait call.
2807
2808         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2809         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
2810
2811 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
2812
2813         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
2814         cancelable.
2815         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2816         Likewise.
2817
2818         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
2819         hand-written CFI generation code.  Since ENTRY/END also initiated
2820         CFI frames this caused two CFI sets to be generated.
2821
2822 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
2823
2824         * cleanup_routine.c: New file.
2825         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
2826         * sysdeps/pthread/pthread.h: Add support for fully exception-based
2827         cleanup handling.
2828         * Makefile (libpthread-routines): Add cleanup_routine.
2829         Add more CFLAGS variables to compile with exceptions.  Add comments
2830         why which file needs unwind tables.
2831         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
2832         tests.
2833         * tst-cancelx1.c: New file.
2834         * tst-cancelx2.c: New file.
2835         * tst-cancelx3.c: New file.
2836         * tst-cancelx4.c: New file.
2837         * tst-cancelx5.c: New file.
2838         * tst-cancelx6.c: New file.
2839         * tst-cancelx7.c: New file.
2840         * tst-cancelx8.c: New file.
2841         * tst-cancelx9.c: New file.
2842         * tst-cancelx10.c: New file.
2843         * tst-cancelx11.c: New file.
2844         * tst-cancelx12.c: New file.
2845         * tst-cancelx13.c: New file.
2846         * tst-cancelx14.c: New file.
2847         * tst-cancelx15.c: New file.
2848         * tst-cleanupx0.c: New file.
2849         * tst-cleanupx0.expect: New file.
2850         * tst-cleanupx1.c: New file.
2851         * tst-cleanupx2.c: New file.
2852         * tst-cleanupx3.c: New file.
2853
2854         * tst-cleanup0.c: Make standard compliant.
2855         * tst-cleanup1.c: Likewise.
2856
2857         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
2858         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2859         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2860         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2861         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2862         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2863         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
2864         CLEANUP_JMP_BUF.
2865         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2866         * tst-cancel12.c: New file.
2867         * tst-cancel13.c: New file.
2868         * tst-cancel14.c: New file.
2869         * tst-cancel15.c: New file.
2870         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
2871         and tst-cancel15.
2872
2873         * tst-cancel1.c: Add some comments.
2874
2875         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
2876         timeout correctly.
2877
2878 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
2879
2880         * Makefile (CFLAGS-pthread_cancel.c): Define.
2881
2882 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
2883
2884         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
2885         Change type of __writer element to int.
2886         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2887         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2888         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2889         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2890         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2891         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
2892         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2893         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
2894         Compare with TID to determine deadlocks.
2895         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2896         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2897         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
2898         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2899         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2900         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2901         Likewise.
2902         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2903         Likewise.
2904         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2905         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2906         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2907         Likewise.
2908         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2909         Likewise.
2910         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2911         * Makefile (tests): Add tst-rwlock12.
2912         * tst-rwlock12.c: New file.
2913
2914 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
2915
2916         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
2917         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
2918         Remove bogus hidden_proto.
2919         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2920         Likewise.
2921         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
2922         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
2923         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
2924         ___lll_mutex_timedlock): Likewise.
2925
2926 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
2927
2928         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2929         (__pthread_cond_signal): Add some code to eventually handle
2930         cond_lock!=0.
2931
2932 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
2933
2934         * Makefile (tests): Add tst-exec4.
2935         (tst-exec4-ARGS): Define.
2936         * tst-exec4.c: New file.
2937
2938 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
2939
2940         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2941         Also fail if tv_nsec < 0.
2942         (__lll_timedwait_tid): Likewise.
2943         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
2944         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
2945         Likewise.
2946         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
2947         Likewise.
2948         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
2949         Likewise.
2950         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2951         Likewise.
2952         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
2953         Likewise.
2954         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
2955         Likewise.
2956
2957         * Makefile (tests): Add tst-sem8 and tst-sem9.
2958         * tst-sem8.c: New file.
2959         * tst-sem9.c: New file.
2960         * sem_open.c: Fix creation of in_use record if the file exists but
2961         no internal record.
2962
2963         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
2964         definitions.
2965
2966         * sysdeps/pthread/timer_create.c (timer_create): In case
2967         evp==NULL, assign timer ID to sival_ptr.
2968
2969         * descr.h (struct pthread_unwind_buf): Change type of prev element to
2970         struct pthread_unwind_buf *.
2971         (struct pthread): Likewise for cleanup_jmp_buf element.
2972
2973         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
2974         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
2975         * unwind.c (__pthread_unwind_next): Likewise.
2976
2977 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
2978
2979         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2980         (lll_futex_timed_wait): Use int for futex value parameter.
2981         (lll_futex_wake): Likewise.
2982         (lll_futex_requeue): Likewise.
2983
2984         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
2985         Replace one memory operation with one register operation.
2986
2987         * tst-join4.c (do_test): Fix error message.
2988
2989         * tst-rwlock6.c (do_test): Use correct format specifier.
2990
2991         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2992         (__lll_mutex_lock_wait): Replace one memory operation with one
2993         register operation.
2994         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
2995         (__lll_mutex_lock_wait): Likewise.
2996
2997         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2998         (__lll_mutex_cond_lock): Add one to value parameter of
2999         __lll_lock_wait to reflect reality in the futex syscall.
3000         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3001         (lll_mutex_cond_lock): Likewise.
3002
3003 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3004
3005         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
3006         New function.
3007         (lll_mutex_cond_lock): Define.
3008
3009 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
3010
3011         * Makefile (tests): Add tst-signal6.
3012         * tst-signal6.c: New file.
3013
3014         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
3015         (__lll_mutex_unlock_force): New function
3016         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3017
3018         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3019         (__lll_mutex_unlock_force): New function.
3020         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3021
3022         * tst-rwlock7.c (do_test): Use correct format specifier.
3023
3024         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
3025         Find break parameter in correct asm argument.
3026
3027 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
3028
3029         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
3030         Remove out4.
3031         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
3032         error occured.
3033         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3034         Add __mutex.
3035         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
3036         lll_futex_requeue, lll_mutex_unlock_force): Define.
3037
3038 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3039
3040         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3041         (pthread_cond_t): Add __mutex.
3042         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
3043         lll_futex_requeue, lll_mutex_unlock_force): Define.
3044
3045 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3046
3047         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
3048         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3049         Add __mutex field.
3050         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
3051         Define.
3052         (lll_futex_wait, lll_futex_wake): Define.
3053         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
3054         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
3055         FUTEX_REQUEUE instead of FUTEX_WAIT.
3056         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
3057         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
3058         mutex which was used in condvar structure.  Call
3059         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
3060         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3061
3062         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
3063         include tcb-offsets.h.  Read wakeup value in locked region.
3064         Use the value of gbr register as THREAD_ID.
3065         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3066         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3067         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3068
3069         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
3070         macros.
3071
3072 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
3073
3074         * sysdeps/pthread/pthread_cond_broadcast.c
3075         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
3076
3077 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
3078
3079         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
3080         typo in register name.
3081         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
3082         correctly.  Actually use requeue.  Little optimization.
3083         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
3084         mutex address early.  Handle cancellation state as 32-bit value.
3085         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3086         Remove unnecessary label.
3087
3088 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
3089
3090         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
3091         instead of FUTEX_WAIT.
3092         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
3093         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3094         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3095         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3096         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3097         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
3098         used in condvar structure.  Call __pthread_mutex_cond_lock instead
3099         of __pthread_mutex_lock_internal.
3100         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3101         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3102         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3103         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
3104         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3105         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3106         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
3107         Add pthread_mutex_cond_lock.
3108         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
3109         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
3110         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
3111         lll_mutex_cond_lock.
3112         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3113         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3114         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3115         Add __mutex field.
3116         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3117         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3118
3119         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
3120         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3121
3122         * pthreadP.h: Declare __pthread_mutex_cond_lock.
3123         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
3124         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
3125         macro don't define aliases.
3126
3127         * cancellation.c: Remove __pthread_enable_asynccancel_2.
3128         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
3129         * sysdeps/pthread/pthread_cond_timedwait.c: Use
3130         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
3131         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3132         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3133         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3134         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3135         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3136
3137 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
3138
3139         * sem_open.c: Fix one endless loop.  Implement correct semantics
3140         wrt opening the same semaphore more then once.
3141         * sem_close.c: Adjust for sem_open change.
3142         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
3143         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
3144         * Makefile (tests): Add tst-sem7.
3145         * tst-sem7.c: New file.
3146
3147 2003-05-16  Roland McGrath  <roland@redhat.com>
3148
3149         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
3150         uninitialized variable braino.
3151
3152 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
3153
3154         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
3155         test for syscall availability.
3156
3157         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
3158         __no_posix_timers to -1 if the syscalls don't exist.
3159
3160         * pthread_join.c (pthread_join): Set tid field of the joined
3161         thread to -1.  This isn't necessary but helps to recognize some
3162         error conditions with almost no cost.
3163
3164         * allocatestack.c (FREE_P): Also negative values indicate an
3165         unused stack.
3166
3167         * unwind.c: Include <unistd.h>.
3168
3169 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
3170
3171         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
3172
3173 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
3174
3175         * Makefile (crti-objs, crtn-objs): New variables.
3176         (omit-deps, extra-objs): Add crtn.
3177         ($(objpfx)libpthread.so): Depend on both crti and crtn
3178         and links to them in multidir.
3179         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
3180
3181 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
3182
3183         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3184         (lll_mutex_unlock): Use atomic_exchange_rel.
3185
3186 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
3187
3188         * cond-perf.c (cons): Add missing locking around setting of alldone.
3189
3190 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
3191
3192         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
3193         related macros.
3194         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3195
3196 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
3197
3198         * tst-sem6.c: New file.
3199         * Makefile (tests): Add tst-sem6.
3200
3201         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
3202         Use atomic_exchange_rel instead of atomic_exchange.
3203         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
3204         Likewise.
3205
3206         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
3207         code for lll_futex_wait and lll_futex_wake in static apps.  Use
3208         vsyscall is possible.
3209
3210         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
3211         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
3212         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
3213         pthread_setaffinity_np.
3214         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
3215         and pthread_setaffinity_np.
3216         * Makefile (libpthread-routines): Add pthread_getaffinity and
3217         pthread_setaffinity.
3218
3219         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
3220         use it in case mmap to allocate the stack fails.
3221         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
3222         ARCH_MAP_FLAGS here.
3223         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
3224         ARCH_RETRY_MMAP.
3225
3226 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
3227
3228         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
3229         handler implementation.  It is now lockless in fork().
3230         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3231         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3232         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
3233         declare the __fork_*_lists.
3234         (struct fork_handler): Include pointers to all three functions.
3235         Add next, refcntr and need_signal elements.
3236         (__fork_handlers): New declaration.
3237         (__register_atfork_malloc): Remove declaration.
3238         (HAVE_register_atfork_malloc): Remove definition.
3239         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
3240         __pthread_child_handler variable.
3241         (__libc_pthread_init): Use __register_atfork instead of explicitly
3242         adding to the list.
3243         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
3244         and lll_futex_wake.
3245         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3246
3247         * unwind.c (unwind_cleanup): Print error message and then abort.  This
3248         function must never be reached.
3249
3250         * cond-perf.c: New file.
3251
3252 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
3253
3254         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
3255
3256 2003-05-04  Roland McGrath  <roland@redhat.com>
3257
3258         * Makefile ($(objpfx)../libc.so): New target.
3259
3260 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
3261
3262         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3263         (pthread_condattr_t): Size is only an int, don't use long for
3264         alignment.
3265         (pthread_mutexattr_t): Likewise.
3266         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3267         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3268         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3269
3270 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
3271
3272         * sysdeps/i386/tls.h: Define THREAD_ID.
3273         * sysdeps/ia64/tls.h: Likewise.
3274         * sysdeps/powerpc/tls.h: Likewise.
3275         * sysdeps/s390/tls.h: Likewise.
3276         * sysdeps/sh/tls.h: Likewise.
3277         * sysdeps/x86_64/tls.h: Likewise.
3278         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
3279         record ownership.
3280         * pthread_mutex_timedlock.c: Likewise.
3281         * pthread_mutex_trylock.c: Likewise.
3282         * pthread_mutex_unlock.c: Likewise.
3283         * pthread_rwlock_trywrlock.c: Likewise.
3284         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
3285         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3286         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3287         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3288
3289         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
3290         flag.
3291
3292 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
3293
3294         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3295         (__SIZEOF_PTHREAD_COND_T): Define to 48.
3296         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
3297         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3298         Make __align long long instead of long.
3299         (pthread_rwlock_t): Formatting.
3300         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3301         (pthread_rwlock_t): Formatting.
3302         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3303         (pthread_cond_t): Make __align long long instead of long.
3304         (pthread_rwlock_t): Move __flags field to the same position as in
3305         linuxthreads.
3306
3307 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
3308
3309         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
3310         * tst-rwlock7.c (do_test): Likewise.
3311
3312 2003-04-26  Roland McGrath  <roland@redhat.com>
3313
3314         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
3315
3316 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
3317
3318         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
3319         sizeof (struct pthread).
3320         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
3321         1 struct pthread.
3322         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
3323         to 0.
3324         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
3325         struct pthread.
3326         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
3327         to 32-bit bytes.
3328         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
3329         tcbp.
3330         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
3331         unneccessarily.
3332         (NO_TLS_OFFSET): Define.
3333         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
3334         add TLS_TCB_SIZE unnecessarily.
3335
3336 2003-04-22  Roland McGrath  <roland@redhat.com>
3337
3338         * Makeconfig (shared-thread-library): Reverse link order to work
3339         around linker bug.
3340
3341 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
3342
3343         * semaphore.h: Fix typo in comment.
3344
3345 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
3346
3347         * sysdeps/pthread/sigfillset.c: New file.
3348
3349         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
3350         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
3351         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
3352         * sysdeps/pthread/sigaction.c: Likewise.
3353         * sysdeps/pthread/sigprocmask.c: New file.
3354         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
3355         __SIGRTMIN+1.
3356         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3357         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
3358         in this case.
3359
3360 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
3361
3362         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3363         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
3364
3365         * sysdeps/unix/sysv/linux/unregister-atfork.c
3366         (__unregister_atfork): Don't free memory not allocated dynamically.
3367
3368         * semaphore.h: Remove __THROW marker from cancellation points.
3369         * nptl/sysdeps/pthread/pthread.h: Likewise.
3370
3371 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
3372
3373         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
3374         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
3375         __THROW.
3376
3377 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
3378
3379         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
3380
3381 2003-04-15  Roland McGrath  <roland@redhat.com>
3382
3383         * forward.c (__pthread_unwind): Tweak to avoid warning.
3384
3385 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
3386
3387         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
3388
3389 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
3390
3391         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
3392         overflow CFA advance instructions.
3393         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3394
3395 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
3396
3397         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
3398         * sysdeps/i386/pthread_spin_lock.c: Likewise.
3399         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
3400         defined.
3401
3402         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
3403         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
3404         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
3405         DW_CFA_advance_loc for .Laddl-.Lsubl.
3406
3407 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
3408
3409         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
3410         position-independent unwind data for static libraries.
3411         Add missing unwind info.  Add comments.
3412
3413         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
3414         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3415         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3416         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3417
3418 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
3419
3420         * Makefile: Make sure all cancellation points are compiled with
3421         exception and asynchronous unwind tables.
3422
3423         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
3424         which mishandles loading of global object addresses in PIC.
3425         (THREAD_SETMEM_NC): Likewise.
3426
3427 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3428
3429         * pthread.h: Define new data structure for cleanup buffer.  Declare
3430         new cleanup handler interfaces.
3431         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
3432         (struct pthread): Add cleanup_jmp_buf pointer.  Define
3433         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
3434         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
3435         it.  Declare old cleanup handler installation functions.
3436         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
3437         handling.
3438         * cleanup_defer.c: Likewise.
3439         * cleanup_compat.c: New file.  Old cleanup code.
3440         * cleanup_def_compat.c: New file.  Old cleanup code.
3441         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
3442         if own thread descriptor.
3443         * unwind.c: New file.
3444         * forward.c: Add __pthread_unwind.
3445         * init.c (pthread_functions): Add __pthread_unwind.
3446         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
3447         Add ptr___pthread_unwind.
3448         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
3449         and unwind function.
3450         * Makefile (libpthread-routines): Add cleanup_compat,
3451         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
3452         table generation if necessary.
3453         * version.c: Record whether unwind support is compiled in.
3454         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
3455         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
3456         handler interfaces.
3457         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
3458         complication to generate unwind information for syscall wrappers.
3459         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3460         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3461         __cleanup_fct_attribute.
3462
3463         * Makefile: Add rules to build and run tst-cleanup0.
3464         * tst-cleanup0.c: New file.
3465         * tst-cleanup0.expect: New file.
3466
3467         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
3468         caller.  Optimize to avoid often unecessary local variable.
3469
3470 2003-04-11  Roland McGrath  <roland@redhat.com>
3471
3472         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
3473         sets variable `multidir'; include that.
3474         (generated): Add it.
3475         ($(objpfx)$(multidir)/crti.o): New target.
3476         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
3477
3478 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3479
3480         * tst-attr2.c (do_test): Add cast to avoid warning.
3481         * tst-mutex4.c (do_test): Likewise.
3482
3483 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
3484
3485         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
3486         in child.
3487
3488 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
3489
3490         * Makefile (tests): Add tst-detach1.
3491         * tst-detach1.c: New file.
3492
3493 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
3494
3495         * sysdeps/pthread/pthread.h: Remove duplicate
3496         pthread_cleanup_{push,pop} definitions.
3497
3498         * tst-barrier2.c: Eliminate warnings.
3499         * tst-cancel4.c: Likewise.
3500         * tst-cond4.c: Likewise.
3501         * tst-cond6.c: Likewise.
3502         * tst-detach1.c: Likewise.
3503         * tst-rwlock4.c: Likewise.
3504         * tst-rwlock6.c: Likewise.
3505         * tst-rwlock7.c: Likewise.
3506         * tst-sem3.c: Likewise.
3507         * tst-spin2.c: Likewise.
3508         * tst-umask1.c: Likewise.
3509
3510 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
3511
3512         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
3513
3514 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
3515
3516         * descr.h (struct pthread): Move cancelhandling member to the front.
3517
3518 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
3519
3520         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
3521         malloc_parent, and malloc_child statically.
3522         (__register_atfork_malloc): New function.
3523         (free_mem): Don't free any of the malloc_* variables on the list.
3524         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
3525         Define HAVE_register_atfork_malloc.
3526
3527 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
3528
3529         * sysdeps/pthread/createthread.c (create_thread): Add some more
3530         comments explaining when to set multiple_threads and when not.
3531
3532         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3533         THREAD_ATOMIC_BIT_SET if not already defined.
3534         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3535         THREAD_ATOMIC_BIT_SET:
3536         * sysdeps/x86_64/tls.h: Likewise.
3537         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
3538         THREAD_ATOMIC_CMPXCHG_VAL.
3539         (_pthread_cleanup_pop_restore): Likewise.
3540         * cancellation.c (__pthread_enable_asynccancel): Likewise.
3541         (__pthread_enable_asynccancel_2): Likewise.
3542         (__pthread_disable_asynccancel): Likewise.
3543         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3544         (__libc_disable_asynccancel): Likewise.
3545         * init.c (sigcancel_handler): Likewise.
3546         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
3547         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
3548
3549 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
3550
3551         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
3552         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3553         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
3554         * Makefile (tests): Add tst-cancel11.
3555         * tst-cancel11.c: New file.
3556
3557 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
3558
3559         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
3560         round, not the first.  Use specific_used flag instead of local
3561         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
3562         (__free_tcb): Don't call deallocate_tsd here.
3563         (start_thread): Call deallocate_tsd here.
3564         * pthread_setspecific.c: Set specific_used flag really only when
3565         needed.
3566         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
3567         * tst-tsd3.c: New file.
3568         * tst-tsd4.c: New file.
3569
3570 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3571
3572         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
3573         Use atomic_exchange_and_add instead of __lll_add.
3574         (__lll_mutex_timedlock): Likewise.
3575         Patch by Ian Wienand.
3576
3577 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
3578
3579         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3580         (SINGLE_THREAD_P): Fix typo.
3581         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
3582
3583 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3584
3585         * Makefile (tests): Add tst-align.
3586         * tst-align.c: New file.
3587         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
3588
3589         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
3590         function correctly.
3591
3592         * tst-tsd2.c: Add casts to avoid warnings.
3593
3594 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
3595
3596         * descr.h (struct pthread): Move most often used elements to the front.
3597
3598 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
3599
3600         * Makefile (libpthread-routines): Add pthread_atfork.
3601         (libpthread-static-only-routines): Add pthread_atfork.
3602
3603 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3604
3605         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
3606         of TLS_DTV_AT_TP.
3607         (INSTALL_DTV): Add parens.
3608         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
3609         Use passed descr instead of THREAD_SELF.
3610         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
3611         (__lll_mutex_timedlock_wait): Correct expected value after
3612         spurious wakeup.
3613         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
3614         Release lock before waking up the waiters.
3615         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
3616         criteria.  Reorderstruct passed to cleanup handler.  Fix
3617         handling of cancellation and failung pthread_mutex_unlock call.
3618         Use __pthread_enable_asynccancel_2 instead of
3619         __pthread_enable_asynccancel.
3620         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3621         Return result of lock re-get if it fails.
3622         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
3623         for __pthread_cleanup_push.
3624         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
3625         completely broken rwlock implementation.
3626         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3627         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3628         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3629         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3630         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3631         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
3632         versioned_symbol macro.
3633         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
3634         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
3635
3636 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
3637
3638         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
3639         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
3640         and __helper_tid.
3641         (struct timer): Remove th and bar field.
3642         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
3643         debugging code.  Create only one helper thread.
3644         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
3645         helper thread.
3646         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3647         Renamed.  Define statically.  Use thread info from siginfo.
3648         (__helper_once): New variable.
3649         (__helper_tid): New variable.
3650         (__reset_helper_control): New function.
3651         (__start_helper_thread): New function.
3652
3653         * pthread_create.c (start_thread): Don't use setjmp inside
3654         __builtin_expect to work around gcc bug.
3655
3656         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
3657         timer_delete syscall fails, but not with ENOSYS, set
3658         __no_posix_timers.
3659
3660         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
3661         (timer_settime): Fix typo.
3662         * sysdeps/unix/sysv/linux/timer_getoverr.c
3663         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
3664
3665 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
3666
3667         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
3668         offset of cleanupbuf.__prev.
3669
3670 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
3671
3672         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
3673         of included file.
3674
3675 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
3676
3677         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
3678         NULL provide default definition to syscall.
3679
3680 2003-03-25  Roland McGrath  <roland@redhat.com>
3681
3682         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
3683         (timer_id2ptr): Fix typo.
3684
3685 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
3686
3687         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
3688         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
3689         * sysdeps/ia64/pthreaddef.h: Likewise.
3690         * sysdeps/powerpc/pthreaddef.h: Likewise.
3691         * sysdeps/s390/pthreaddef.h: Likewise.
3692         * sysdeps/sh/pthreaddef.h: Likewise.
3693         * sysdeps/x86_64/pthreaddef.h: Likewise.
3694         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
3695         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
3696         being changed.
3697         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3698         SIGTIMER is not unblocked.
3699         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
3700         RT signal taken.
3701         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
3702         be send.
3703         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
3704         pass pointer through as ID.
3705         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
3706         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
3707         * sysdeps/unix/sysv/linux/timer_create.c: New file.
3708         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
3709         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
3710         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
3711         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
3712         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
3713         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
3714         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
3715         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
3716         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
3717         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
3718         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
3719         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
3720         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
3721         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
3722         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
3723         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
3724         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
3725         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
3726         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
3727         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
3728         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
3729         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
3730         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
3731         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
3732         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
3733         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
3734         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
3735         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
3736         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
3737         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
3738
3739         * pthreadP.h: Remove FRAME_LEFT definition.
3740         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
3741         already left frame.  Programs which have this problem are not POSIX
3742         compliant.
3743         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
3744
3745 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
3746
3747         * sysdeps/pthread/tst-timer.c: Check return values of the
3748         functions we test.
3749
3750 2003-03-23  Roland McGrath  <roland@redhat.com>
3751
3752         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
3753         * tst-tls3mod.c: Likewise.
3754         * tst-tls1.c: Likewise.
3755         * tst-tls2.c: Likewise.
3756
3757         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
3758         undefined behavior.
3759
3760         * tst-join5.c (tf1, tf2): Add a cast.
3761
3762         * Makeconfig (includes): Append -I$(..)nptl to this variable.
3763
3764         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
3765         Don't test anything.
3766         * tst-cond4.c: Likewise.
3767         * tst-cond6.c: Likewise.
3768         * tst-flock2.c: Likewise.
3769         * tst-mutex4.c: Likewise.
3770         * tst-rwlock4.c: Likewise.
3771         * tst-signal1.c: Likewise.
3772         * tst-spin2.c: Likewise.
3773         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
3774
3775         * tst-mutex4.c: Use test-skeleton.c.
3776         * tst-spin2.c: Likewise.
3777         * tst-sysconf.c: Likewise.
3778         * tst-barrier2.c: Likewise.
3779         * tst-cond4.c: Likewise.
3780         * tst-cond6.c: Likewise.
3781         * tst-rwlock4.c: Likewise.
3782         * tst-unload.c: Likewise.
3783         * tst-flock2.c (do_test): Use return instead of exit.
3784
3785 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
3786
3787         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
3788
3789 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
3790
3791         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3792         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
3793         instead of __lll_compare_and_swap.
3794         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3795         Likewise.
3796         Removed definition if __lll_compare_and_swap.
3797
3798         * cancellation.c: Adjust for new form of compare&exchange macros.
3799         * cleanup_defer.c: Likewise.
3800         * init.c: Likewise.
3801         * libc-cancellation.c: Likewise.
3802         * old_pthread_cond_broadcast.c: Likewise.
3803         * old_pthread_cond_signal.c: Likewise.
3804         * old_pthread_cond_timedwait.c: Likewise.
3805         * old_pthread_cond_wait.c: Likewise.
3806         * pthread_cancel.c: Likewise.
3807         * pthread_create.c: Likewise.
3808         * pthread_detach.c: Likewise.
3809         * pthread_join.c: Likewise.
3810         * pthread_key_delete.c: Likewise.
3811         * pthread_setcancelstate.c: Likewise.
3812         * pthread_setcanceltype.c: Likewise.
3813         * pthread_timedjoin.c: Likewise.
3814         * pthread_tryjoin.c: Likewise.
3815         * sysdeps/pthread/createthread.c: Likewise.
3816
3817 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
3818
3819         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
3820         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
3821         definitions.  Replace uses with calls to atomic_* functions.
3822         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3823         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
3824         __lll_test_and_set calls with atomic_exchange_and_add and
3825         atomic_exchange calls respectively.
3826         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
3827         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
3828         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
3829         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3830         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
3831         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
3832         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
3833
3834         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
3835         returns the old value.
3836
3837 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
3838
3839         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
3840         int for variable OLDVAL and correct inline assembler contraint.
3841         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
3842         type int for variable OLD.
3843
3844         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
3845         only for s390-32.
3846         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3847         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
3848         instead of multiple_threads field in the TCB.
3849
3850 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
3851
3852         * sysdeps/i386/i686/bits/atomic.h: Removed.
3853         * sysdeps/i386/i586/bits/atomic.h: Removed.
3854         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
3855         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
3856         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
3857         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
3858         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
3859         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
3860         * atomic.h: Removed.  Moved to glibc.
3861
3862         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
3863         support for clock selection.
3864
3865         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
3866         signalling waiters.
3867
3868 2003-03-18  Roland McGrath  <roland@redhat.com>
3869
3870         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3871         Add __lll_rel_instr first.  Add memory clobber.
3872         (lll_mutex_unlock): Use __lll_test_and_set.
3873         From Paul Mackerras <paulus@samba.org>.
3874
3875         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
3876         unconditionally.
3877         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3878         (SINGLE_THREAD_P):  Add `header.' prefix.
3879         From Paul Mackerras <paulus@samba.org>.
3880
3881         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
3882         pthread_timedjoin_np to ...
3883         (libpthread: GLIBC_2.3.3): ... here.
3884         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
3885
3886         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3887         Avoid shadowing VAL variable.
3888
3889         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3890         New macro.
3891
3892 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
3893
3894         * Makefile (tests): Add tst-cond11.
3895         * tst-cond11.c: New file.
3896
3897         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
3898         struct passed to cleanup handler to eliminate one more
3899         instruction.
3900         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3901
3902         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3903         (pthrad_cond_t): Replace __unused field with __clock.
3904
3905         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
3906         waken all waiters in cleanup handler.
3907         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3908         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3909
3910         * pthread_condattr_getclock.c: New file.
3911         * pthread_condattr_setclock.c: New file.
3912         * sysdeps/pthread/pthread.h: Declare these new functions.
3913         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
3914         * Makefile (libpthread-routines): Add the new functions.
3915         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
3916         Renamed field to value.  Document use of the bits.
3917         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
3918         change.
3919         * pthread_condattr_setpshared.c: Likewise.
3920         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
3921         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
3922         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3923         Add __clock field.
3924         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3925         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3926         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3927         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3928         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3929         Implement clock selection.
3930         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3931         * pthread-errnos.sym: Add ENOSYS.
3932         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3933         _POSIX_CLOCK_SELECTION.
3934         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3935
3936         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
3937         invalid .size directive.
3938
3939 2003-03-17  Roland McGrath  <roland@redhat.com>
3940
3941         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3942         Formatting tweaks.
3943
3944 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3945
3946         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
3947         Use __lll_add instead of spelling it out.  Use protected symbol names.
3948         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
3949         Use __lll_add.
3950         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
3951         Renamed from lll_compare_and_swap.  Use new name where necessary.
3952         (__lll_add): Defined.
3953         (__lll_dec_if_positive): Defined.
3954         (__lll_test_and_set): Defined.
3955         * sysdeps/ia64/pthread_spin_init.c: Removed.
3956         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
3957         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
3958         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
3959         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
3960         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
3961         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
3962         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
3963         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
3964         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
3965         __sync_lock_release_si.
3966         Patch by Jakub Jelinek.
3967
3968         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
3969         Fix timeout handling.
3970         (__lll_timedwait_tid): Likewise.
3971         (lll_unlock_wake_cb): Wake up other waiters if necessary.
3972         Patch by Jakub Jelinek.
3973
3974         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
3975
3976 2003-03-17  Roland McGrath  <roland@redhat.com>
3977
3978         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
3979         * sysdeps/pthread/pthread_spin_init.c: New file.
3980         * sysdeps/pthread/pthread_spin_unlock.c: New file.
3981         * sysdeps/powerpc/Makefile: New file.
3982         * sysdeps/powerpc/pthread_spin_lock.c: New file.
3983         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
3984         * sysdeps/powerpc/pthreaddef.h: New file.
3985         * sysdeps/powerpc/tcb-offsets.sym: New file.
3986         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
3987         * sysdeps/powerpc/tls.h: New file.
3988         * sysdeps/powerpc/bits/atomic.h: New file.
3989         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
3990         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
3991         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
3992
3993         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
3994         * sysdeps/unix/sysv/linux/sem_post.c: New file.
3995         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
3996         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
3997         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
3998         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
3999         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
4000         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
4001         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
4002         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
4003         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
4004         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
4005         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
4006         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
4007         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
4008
4009         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
4010         not gettimeofday.
4011         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
4012         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4013         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
4014         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
4015         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4016
4017 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
4018
4019         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
4020         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4021         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4022         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4023         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
4024
4025 2003-03-16  Roland McGrath  <roland@redhat.com>
4026
4027         * tst-fork4.c: Include <string.h>.
4028         * tst-signal2.c: Likewise.
4029         * tst-mutex5.c (do_test): exit -> return.
4030         * tst-mutex2.c: Include <stdlib.h>.
4031
4032 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
4033
4034         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4035         (__lll_mutex_timedlock_wait): Correct expected value after
4036         spurious wakeup.  Otherwise we would never wait again.
4037
4038         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
4039         zone versus inline asm stupidity.  Use correct instructions.
4040
4041         * tst-rwlock6.c: Add some more status output.
4042
4043 2003-03-15  Roland McGrath  <roland@redhat.com>
4044
4045         * sysdeps/pthread/configure.in: New file.
4046         * sysdeps/pthread/configure: New file (generated).
4047
4048 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
4049
4050         * allocatestack.c (allocate_stack): Store the exact stack size of
4051         user allocated stacks.
4052
4053 2003-03-15  Jakub Jelinek  <jakub@redhat.com>