Update.
[glibc.git] / nptl / ChangeLog
blob136cdfcd20043e6a71c5ee4faf65b5bc2275559b
1 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
4         test fails, remove message queue.
5         (tf_msgsnd): Likewise.
7 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
9         * tst-clock1.c: Change #ifdef to #if defined.
10         * tst-clock2.c: Likewise.
11         * tst-cond11.c: Likewise.
13 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
15         * sysdeps/pthread/timer_create.c (timer_create): Use
16         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
17         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
18         THREAD_CPUTIME.
20 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
22         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
23         _POSIX_THREAD_CPUTIME): Define to 0.
25 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
27         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
28         and _POSIX_THREAD_CPUTIME to zero.
29         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
30         * tst-barrier2.c: Fix testing for POSIX feature.
31         * tst-clock1.c: Likewise.
32         * tst-clock2.c: Likewise.
33         * tst-cond11.c: Likewise.
34         * tst-cond4.c: Likewise.
35         * tst-cond6.c: Likewise.
36         * tst-flock2.c: Likewise.
37         * tst-mutex4.c: Likewise.
38         * tst-mutex9.c: Likewise.
39         * tst-rwlock12.c: Likewise.
40         * tst-rwlock4.c: Likewise.
41         * tst-signal1.c: Likewise.
42         * tst-spin2.c: Likewise.
43         * sysdeps/pthread/posix-timer.h: Likewise.
44         * sysdeps/pthread/timer_create.c: Likewise.
45         * sysdeps/pthread/timer_routines.c: Likewise.
47 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
49         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
50         (__lll_mutex_timedlock_wait): Address futex correctly.
52         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
53         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
54         make sure 2 is stored in the futex and we looked at the old value.
55         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
56         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
57         which might very well made the code not working at all before.
58         [BZ #417]
60 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
62         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
63         allow SIGSETXID to be sent.
64         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
65         for SIGSETXID to be defined.
66         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
67         SIGSETXID cannot be blocked.
69         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
70         Add __extension__ to long long types.
71         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
72         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
73         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
74         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
75         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
76         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
77         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
79 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
81         * descr.h (struct pthread): Add stopped_start field.
82         * sysdeps/pthread/createthread.c (create_thread): Set
83         start_stopped flag in descriptor for new thread appropriately.
84         * pthread_create.c (start_thread): Only take lock to be stopped on
85         startup if stopped_start flag says so.
87 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
89         * pthread_create.c (__pthread_create_2_1): Remember whether thread
90         is created detached and if yes, do not try to free the stack in case
91         the thread creation failed.
92         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
93         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
94         case there has been no error.  [BZ #405]
96         * pthread_create.c (start_thread): Don't wait for scheduler data
97         etc to be set at the beginning of the function.  The cancellation
98         infrastructure must have been set up.  And enable async
99         cancellation before potentially going to sleep.  [BZ #401]
101 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
103         * Versions: Remove exports for pthread_set*id_np functions.
104         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
105         for now.
106         * Makefile: Don't build pthread_set*id code for now.
108 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
110         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
111         internal use.
112         * allocatestack.c (__nptl_setxid): New function.
113         * descr.h (struct xid_command): Define type.
114         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
115         (sighandler_setxid): New function.
116         (__pthread_initialize_minimal): Register sighandler_setxid for
117         SIGCANCEL.
118         * pt-allocrtsig.c: Update comment.
119         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
120         Declare __nptl_setxid.
121         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
122         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
123         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
124         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
125         and pthread_setresuid_np.
126         * pthread_setgid_np.c: New file.
127         * pthread_setuid_np.c: New file.
128         * pthread_setegid_np.c: New file.
129         * pthread_seteuid_np.c: New file.
130         * pthread_setregid_np.c: New file.
131         * pthread_setreuid_np.c: New file.
132         * pthread_setresgid_np.c: New file.
133         * pthread_setresuid_np.c: New file.
134         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
135         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
136         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
137         and pthread_setresuid_np.
138         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
139         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
140         pthread_setregid, and pthread_setresgid.
142 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
144         * allocatestack.c (allocate_stack): Return EAGAIN instead of
145         ENOMEM when out of memory.
147 2004-09-10  Roland McGrath  <roland@redhat.com>
149         [BZ #379]
150         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
151         code, since we don't try to use the broken CLONE_STOPPED any more.
152         * pthread_create.c (start_thread): Likewise.
154 2004-09-15  Richard Henderson  <rth@redhat.com>
156         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
158 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
160         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
161         (__libc_unwind_longjmp): Delete macro and declare as function.
162         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
163         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
164         nptl directory.
165         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
166         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
167         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
169 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
171         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
172         for __USE_XOPEN2K.
173         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
174         types also for __USE_XOPEN2K.
175         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
176         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
177         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
178         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
179         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
180         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
181         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
182         [BZ #320]
184 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
186         * sysdeps/pthread/pthread.h
187         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
188         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
189         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
190         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
191         [BZ #375]
193 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
195         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
196         PSEUDO to be used with . prefix.
198         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
199         Use atomic_increment instead of atomic_exchange_and_add.
200         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
201         Likewise.
202         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
203         Likewise.
204         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
205         Likewise.
207         * allocatestack.c (allocate_stack): Use atomic_increment_val
208         instead of atomic_exchange_and_add.
209         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
210         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
211         Likewise.
212         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
213         Likewise.
215         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
216         the initialization function might throw.
218 2005-09-05  Richard Henderson  <rth@redhat.com>
220         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
221         Move definition inside libpthread, libc, librt check.  Provide
222         definition for rtld.
224 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
226         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
227         * sysdeps/i386/jmpbuf-unwind.h: Likewise
228         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
229         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
230         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
231         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
232         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
233         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
234         * unwind.c: Use it.
236         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
237         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
238         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
239         Likewise.
240         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
241         Decrement __nwaiters.  If pthread_cond_destroy has been called and
242         this is the last waiter, signal pthread_cond_destroy caller and
243         avoid using the pthread_cond_t structure after unlock.
244         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
245         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
246         Read clock type from the least significant bits of __nwaiters instead
247         of __clock.
248         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
249         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
251 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
253         [BZ #342]
254         * Makefile (tests): Add tst-cond20 and tst-cond21.
255         * tst-cond20.c: New test.
256         * tst-cond21.c: New test.
257         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
258         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
259         it unsigned int.
260         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
261         Likewise.
262         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
263         (pthread_cond_t): Likewise.
264         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
265         Likewise.
266         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
267         Likewise.
268         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
269         Likewise.
270         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
271         (cond_nwaiters): New.
272         (clock_bits): New.
273         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
274         if there are waiters not signalled yet.
275         Wait until all already signalled waiters wake up.
276         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
277         __nwaiters.  If pthread_cond_destroy has been called and this is the
278         last waiter, signal pthread_cond_destroy caller and avoid using
279         the pthread_cond_t structure after unlock.
280         (__pthread_cond_wait): Increment __nwaiters in the beginning,
281         decrement it when leaving.  If pthread_cond_destroy has been called
282         and this is the last waiter, signal pthread_cond_destroy caller.
283         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
284         Likewise.  Read clock type from the least significant bits of
285         __nwaiters instead of __clock.
286         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
287         whether clock ID can be encoded in COND_CLOCK_BITS bits.
288         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
289         clock type just from the last COND_CLOCK_BITS bits of value.
290         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
291         instead of __clock, just from second bit of condattr's value.
293 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
295         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
296         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
297         != 64.
298         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
300 2004-08-15  Roland McGrath  <roland@frob.com>
302         * pthread_atfork.c: Update copyright terms including special exception
303         for these trivial files, which are statically linked into executables
304         that use dynamic linking for the significant library code.
306 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
308         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
309         pthread_rwlock_rdlock.
310         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
311         Decrease __nr_readers_queued after reacquiring lock.
312         * sysdeps/pthread/pthread_rwlock_timedrdlock
313         (pthread_rwlock_timedrdlock): Likewise.
314         Reported by Bob Cook <bobcook47@hotmail.com>.
316 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
318         * tst-rwlock14.c (tf): Read main thread handle from *ARG
319         before pthread_barrier_wait.
321 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
323         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
324         Remove unnecessary exception handling data.
326 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
328         [BZ #284]
329         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
330         instead of clockid_t.
332 2004-07-21  Roland McGrath  <roland@redhat.com>
334         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
336 2004-07-19  Roland McGrath  <roland@redhat.com>
338         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
340 2004-07-02  Roland McGrath  <roland@redhat.com>
342         * configure: Don't exit.
344 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
346         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
347         (__pthread_cond_timedwait): Check for invalid nanosecond in
348         timeout value.
350 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
352         * Makefile: Add rules to build and run tst-fini1.
353         * tst-fini1.c: New file.
354         * tst-fini1mod.c: New file.
356 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
358         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
359         if no cancellation support is needed.
360         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
361         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
362         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
363         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
364         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
365         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
366         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
367         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
368         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
370         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
371         only if not already defined.
373 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
375         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
376         constraint "m" instead of "0" for futex.
378         * shlib-versions: Add powerpc64-.*-linux.*.
380 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
382         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
383         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
384         for valid tv_nsec.
385         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
386         1 billion and 64-bit tv_nsec which is valid when truncated to 32
387         bits.
389 2004-06-29  Roland McGrath  <roland@redhat.com>
391         * Banner: NPTL no longer has its own version number.
392         * Makefile (nptl-version): Variable removed.
393         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
394         using $(version), the glibc version number.
396 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
398         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
399         Fix branch offset for a PLT entry.
400         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
401         Likewise.
402         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
403         Likewise.
404         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
405         Likewise.
406         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
407         Likewise.
409 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
411         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
412         unconditionally.
414 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
416         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
417         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
418         instead of tv_sec.
419         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
420         (pthread_rwlock_timedrdlock): Likewise.
422 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
424         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
425         Set __r7 to val, not mutex.
427 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
429         * Makefile: Add rules to build tst-rwlock14.
430         * tst-rwlock14.c: New file.
432 2004-06-24  Boris Hu  <boris.hu@intel.com>
434         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
435         check.
436         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
438 2004-06-19  Andreas Jaeger  <aj@suse.de>
440         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
441         assembler in last patch.
443 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
445         * sysdeps/pthread/pthread_cond_timedwait.c
446         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
447         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
448         (__pthread_cond_timedwait): Check for invalid nanosecond in
449         timeout value.
450         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
451         * tst-cond19.c: New file.
452         * Makefile: Add rules to build and run tst-cond19.
454 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
456         * tst-context1.c (GUARD_PATTERN): Defined.
457         (tst_context_t): Define struct containing ucontext_t & guard words.
458         (ctx): Declare as an array of tst_context_t.
459         (fct): Verify uc_link & guard words are still valid.
460         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
462 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
464         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
465         Add __data.__futex field, reshuffle __data.__clock.
466         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
467         (__pthread_cond_signal): Increment __futex at the same time as
468         __wakeup_seq or __total_seq.  Pass address of __futex instead of
469         address of low 32-bits of __wakeup_seq to futex syscall.
470         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
471         (__pthread_cond_wait): Likewise.  Pass __futex value from before
472         releasing internal lock to FUTEX_WAIT.
473         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
474         (__pthread_cond_timedwait): Likewise.
475         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
476         (FUTEX_CMP_REQUEUE): Define.
477         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
478         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
479         Pass __futex value from before the unlock and __futex address instead
480         of address of low 32-bits of __wakeup_seq to futex syscall.
481         Fallback to FUTEX_WAKE all on any errors.
483 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
485         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
486         comment typo.
487         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
488         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
489         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
490         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
491         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
493 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
495         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
496         Add memory clobber to inline assembly.
497         (__lll_mutex_trylock): Likewise.
498         (__lll_mutex_cond_trylock): Likewise.
500 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
502         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
503         Pass val argument as 6th system call argument in %r7.
505 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
507         * Makefile (tests): Add tst-cond16.
508         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
509         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
510         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
511         Add __data.__futex field, reshuffle __data.__clock.
512         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
513         (__pthread_cond_signal): Increment __futex at the same time as
514         __wakeup_seq or __total_seq.  Pass address of __futex instead of
515         address of low 32-bits of __wakeup_seq to futex syscall.
516         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
517         (__pthread_cond_wait): Likewise.  Pass __futex value from before
518         releasing internal lock to FUTEX_WAIT.
519         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
520         (__pthread_cond_timedwait): Likewise.
521         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
522         (FUTEX_CMP_REQUEUE): Define.
523         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
524         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
525         Pass __futex value from before the unlock and __futex address instead
526         of address of low 32-bits of __wakeup_seq to futex syscall.
527         Fallback to FUTEX_WAKE all on any errors.
528         * sysdeps/unix/sysv/linux/alpha/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/alpha/bits/pthreadtypes.h (pthread_cond_t):
533         Add __data.__futex field, reshuffle __data.__clock.
534         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
535         Define.
536         (lll_futex_requeue): Add val argument, return 1 unconditionally
537         for the time being.
538         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
539         Add __data.__futex field, reshuffle __data.__clock.
540         * sysdeps/unix/sysv/linux/powerpc/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/powerpc/bits/pthreadtypes.h
545         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
546         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
547         Define.
548         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
549         internally.  Return non-zero if error, zero if success.
550         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
551         Add __data.__futex field, reshuffle __data.__clock.
552         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
553         Define.
554         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
555         internally.  Return non-zero if error, zero if success.
556         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
557         Add __data.__futex field, reshuffle __data.__clock.
558         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
559         Add __data.__futex field, reshuffle __data.__clock.
560         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
561         Increment __futex at the same time as __wakeup_seq or __total_seq.
562         Pass address of __futex instead of address of low 32-bits of
563         __wakeup_seq to futex syscall.
564         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
565         Pass __futex value from before releasing internal lock
566         to FUTEX_WAIT.
567         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
568         Likewise.  Avoid unnecessary shadowing of variables.
569         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
570         Set __futex to 2 * __total_seq.  Pass __futex value from before the
571         unlock and __futex address instead of address of low 32-bits of
572         __wakeup_seq to futex_requeue macro, adjust for new return value
573         meaning.
574         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
575         (__pthread_cond_signal): Increment __futex at the same time as
576         __wakeup_seq or __total_seq.  Pass address of __futex instead of
577         address of low 32-bits of __wakeup_seq to futex syscall.
578         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
579         (__pthread_cond_wait): Likewise.  Pass __futex value from before
580         releasing internal lock to FUTEX_WAIT.
581         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
582         (__pthread_cond_timedwait): Likewise.
583         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
584         (FUTEX_CMP_REQUEUE): Define.
585         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
586         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
587         Pass __futex value from before the unlock and __futex address instead
588         of address of low 32-bits of __wakeup_seq to futex syscall.
589         Fallback to FUTEX_WAKE all on any errors.
591 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
593         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
594         Add nop to align the end of critical section.
595         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
597 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
599         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
600         Add __broadcast_seq field.
601         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
602         all waiters as woken with woken_seq and bump broadcast counter.
603         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
604         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
605         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
606         Comment typo fixes.  Avoid returning -ETIMEDOUT.
608 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
610         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
611         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
612         Reported by Kaz Kojima.
614 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
616         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
618 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
620         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
621         __broadcast_seq with bc_seq after acquiring internal lock instead of
622         before it.
624 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
626         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
627         compilation.
628         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
629         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
630         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
631         (pthread_cond_t): Add __data.__broadcast_seq field.
632         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
633         (FRAME_SIZE): Define.
634         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
635         Comment typo fixes.
636         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
637         Define.
638         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
639         typo fixes.
640         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
641         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
642         fixes.
644 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
646         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
647         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
648         Add __broadcast_seq field.
649         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
650         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
651         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
652         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
653         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
654         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
655         all waiters as woken with woken_seq and bump broadcast counter.
656         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
657         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
658         __broadcast_seq field.
659         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
660         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
661         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
662         * pthread_cond_init.c: Initialize __broadcast_seq field.
663         * Makefile (tests): Add tst-cond17 and tst-cond18.
664         Add .NOTPARALLEL goal.
665         * tst-cond16.c: New file.  From Jakub.
666         * tst-cond17.c: New file.  From Jakub.
667         * tst-cond18.c: New file.  From Jakub.
669 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
671         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
672         unwind info.
674         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
675         Parametrize frame size.  Correct some unwind info.
676         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
678 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
680         * tst-stack3.c: Note testing functionality beyond POSIX.
682 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
684         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
685         Change conditional from ifdef to if.
687 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
689         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
690         SYSDEP_CANCEL_ERROR): Define.
691         (PSEUDO): Use it.
693 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
695         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
697 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
699         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
701 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
703         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
704         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
705         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
706         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
708 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
710         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
711         thread has all signals blocked.
713 2004-04-18  Andreas Jaeger  <aj@suse.de>
715         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
716         (SEM_VALUE_MAX): Add missing brace.
718 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
720         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
721         in rt subdir.
722         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
723         * sysdeps/pthread/tst-mqueue8x.c: New test.
724         * tst-cancel4.c: Update comment about message queues.
726         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
727         return it_value { 0, 0 }.
728         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
729         like SIGEV_SIGNAL.
730         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
731         assertion for SIGEV_NONE.
732         (thread_attr_compare): Compare all attributes, not just a partial
733         subset.
735 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
737         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
739 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
741         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
742         Just use a plain number.
743         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
744         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
745         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
746         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
747         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
748         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
749         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
751 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
753         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
754         frame info.
755         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
757 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
759         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
760         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
761         of calling sigwaitinfo.
763 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
765         * allocatestack.c (allocate_stack): Set reported_guardsize
766         unconditionally.
767         * pthread_getattr_np.c (pthread_getattr_np): Use
768         reported_guardsize instead of guardsize.
769         * descr.h (struct pthread): Add reported_guardsize field.
771 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
773         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
775 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
777         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
779 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
781         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
782         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
783         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
784         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
785         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
786         Define.
787         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
788         (_POSIX_MESSAGE_PASSING): Define.
789         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
790         (_POSIX_MESSAGE_PASSING): Define.
791         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
792         (_POSIX_MESSAGE_PASSING): Define.
794 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
796         * tst-context1.c (fct): Check whether correct stack is used.
798 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
800         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
801         matching constraints for asm mem parameters.
803         * tst-clock2.c (tf): Don't define unless needed.
805 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
807         * Makefile (link-libc-static): Use $(static-gnulib) instead of
808         $(gnulib).
810 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
812         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
813         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
814         * pthreadP.h: Declare __nptl_deallocate_tsd.
815         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
816         Adjust caller.
818         * Makefile (tests): Add tst-tsd5.
819         * tst-tsd5.c: New file.
821 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
823         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
824         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
825         is SHLIB_COMPAT check.
826         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
827         (__pthread_attr_getaffinity_old): Likewise.
828         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
829         (__pthread_getaffinity_old): Likewise.
830         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
831         (__pthread_setaffinity_old): Likewise.
833 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
835         * allocatestack.c (_make_stacks_executable): Call
836         _dl_make_stack_executable first.
838 2004-03-24  Roland McGrath  <roland@redhat.com>
840         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
841         constraint instead of "0".
843 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
845         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
846         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
848         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
849         code to avoid warning.
851 2004-03-24  Andreas Jaeger  <aj@suse.de>
853         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
854         (__pthread_attr_setaffinity_old): Remove const.
856 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
858         * sysdeps/unix/sysv/linux/smp.h: New file.
859         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
860         * init.c: Define __is_smp.
861         (__pthread_initialize_minimal_internal): Call is_smp_system to
862         initialize __is_smp.
863         * pthreadP.h: Declare __is_smp.
864         Define MAX_ADAPTIVE_COUNT is necessary.
865         * pthread_mutex_init.c: Add comment regarding __spins field.
866         * pthread_mutex_lock.c: Implement adaptive mutex type.
867         * pthread_mutex_timedlock.c: Likewise.
868         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
869         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
870         Add __spins field.
871         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
872         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
873         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
874         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
875         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
876         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
877         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
878         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
879         lll_mutex_cond_trylock.
880         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
881         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
882         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
883         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
884         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
885         Define BUSY_WAIT_NOP.
886         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
887         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
889         * tst-mutex5.c: Add support for testing adaptive mutexes.
890         * tst-mutex7.c: Likewise.
891         * tst-mutex5a.c: New file.
892         * tst-mutex7a.c: New file.
893         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
895         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
896         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
897         vgettimeofday call might destroy the content.
899         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
900         @pause in the loop.
902         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
903         No need to restrict type of ret.  Make it int.  Add comment.
905         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
906         Remove unnecessary setne instruction.
908 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
910         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
911         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
912         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
913         If realloc fails, break out of the loop.
915 2004-03-20  Andreas Jaeger  <aj@suse.de>
917         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
918         (__pthread_setaffinity_old): Fix interface.
919         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
920         (__pthread_getaffinity_old): Likewise.
922         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
923         (__pthread_setaffinity_new): Remove duplicate declaration.
925 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
927         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
928         the return value to a safe register.
929         (CDISABLE): Set the function argument correctly.
931 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
933         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
934         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
935         Rewrite so that only one locked memory operation per round is needed.
936         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
937         (pthread_barrier_wait): After wakeup, release lock only when the
938         last thread stopped using the barrier object.
939         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
940         (__pthread_cond_wait): Don't store mutex address if the current
941         value is ~0l.  Add correct cleanup support and unwind info.
942         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
943         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
944         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
945         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
946         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
947         Add correct cleanup support and unwind info.
948         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
949         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
950         information for syscall wrappers.
952 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
954         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
955         cpusetsize field, remove next.
956         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
957         parameter for size of the CPU set.
958         (pthread_setaffinity_np): Likewise.
959         (pthread_attr_getaffinity_np): Likewise.
960         (pthread_attr_setaffinity_np): Likewise.
961         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
962         interface change, keep compatibility code.
963         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
964         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
965         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
966         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
967         __pthread_getaffinity_np.
968         * Versions: Add version for changed interfaces.
969         * tst-attr3.c: Adjust test for interface change.
970         * pthread_getattr_np.c: Query the kernel about the affinity mask with
971         increasing buffer sizes.
972         * pthread_attr_destroy.c: Remove unused list handling.
973         * pthread_attr_init.c: Likewise.
975 2004-03-17  Roland McGrath  <roland@redhat.com>
977         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
978         first argument to clock_getres so we ever enable kernel timers.
980 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
982         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
984 2004-03-12  Richard Henderson  <rth@redhat.com>
986         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
987         oldvalue from CENABLE to CDISABLE.
989 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
991         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
992         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
993         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
994         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
996 2004-03-11  Richard Henderson  <rth@redhat.com>
998         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
999         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
1000         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
1002 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1004         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
1005         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
1006         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
1008 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1010         * forward.c (__pthread_cond_broadcast_2_0,
1011         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
1012         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
1013         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
1015 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1017         * sysdeps/sh/tcb-offsets.sym: Add PID.
1018         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
1019         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
1021 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
1023         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
1024         include <sysdep-cancel.h>, vfork is no cancellation point.
1025         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
1026         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
1027         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
1029 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
1031         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
1032         libc_hidden_def.
1033         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
1034         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
1035         Likewise.
1036         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
1037         Likewise.
1038         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
1039         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
1040         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
1041         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
1042         of DO_CALL_VIA_BREAK.  Work around a gas problem.
1044         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
1045         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
1046         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
1047         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
1048         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
1049         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
1051         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
1052         a local register for saving old PID.  Negate PID in parent upon exit.
1054         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
1055         tcb-offsets.h.
1056         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1057         before syscall, set to the old value in the parent afterwards.
1058         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
1059         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
1060         tcb-offsets.h.
1061         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1062         before syscall, set to the old value in the parent afterwards.
1063         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
1064         * sysdeps/s390/tcb-offsets.sym: Add PID.
1066         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
1067         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
1068         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
1069         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
1070         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
1071         * sysdeps/sparc/tcb-offsets.sym: Add PID.
1073 2004-03-10  Andreas Schwab  <schwab@suse.de>
1075         * sysdeps/ia64/tcb-offsets.sym: Add PID.
1076         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
1077         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
1079 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
1081         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
1082         * tst-cancel21.c (do_one_test): Likewise.
1083         Reported by Gordon Jin <gordon.jin@intel.com>.
1085 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
1087         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
1088         if non-zero and set to INT_MIN if zero.
1089         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
1090         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
1091         (SAVE_PID, RESTORE_PID): Define.
1092         (__vfork): Use it.
1093         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
1094         Use relative path to avoid including NPTL i386/vfork.S.
1095         (SAVE_PID, RESTORE_PID): Define.
1096         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
1097         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
1098         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
1099         tst-vfork2x.
1100         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
1101         * tst-vfork1.c: New test.
1102         * tst-vfork2.c: New test.
1103         * tst-vfork1x.c: New test.
1104         * tst-vfork2x.c: New test.
1106 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
1108         * sysdeps/i386/tcb-offsets.sym: Add PID.
1109         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1110         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
1111         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
1113 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
1115         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
1117 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1119         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1120         _rtld_global_ro.
1122 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
1124         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1125         _rtld_global_ro.
1127         * tst-once4.c: Remove unnecessary macro definition.
1129         * tst-mutex7.c (do_test): Limit thread stack size.
1130         * tst-once2.c (do_test): Likewise.
1131         * tst-tls3.c (do_test): Likewise.
1132         * tst-tls1.c (do_test): Likewise.
1133         * tst-signal3.c (do_test): Likewise.
1134         * tst-kill6.c (do_test): Likewise.
1135         * tst-key4.c (do_test): Likewise.
1136         * tst-join4.c (do_test): Likewise.
1137         * tst-fork1.c (do_test): Likewise.
1138         * tst-context1.c (do_test): Likewise.
1139         * tst-cond2.c (do_test): Likewise.
1140         * tst-cond10.c (do_test): Likewise.
1141         * tst-clock2.c (do_test): Likewise.
1142         * tst-cancel10.c (do_test): Likewise.
1143         * tst-basic2.c (do_test): Likewise.
1144         * tst-barrier4.c (do_test): Likewise.
1146 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
1148         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
1150 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
1152         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1153         (__pthread_cond_timedwait): Optimize wakeup test.
1154         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1155         (__pthread_cond_wait): Likewise.
1156         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1157         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1158         Likewise.
1160 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
1162         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1163         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
1164         the atomic instruction needed.
1165         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1166         (__lll_mutex_lock_wait): Likewise.
1168 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
1170         * Makefile (tests): Add tst-cond14 and tst-cond15.
1171         * tst-cond14.c: New file.
1172         * tst-cond15.c: New file.
1174 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
1176         * sysdeps/pthread/createthread.c (create_thread): Remove use of
1177         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
1178         needs to be implemented differently to be useful.
1180 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
1182         * pthread_attr_setschedparam.c: Don't test priority against limits
1183         here.  Set ATTR_FLAG_SCHED_SET flag.
1184         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
1185         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
1186         from parent thread to child.  If attribute is used and scheduling
1187         parameters are not inherited, copy parameters from attribute or
1188         compute them.  Check priority value.
1189         * pthread_getschedparam.c: If the parameters aren't known yet get
1190         them from the kernel.
1191         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
1192         ATTR_FLAG_POLICY_SET flag for thread.
1193         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
1194         and ATTR_FLAG_POLICY_SET.
1196         * sysdeps/pthread/createthread.c: Use tgkill if possible.
1198         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
1199         fail if stack address hasn't been set.  Just return 0.
1201 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
1203         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
1204         libpthread for the files in this list.
1205         (CFLAGS-tst-unload): Removed.
1206         * tst-unload.c (do_test): Don't use complete path for
1207         LIBPHREAD_SO.
1209         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
1210         tst-_res1mod2.
1212 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
1214         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1215         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
1216         operation per round is needed.
1217         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1218         (__lll_mutex_lock_wait): Likewise.
1220 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
1222         * tst-cancel9.c (cleanup): Don't print to stderr.
1224 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1226         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
1228 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
1230         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1231         (__syscall_error_handler2): Call CDISABLE.
1232         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1233         (__syscall_error_handler2): Call CDISABLE.
1235         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1236         Release lock before the loop, don't reacquire it.
1238         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
1240 2004-02-19  Andreas Schwab  <schwab@suse.de>
1242         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1243         Fix last change.
1245 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
1247         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
1248         (pthread_barrier_wait): After wakeup, release lock only when the
1249         last thread stopped using the barrier object.
1250         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
1251         (pthread_barrier_wait): Likewise.
1252         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1253         Likewise.
1254         * Makefile (tests): Add tst-barrier4.
1255         * tst-barrier4.c: New file.
1257         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1258         (__pthread_cond_timedwait): Perform timeout test while holding
1259         internal lock to prevent wakeup race.
1260         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1261         * sysdeps/pthread/pthread_cond_timedwait.c
1262         (__pthread_cond_timedwait): Likewise.
1263         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1264         (__pthread_cond_timedwait): Likewise.
1266 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
1268         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
1269         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
1270         * Makefile (tests): Add tst-rwlock13.
1271         * tst-rwlock13.c: New test.
1273 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
1275         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1276         (__condvar_tw_cleanup): Little optimization.
1277         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1279 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
1281         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
1282         libpthread as "lib" parameter to SHLIB_COMPAT.
1283         (__novmx_siglongjmp): Fix typo in function name.
1284         (__novmx_longjmp): Fix typo in function name.
1286 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1288         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
1289         __builtin_expect.
1291         * sysdeps/generic/pt-longjmp.c: Moved to...
1292         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
1294 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
1296         * Makefile (libpthread-routines): Add pt-cleanup.
1297         * pt-longjmp.c: Removed.
1298         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
1299         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
1300         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
1301         Version longjmp, siglongjmp for GLIBC_2.3.4.
1302         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
1304 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1306         * sysdeps/pthread/pthread_cond_timedwait.c
1307         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
1308         Reuse code.  Add __builtin_expects.
1310         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1311         (__pthread_cond_timedwait): Get internal lock in case timeout has
1312         passed before the futex syscall.
1313         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1315 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
1317         * allocatestack.c: Pretty printing.
1319         * sysdeps/pthread/createthread.c (create_thread): Don't add
1320         CLONE_DETACHED bit if it is not necessary.
1322 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
1324         * pthread_getattr_np.c: Include ldsodefs.h.
1326 2004-01-16  Richard Henderson  <rth@redhat.com>
1328         * allocatestack.c: Don't declare __libc_stack_end.
1329         * init.c (__pthread_initialize_minimal_internal): Likewise.
1330         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
1332 2004-01-15  Richard Henderson  <rth@redhat.com>
1334         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
1335         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
1336         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
1337         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
1338         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
1339         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
1340         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
1341         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
1343 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
1345         * init.c (pthread_functions): Make array const.
1347 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
1349         * allocatestack.c (__make_stacks_executable): Change interface.
1350         Check parameters.  Pass parameter on to libc counterpart.
1351         * pthreadP.h: Change declaration.
1353 2004-01-13  Richard Henderson  <rth@redhat.com>
1355         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
1356         prototype form.
1357         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
1358         Likewise.
1360         * sysdeps/alpha/Makefile: New file.
1361         * sysdeps/alpha/tcb-offsets.sym: New file.
1362         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1363         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
1365         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
1366         on powerpc version.
1368 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
1370         * Makefile (tests): Add tst-backtrace1.
1371         * tst-backtrace1.c: New test.
1373 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
1375         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
1376         register as second parameter to the REGISTER macro.
1377         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
1378         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
1379         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
1380         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
1381         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
1382         of thread register as second parameter to REGISTER macro in 64 case.
1384 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
1386         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
1387         (CFLAGS-getpid.o): Defined.
1388         (CFLAGS-getpid.os): Defined.
1390 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
1392         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
1393         returned for main thread does not overlap with any other VMA.
1394         Patch by Jakub Jelinek.
1396 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
1398         * tst-raise1.c: Include stdio.h.
1400 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
1402         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
1403         setting with __ASSUME_TGKILL || defined __NR_tgkill.
1404         If pid is 0, set it to selftid.
1405         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
1406         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
1407         != 0, return self->tid without doing a syscall.
1408         * descr.h (struct pthread): Move pid field after tid.
1410         * Makefile (tests): Add tst-raise1.
1411         * tst-raise1.c: New file.
1413 2003-12-23  Roland McGrath  <roland@redhat.com>
1415         * tst-oddstacklimit.c: New file.
1416         * Makefile (tests): Add it.
1417         (tst-oddstacklimit-ENV): New variable.
1419         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
1420         value up to page size for __default_stacksize.
1422 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
1424         * Makefile (tests): Add tst-eintr5.
1425         * tst-eintr5.c: New file.
1427         * eintr.c (eintr_source): Prevent sending signal to self.
1429         * tst-eintr2.c (tf1): Improve error message.
1431 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
1433         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
1434         * sysdeps/unix/sysv/linux/getpid.c: New file.
1435         * pthread_cancel.c: Add comment explaining use of PID field.
1436         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1437         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
1438         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
1439         temporarily to signal the field must not be relied on and updated
1440         by getpid().
1441         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
1442         temporarily negative.
1443         * sysdeps/unix/sysv/linux/raise.c: Likewise.
1445 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
1447         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
1448         (eintr_source): If ARG != NULL, use pthread_kill.
1449         * tst-eintr1.c: Adjust for this change.
1450         * tst-eintr2.c: Likewise.
1451         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
1452         * tst-eintr3.c: New file.
1453         * tst-eintr4.c: New file.
1455 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
1457         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
1458         if CANCELSTATE_BITMASK is set.
1459         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
1460         Likewise.
1462         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
1463         (tests-reverse): Add tst-cancel23.
1464         * tst-cancel22.c: New test.
1465         * tst-cancel23.c: New test.
1467 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
1469         * tst-eintr1.c: Better error messages.
1471         * Makefile (tests): Add tst-eintr2.
1472         * tst-eintr2.c: New file.
1474 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
1476         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
1477         (CFLAGS-tst-cancelx21.c): Set.
1478         * tst-cancel21.c: New test.
1479         * tst-cancelx21.c: New test.
1481         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
1482         comparison operand.
1483         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
1484         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
1485         * pt-longjmp.c: Include jmpbuf-unwind.h.
1486         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
1487         _JMPBUF_UNWINDS.  Adjust compared pointers.
1488         * init.c (__pthread_initialize_minimal_internal): Initialize
1489         pd->stackblock_size.
1490         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
1491         * sysdeps/alpha/jmpbuf-unwind.h: New file.
1492         * sysdeps/i386/jmpbuf-unwind.h: New file.
1493         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
1494         * sysdeps/s390/jmpbuf-unwind.h: New file.
1495         * sysdeps/sh/jmpbuf-unwind.h: New file.
1496         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
1497         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
1498         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
1499         (_JMPBUF_CFA_UNWINDS): Remove.
1500         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
1502 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
1504         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
1505         (CFLAGS-tst-cancelx20.c): Set.
1506         * tst-cancel20.c: New test.
1507         * tst-cancelx20.c: New test.
1509 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
1511         * init.c (__pthread_initialize_minimal_internal): Don't treat
1512         architectures with separate register stack special here when
1513         computing default stack size.
1515 2003-12-17  Roland McGrath  <roland@redhat.com>
1517         * Makefile (tst-cancelx7-ARGS): New variable.
1518         Reportd by Greg Schafer <gschafer@zip.com.au>.
1520 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
1522         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
1523         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
1524         (tst-stack3-ENV): Set.
1525         ($(objpfx)tst-stack3-mem): New.
1526         * tst-stack3.c: New test.
1528 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
1530         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
1531         Add unwind directives.  Drop unused .regstk directive.
1532         (_fini_EPILOG_BEGINS): Add unwind directives.
1534 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
1536         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
1537         Assume parameter is a pointer.
1538         (lll_futex_wake): Likewise.
1539         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
1540         Likewise.
1541         (lll_futex_wake): Likewise.
1542         Reported by Boris Hu.
1543         * sysdeps/unix/sysv/linux/unregister-atfork.c
1544         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
1546         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
1548 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
1550         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
1551         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
1552         __rtld_lock_initialize for ld.so lock.
1553         Patch in part by Adam Li <adam.li@intel.com>.
1555 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
1557         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
1558         in $(gnulib).  Also, remove stale comment.
1560 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
1562         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
1563         advantage of new syscall stub and optimize accordingly.
1565         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
1566         from SYS_futex, to match expectations of
1567         sysdep.h:DO_INLINE_SYSCALL.
1568         (lll_futex_clobbers): Remove.
1569         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
1570         (lll_futex_wake): Likewise.
1571         (lll_futex_requeue): Likewise.
1572         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
1573         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
1574         Jelinek).
1575         (__lll_mutex_lock): Likewise.
1576         (__lll_mutex_cond_lock): Likewise.
1577         (__lll_mutex_timed_lock): Likewise.
1578         (__lll_mutex_unlock): Likewise.
1579         (__lll_mutex_unlock_force): Likewise.
1581         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
1582         comes before the include of <sysdep.h>.
1583         (THREAD_SELF_SYSINFO): New macro.
1584         (THREAD_SYSINFO): Likewise.
1585         (INIT_SYSINFO): New macro.
1586         (TLS_INIT_TP): Call INIT_SYSINFO.
1588         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
1590         * sysdeps/pthread/createthread.c (create_thread): Use
1591         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
1592         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
1593         THREAD_SELF_SYSINFO instead of open code.
1594         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
1595         (THREAD_SYSINFO): Likewise.
1597         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
1599         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
1601 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
1603         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
1604         instead of .init.  Patch by David Mosberger.
1606 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
1608         * sysdeps/pthread/configure.in: Remove broken declaration in C
1609         cleanup handling check.
1611 2003-11-30  Andreas Jaeger  <aj@suse.de>
1613         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
1614         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
1615         Likewise.
1617 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
1619         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
1620         * pthread_attr_destroy.c: Include shlib-compat.h.
1621         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
1622         is set in iattr->flags.
1623         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
1625 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
1627         * Makefile (distribute): Add tst-cleanup4aux.c.
1629         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
1630         include.
1632 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
1634         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
1635         pthread_cond_signal.
1637         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
1638         store mutex address if the current value is ~0l.
1639         * sysdeps/pthread/pthread_cond_timedwait.c
1640         (__pthread_cond_timedwait): Likewise.
1641         * sysdeps/pthread/pthread_cond_broadcast.c
1642         (__pthread_cond_broadcast): Don't use requeue for pshared
1643         condvars.
1645         * sysdeps/unix/sysv/linux/x86_64/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/x86_64/pthread_cond_timedwait.S
1649         (__pthread_cond_timedwait): Likewise.
1650         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1651         (__pthread_cond_broadcast): Don't use requeue for pshared
1652         condvars.
1654         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
1655         element with ~0l for pshared condvars, with NULL otherwise.
1657         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1658         (__pthread_cond_wait): Don't store mutex address if the current
1659         value is ~0l.
1660         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1661         (__pthread_cond_timedwait): Likewise.
1662         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1663         (__pthread_cond_broadcast): Don't use requeue for pshared
1664         condvars.
1666         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
1667         * tst-cond12.c: New file.
1668         * tst-cond13.c: New file.
1670 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
1672         * sysdeps/pthread/configure.in: Make missing forced unwind support
1673         fatal.
1675 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
1677         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
1679 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
1681         * Makefile: Add magic to clean up correctly.
1683 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
1685         * unwind.c (FRAME_LEFT): Define.
1686         (unwind_stop): Handle old style cleanups here.
1687         (__pthread_unwind): Handle old style cleanups only if
1688         !HAVE_FORCED_UNWIND.
1689         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
1690         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
1691         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
1692         ($(objpfx)tst-cleanupx4): Likewise.
1693         * tst-cleanup4.c: New test.
1694         * tst-cleanup4aux.c: New.
1695         * tst-cleanupx4.c: New test.
1697 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
1699         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
1700         lll_mutex_*lock macros to skip atomic operations on some archs.
1702 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
1704         * sysdeps/pthread/tst-timer.c (main): Initialize
1705         sigev2.sigev_value as well.
1707 2003-10-15  Roland McGrath  <roland@redhat.com>
1709         * sysdeps/pthread/configure.in: Barf if visibility attribute support
1710         is missing.
1711         * sysdeps/pthread/configure: Regenerated.
1713 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1715         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
1716         locking macros.  No distinction between normal and mutex locking
1717         anymore.
1718         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
1719         Merge bits from lowlevelmutex.S we still need.
1720         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
1721         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
1722         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
1723         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
1724         new mutex implementation.
1725         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
1726         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
1727         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1728         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1729         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1730         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1731         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1732         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1733         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1734         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
1735         symbol for entry point to avoid cancellation.
1737 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
1739         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
1740         changes.
1741         (SAVE_OLDTYPE_0): Fix a typo.
1743 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
1745         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
1746         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
1748 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1750         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
1751         correct offset.
1753 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
1755         * Makefile (tests): Add tst-cancel19.
1756         * tst-cancel19.c: New test.
1758 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1760         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
1761         restoring of the old cancellation type.
1763 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
1765         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
1767 2003-09-27  Wolfram Gloger  <wg@malloc.de>
1769         * sysdeps/pthread/malloc-machine.h: New file
1771 2003-09-24  Roland McGrath  <roland@redhat.com>
1773         * allocatestack.c (__make_stacks_executable): Don't ignore return
1774         value from _dl_make_stack_executable.
1776 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
1778         * allocatestack.c (__make_stacks_executable): Also change
1779         permission of the currently unused stacks.
1781         * allocatestack.c (change_stack_perm): Split out from
1782         __make_stacks_executable.
1783         (allocate_stack): If the required permission changed between the time
1784         we started preparing the stack and queueing it, change the permission.
1785         (__make_stacks_executable): Call change_stack_perm.
1787         * Makefile: Build tst-execstack-mod locally.
1788         * tst-execstack-mod.c: New file.
1790 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
1792         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
1794 2003-09-23  Roland McGrath  <roland@redhat.com>
1796         * tst-execstack.c: New file.
1797         * Makefile (tests): Add it.
1798         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
1799         (LDFLAGS-tst-execstack): New variable.
1801         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
1802         whether to use PROT_EXEC for stack mmap.
1803         (__make_stacks_executable): New function.
1804         * pthreadP.h: Declare it.
1805         * init.c (__pthread_initialize_minimal_internal): Set
1806         GL(dl_make_stack_executable_hook) to that.
1808 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1810         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
1811         recommendation from AMD re avoidance of lock prefix.
1813 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
1815         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
1816         lll_futex_timed_wait instead of lll_futex_wait.
1817         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
1818         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
1819         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
1820         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
1821         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
1822         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
1823         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
1824         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
1825         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
1826         Completely revamp the locking macros.  No distinction between
1827         normal and mutex locking anymore.
1828         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1829         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
1830         __lll_lock_timedwait): Fix prototypes.
1831         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
1832         __lll_lock_timedwait): Likewise.
1833         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
1834         macros, add __builtin_expect.
1835         (lll_mutex_timedlock): Likewise.  Fix return value.
1836         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
1837         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
1838         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
1839         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
1840         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
1841         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
1842         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
1843         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
1845 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1847         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1848         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
1849         operation if possible.
1851         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
1852         like jumping over the lock prefix.
1854 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
1856         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
1857         locking macros.  No distinction between normal and mutex locking
1858         anymore.
1859         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1860         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1861         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1862         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
1863         locking.  Merge bits from lowlevelmutex.S we still need.
1864         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1865         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1866         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
1867         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
1868         * Makefile (routines): Remove libc-lowlevelmutex.
1869         (libpthread-rountines): Remove lowlevelmutex.
1870         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
1871         for new mutex implementation.
1872         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1873         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1874         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1875         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1876         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1877         Likewise.
1878         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1879         Likewise.
1880         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1881         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1882         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
1883         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1884         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1885         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1886         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1887         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1888         Likewise.
1889         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1890         Likewise.
1891         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1892         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1893         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1894         Don't use requeue.
1895         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1896         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
1898 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
1900         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
1901         in parameters of asm with output parameters.
1903         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
1904         type of DECR parameter to int.
1905         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
1907 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
1909         * tst-attr3.c (tf, do_test): Print stack start/end/size and
1910         guardsize for each thread.
1912 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1914         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
1915         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1916         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
1918         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1919         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
1920         NULL.
1921         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
1922         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
1923         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1924         (pthread_getaffinity_np): Add hidden_def.
1926         * Makefile (tests): Add tst-attr3.
1927         * tst-attr3.c: New test.
1929         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
1931 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1933         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
1934         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
1936 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1938         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
1939         * tst-align.c: Include tst-stack-align.h.
1940         (tf, do_test): Use TEST_STACK_ALIGN macro.
1942 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
1944         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
1945         variable.
1947 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
1949         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
1950         stack-related values for the initial thread.
1952 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1954         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
1956 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
1958         * pthread_mutex_lock.c: Minor code rearrangements.
1960 2003-09-05  Roland McGrath  <roland@redhat.com>
1962         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
1963         Instead, include ../nptl_db/db_info.c to do its magic.
1964         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
1965         (__pthread_pthread_key_2ndlevel_size): Likewise.
1966         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
1967         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
1968         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
1969         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
1970         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
1971         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
1972         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
1973         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
1974         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
1975         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
1976         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
1977         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
1978         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
1979         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
1980         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
1981         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
1982         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
1984 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
1986         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
1987         of pthread_t to be compatible with LT.
1988         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1989         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1990         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1991         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1992         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1993         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1994         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1996 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
1998         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
2000 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
2002         * unwind-forcedunwind.c: Move to...
2003         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
2004         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
2005         * sysdeps/pthread/jmpbuf-unwind.h: New file.
2006         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
2007         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
2008         * unwind.c: Include jmpbuf-unwind.h.
2009         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
2011 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
2013         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
2014         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
2015         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
2016         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
2017         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2018         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
2019         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
2020         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
2021         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
2022         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
2023         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
2024         function.
2025         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
2026         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
2027         * Makefile (tests): Add tst-stack2.
2028         * tst-stack2.c: New test.
2029         * tst-stack1.c: Include limits.h and sys/param.h.
2030         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
2032         * pthread_condattr_setpshared.c: Include errno.h.
2033         (pthread_condattr_setpshared): Return EINVAL if pshared
2034         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
2036         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
2037         defined symbol for entry point to avoid cancellation.
2038         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2039         Likewise.
2040         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
2041         Likewise.
2042         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2043         Likewise.
2044         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
2045         Likewise.
2046         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2047         Likewise.
2048         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
2049         __close_nocancel, __read_nocancel, __write_nocancel,
2050         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
2051         libpthread.so or librt.so, define to corresponding function
2052         without _nocancel suffix.
2053         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
2054         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
2055         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
2057         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
2059 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
2061         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
2062         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
2064         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
2065         in subsections has a symbol associated with it.
2067         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
2068         defined symbol for entry point to avoid cancellation.
2069         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
2071 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2073         * Makefile (tests): Add tst-tls5.
2074         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
2075         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
2076         ($(objpfx)tst-tls5): New.
2077         ($(objpfx)tst-tls6.out): Likewise.
2078         (tests): Depend on $(objpfx)tst-tls6.out.
2079         * tst-tls3.c: Include stdint.h and pthreaddef.h.
2080         (do_test): Check pthread_self () return value alignment.
2081         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
2082         (tf): Check pthread_self () return value alignment.
2083         * tst-tls5.c: New test.
2084         * tst-tls5.h: New.
2085         * tst-tls5mod.c: New.
2086         * tst-tls5moda.c: New.
2087         * tst-tls5modb.c: New.
2088         * tst-tls5modc.c: New.
2089         * tst-tls5modd.c: New.
2090         * tst-tls5mode.c: New.
2091         * tst-tls5modf.c: New.
2092         * tst-tls6.sh: New test.
2094         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
2095         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
2096         * init.c (pthread_functions): Initialize them.
2097         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
2098         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
2099         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
2100         pthread_cond_timedwait@@GLIBC_2.3.2.
2102 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2104         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
2105         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
2106         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
2107         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
2108         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
2109         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2111         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
2113         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
2114         _POSIX_THREAD_PRIORITY_SCHEDULING.
2115         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2117 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
2119         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
2120         nested function, use static inline function from libio.h.
2121         Code by Richard Henderson.
2123         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
2124         weak.
2126 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
2128         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
2129         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
2130         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
2131         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
2132         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
2133         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
2134         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
2135         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
2136         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
2137         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
2138         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
2139         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
2140         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
2141         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
2142         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
2143         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
2144         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
2145         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
2146         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
2147         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
2148         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
2149         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
2150         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
2151         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
2152         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
2153         * sysdeps/sparc/tls.h: New file.
2154         * sysdeps/sparc/tcb-offsets.sym: New file.
2155         * sysdeps/sparc/Makefile: New file.
2156         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
2157         * init.c [__sparc__] (__NR_set_tid_address): Define.
2159 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
2161         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
2162         _IO_release_lock): Define.
2164 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
2166         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
2167         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
2169 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
2171         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
2172         (__pthread_cleanup_class): Add missing return types of member
2173         functions.
2175 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
2177         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2178         (lll_mutex_unlock_force): Add memory barrier between store and futex
2179         syscall.
2181 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
2183         * tst-cancel4.c (do_test): Also unlink tempfname and remove
2184         tempmsg in first loop.
2186 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
2188         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2189         _POSIX_THREAD_PRIORITY_SCHEDULING.
2190         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2192 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2194         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
2195         (__rtld_lock_default_lock_recursive,
2196         __rtld_lock_default_unlock_recursive): Define.
2197         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
2198         __rtld_lock_unlock_recursive): Define using
2199         GL(_dl_rtld_*lock_recursive).
2200         * init.c (__pthread_initialize_minimal_internal): Initialize
2201         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
2202         Lock GL(_dl_load_lock) the same number of times as
2203         GL(_dl_load_lock) using non-mt implementation was nested.
2205         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
2206         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
2208 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
2210         * tst-cancel17.c (do_test): Make len2 maximum of page size and
2211         PIPE_BUF.
2213 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2215         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
2217 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
2219         * sysdeps/pthread/createthread.c (do_clone): Move error handling
2220         to first syscall error check.  Move syscall error check for tkill
2221         into __ASSUME_CLONE_STOPPED #ifdef.
2223 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
2225         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
2226         is not defined, do explicit synchronization.
2227         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
2228         is not defined also unlock pd->lock for non-debugging case in case
2229         it is necessary.
2230         * pthread_create.c (start_thread): Always get and release pd->lock
2231         if __ASSUME_CLONE_STOPPED is not defined.
2232         (start_thread_debug): Removed.  Adjust users.
2233         * allocatestack.c (allocate_stack): Always initialize lock if
2234         __ASSUME_CLONE_STOPPED is not defined.
2235         * Makefile (tests): Add tst-sched1.
2236         * tst-sched1.c: New file.
2238         * sysdeps/pthread/createthread.c (do_clone): Only use
2239         sched_setschduler and pass correct parameters.
2241 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2243         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
2244         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
2245         PTHREAD_STACK_MIN in comments.
2247 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2249         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2250         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
2251         argument.
2252         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
2253         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
2254         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
2255         (__pthread_cleanup_upto): Fix prototype.
2256         (_longjmp_unwind): Adjust caller.
2257         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
2258         Change second argument to const struct pointer.
2259         * tst-sem8.c (main): Remove unused s2 and s3 variables.
2260         * tst-sem9.c (main): Likewise.
2261         * unwind.c: Include string.h for strlen prototype.
2263 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
2265         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2266         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
2267         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
2268         Define HAVE_CMOV.
2269         Patch by Nicholas Miell <nmiell@attbi.com>.
2271 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
2273         * init.c (__pthread_initialize_minimal_internal): Initialize
2274         GL(dl_init_static_tls).
2275         * pthreadP.h (__pthread_init_static_tls): New prototype.
2276         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
2277         New functions.
2278         * Makefile (tests): Add tst-tls4.
2279         (modules-names): Add tst-tls4moda and tst-tls4modb.
2280         ($(objpfx)tst-tls4): Link against libdl and libpthread.
2281         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
2282         tst-tls4modb.so.
2283         * tst-tls4.c: New file.
2284         * tst-tls4moda.c: New file.
2285         * tst-tls4modb.c: New file.
2287 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
2289         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
2290         before __timer_dealloc.
2291         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
2292         Don't call list_unlink.
2294 2003-07-29  Roland McGrath  <roland@redhat.com>
2296         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
2298 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
2300         * tst-cancel17.c (do_test): Check if aio_cancel failed.
2301         Don't reuse struct aiocb A if it failed.
2302         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
2303         not just one byte, as that does not block.
2305 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
2307         * sysdeps/pthread/unwind-resume.c: New file.
2308         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
2309         unwind-resume in csu subdir.
2310         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
2311         exceptions.
2312         (librt-sysdep_routines, librt-shared-only-routines): Add
2313         rt-unwind-resume.
2314         * sysdeps/pthread/rt-unwind-resume.c: New file.
2315         * unwind-forcedunwind.c: New file.
2316         * Makefile (libpthread-routines): Add unwind-forcedunwind.
2317         (libpthread-shared-only-routines): Likewise.
2318         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
2319         * pthreadP.h (pthread_cancel_init): New prototype.
2320         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
2322         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
2323         attr argument const struct pthread_attr *.
2325         * res.c (__res_state): Return __resp.
2326         * descr.h: Include resolv.h.
2327         (struct pthread): Add res field.
2328         * pthread_create.c: Include resolv.h.
2329         (start_thread): Initialize __resp.
2330         * Makefile (tests): Add tst-_res1.
2331         (module-names): Add tst-_res1mod1, tst-_res1mod2.
2332         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
2333         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
2334         libpthread.
2335         * tst-_res1.c: New file.
2336         * tst-_res1mod1.c: New file.
2337         * tst-_res1mod2.c: New file.
2339 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
2341         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
2343         * Makefile: Define various *-no-z-defs variables for test DSOs
2344         which has undefined symbols.
2346 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
2348         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2349         Retry if the stwcx fails to store once_control.
2351 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
2353         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
2354         pthread_attr_setaffinity.
2355         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
2356         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
2357         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
2358         * pthread_attr_destroy.c: Free cpuset element if allocated.
2359         * pthread_create.c: Pass iattr as additional parameter to
2360         create_thread.
2361         * sysdeps/pthread/createthread.c: If attribute is provided and
2362         a new thread is created with affinity set or scheduling parameters,
2363         start thread with CLONE_STOPPED.
2364         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
2365         pthread_attr_setaffinity.
2366         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2367         cpuset element.
2369 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
2371         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
2373 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
2375         * sysdeps/pthread/configure.in: Require CFI directives also for
2376         ppc and s390.
2378 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
2380         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2381         Add cfi directives.
2383 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2385         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
2386         CLEANUP_JMP_BUF.
2387         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
2388         registers as variables.  Call __pthread_mutex_unlock_usercnt.
2389         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2390         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
2391         not self pointer in __writer.  Compare with TID to determine
2392         deadlocks.
2393         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2394         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2395         Likewise.
2396         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2397         Likewise.
2398         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
2399         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2400         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
2401         macros also when compiling librt.
2403 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
2405         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
2406         -fasynchronous-unwind-tables.
2407         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2408         (PSEUDO): Add cfi directives.
2409         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
2410         Likewise.
2411         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2412         Likewise.
2414 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
2416         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
2417         __pthread_unregister_cancel): Add prototypes and hidden_proto.
2418         * unwind.c (__pthread_unwind_next): Add hidden_def.
2419         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
2420         Likewise.
2421         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2422         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2423         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2424         Likewise.
2425         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
2426         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2427         Likewise.
2428         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
2429         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
2430         __pthread_unregister_cancel and __pthread_unwind_next.
2432 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
2434         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
2435         different symbol for the cancellation syscall wrapper and
2436         non-cancellation syscall wrapper.
2437         (PSEUDO_END): Define.
2439 2003-07-05  Richard Henderson  <rth@redhat.com>
2441         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
2442         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
2443         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2444         return actual return value from the syscall, not 0.
2446 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
2448         * descr.h (struct pthread): Add pid field.
2449         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
2450         (__reclaim_stacks): Likewise.
2451         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
2452         also check for PID of the signal source.
2453         (__pthread_initialize_minimal_internal): Also initialize pid field
2454         of initial thread's descriptor.
2455         * pthread_cancel.c: Use tgkill instead of tkill if possible.
2456         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2457         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
2458         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2459         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2461 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
2463         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
2464         Fix use of parameter.
2465         (__libc_cleanup_pop): Likewise.
2467 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
2469         * init.c (sigcancel_handler): Change parameters to match handler
2470         for SA_SIGACTION.  Check signal number and code to recognize
2471         invalid invocations.
2473 2003-07-03  Roland McGrath  <roland@redhat.com>
2475         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
2476         Apply sizeof (struct pthread) bias to r13 value.
2478 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
2480         * sysdeps/pthread/configure.in: Require CFI directives.
2482         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
2483         definition.
2484         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
2485         libpthread compilation.
2486         * unwind.c (__pthread_unwind): Add hidden_def.
2487         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
2489 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2491         * libc-cancellation.c (__libc_cleanup_routine): Define.
2492         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
2493         (__pthread_cleanup_pop): Define.
2495 2003-07-01  Richard Henderson  <rth@redhat.com>
2497         * sysdeps/alpha/elf/pt-initfini.c: New file.
2498         * sysdeps/alpha/pthread_spin_lock.S: New file.
2499         * sysdeps/alpha/pthread_spin_trylock.S: New file.
2500         * sysdeps/alpha/pthreaddef.h: New file.
2501         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
2502         * sysdeps/alpha/tls.h: New file.
2503         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
2504         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
2505         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
2506         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
2507         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
2508         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
2509         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
2510         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
2511         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
2512         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
2514 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2516         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
2517         cleanup support and unwind info.
2519 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
2521         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2522         Use correct cleanup handler registration.  Add unwind info.
2523         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
2524         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
2525         * tst-once3.c: Add cleanup handler and check it is called.
2526         * tst-once4.c: Likewise.
2527         * tst-oncex3.c: New file.
2528         * tst-oncex4.c: New file.
2529         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
2531 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
2533         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
2535 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
2537         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
2538         (tf_msgsnd): Likewise.
2540         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
2541         premature returns a bit more.
2543 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
2545         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
2546         definition to the front.
2548         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
2549         the cleanup functions to make the names unique.  Fix dwarf opcode
2550         un unwind table.
2551         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
2552         functions to make the names unique.  Fix CFA offset for two blocks.
2554 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
2556         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
2557         missing closing braces.
2558         Patch by Christophe Saout <christophe@saout.de>.
2560 2003-06-24  Roland McGrath  <roland@redhat.com>
2562         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
2564 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
2566         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
2567         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
2569         * pthreadP.h: Declare __find_thread_by_id.
2570         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
2571         * pthread_clock_gettime.c: Allow using other thread's clock.
2572         * pthread_clock_settime.c: Likewise.
2573         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2574         * Makefile: Add rules to build and run tst-clock2.
2575         * tst-clock2.c: New file.
2577 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
2579         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
2580         to use exception-based cleanup handler.
2581         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2583         * tst-cond8.c (ch): Announce that we are done.
2585         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
2587         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
2588         Also test aio_suspend with timeout value.
2590 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
2592         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
2593         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
2594         attribute_hidden.
2596         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
2597         (__pthread_mutex_lock_internal): Likewise.
2598         (__pthread_mutex_unlock_internal): Likewise.
2599         (__pthread_mutex_unlock_usercnt): Declare.
2600         * pthread_mutex_destroy.c: Always fail if used in any way.
2601         * pthread_mutex_init.c: Update comment.
2602         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
2603         * pthread_mutex_timedlock.c: Adjust __nusers.
2604         * pthread_mutex_trylock.c: Adjust __nusers.
2605         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
2606         and public interfaces are wrapper with pass additional parameter.
2607         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
2608         parameter zero.
2609         * tst-mutex8.c: New file.
2610         * Makefile (tests): Add tst-mutex8.
2611         * sysdeps/pthread/pthread_cond_timedwait.c: Call
2612         __pthread_mutex_unlock_usercnt.
2613         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2615         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2616         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2617         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2618         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
2619         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2620         Add __nusers.
2621         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2622         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2623         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2624         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2625         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2627         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
2628         * pthread_mutex_timedlock.c: Likewise.
2629         * pthread_mutex_trylock.c: Adjust __nusers.
2630         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
2631         * tst-mutex9.c: New file.
2632         * Makefile (tests): Add tst-mutex9.
2633         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
2634         * sysdeps/ia64/tls.h: Likewise.
2635         * sysdeps/powerpc/tls.h: Likewise.
2636         * sysdeps/s390/tls.h: Likewise.
2637         * sysdeps/sh/tls.h: Likewise.
2638         * sysdeps/x86_64/tls.h: Likewise.
2639         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2640         Change type of __owner.
2641         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2642         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2643         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2644         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2645         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2647 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
2649         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
2650         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
2652         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
2653         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
2654         instead of nr to lll_futex_wake.  Only set errno and return -1
2655         if err < 0.
2657         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
2658         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2659         return actual return value from the syscall, not 0.
2661 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
2663         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
2664         find a random value.
2665         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
2666         errno==EIDRM.
2668         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
2669         compat_timer_settime.
2670         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
2671         compat_timer_gettime.
2672         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
2673         compat_timer_getoverrun.
2674         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
2675         compat_timer_delete.
2677         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
2678         error-checking mutex detect busy mutexes.
2680 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2682         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
2683         Add ax to clobber list.
2684         (lll_mutex_cond_lock): Likewise.
2685         (lll_mutex_unlock): Likewise.
2686         (lll_lock): Likewise.
2687         (lll_unlock): Likewise.
2689         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
2690         * tst-cancel18.c: New file.
2691         * tst-cancelx18.c: New file.
2693         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
2694         and tcdrain.
2696         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
2697         * tst-cancel17.c: New file.
2698         * tst-cancelx17.c: New file.
2700         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
2701         * sysdeps/unix/sysv/linux/sigwait.c: New file.
2702         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
2704         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
2706 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
2708         * sysdeps/pthread/createthread.c (create_thread): Set
2709         header.multiple_threads unconditionally.
2710         * allocatestack.c (allocate_stack): Likewise.
2711         * descr.h (struct pthread): Add header.multiple_threads
2712         unconditionally.
2713         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
2714         Define for librt.  #error if neither libpthread, libc nor librt.
2715         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
2716         Likewise.
2717         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
2718         CDISABLE): Likewise.
2719         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
2720         CDISABLE): Likewise.
2721         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
2722         CDISABLE): Likewise.
2723         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
2724         CDISABLE): Likewise.  Access header.multiple_threads outside of
2725         libc and libpthread.
2726         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
2727         Likewise.
2728         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
2729         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
2731 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2733         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
2734         Also test early cancellation before the thread reaches the cancellation
2735         point.
2737         * Makefile: Compile forward.c with exceptions.
2739         * sysdeps/unix/sysv/linux/sleep.c: New file.
2741 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
2743         * Makefile: Add CFLAGS definition to compile function wrappers
2744         duplicated from libc with exceptions.
2745         * tst-cancel4.c: Also check cancellation handlers.
2747         * Makefile: Add rules to build and run tst-cancel16 and
2748         tst-cancelx16.  Add missing CFLAGS definitions.
2749         * tst-cancel16.c: New file.
2750         * tst-cancelx16.c: New file.
2752 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
2754         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2755         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
2756         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
2757         (DL_SYSINFO_IMPLEMENTATION): Likewise.
2759         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
2760         (LIBC_CANCEL_RESET): Likewise.
2761         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
2762         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
2763         librt-cancellation.
2764         (CFLAGS-libcrt-cancellation.c): Define.
2765         * sysdeps/pthread/librt-cancellation.c: New file.
2766         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
2767         macros also when compiling librt.
2768         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2769         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2770         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2771         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2772         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2773         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2774         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2776         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
2777         compat_timer_create.
2779 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
2781         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
2783         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
2784         __register_atfork.
2785         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
2786         Add libc_hidden_def.
2788 2003-06-13  Roland McGrath  <roland@redhat.com>
2790         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
2791         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
2793 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
2795         * allocatestack.c (queue_stack): Always inline.
2796         * ptreadhP.h (__do_cancel): Likewise.
2798 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
2800         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
2801         a typo.
2803 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
2805         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2806         (__pthread_cond_signal): Remove incorrect second addition for
2807         cond_lock!=0.
2809 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
2811         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2812         (__pthread_cond_signal): Use correct futex pointer in
2813         __lll_mutex_lock_wait call.
2815         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2816         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
2818 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
2820         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
2821         cancelable.
2822         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2823         Likewise.
2825         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
2826         hand-written CFI generation code.  Since ENTRY/END also initiated
2827         CFI frames this caused two CFI sets to be generated.
2829 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
2831         * cleanup_routine.c: New file.
2832         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
2833         * sysdeps/pthread/pthread.h: Add support for fully exception-based
2834         cleanup handling.
2835         * Makefile (libpthread-routines): Add cleanup_routine.
2836         Add more CFLAGS variables to compile with exceptions.  Add comments
2837         why which file needs unwind tables.
2838         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
2839         tests.
2840         * tst-cancelx1.c: New file.
2841         * tst-cancelx2.c: New file.
2842         * tst-cancelx3.c: New file.
2843         * tst-cancelx4.c: New file.
2844         * tst-cancelx5.c: New file.
2845         * tst-cancelx6.c: New file.
2846         * tst-cancelx7.c: New file.
2847         * tst-cancelx8.c: New file.
2848         * tst-cancelx9.c: New file.
2849         * tst-cancelx10.c: New file.
2850         * tst-cancelx11.c: New file.
2851         * tst-cancelx12.c: New file.
2852         * tst-cancelx13.c: New file.
2853         * tst-cancelx14.c: New file.
2854         * tst-cancelx15.c: New file.
2855         * tst-cleanupx0.c: New file.
2856         * tst-cleanupx0.expect: New file.
2857         * tst-cleanupx1.c: New file.
2858         * tst-cleanupx2.c: New file.
2859         * tst-cleanupx3.c: New file.
2861         * tst-cleanup0.c: Make standard compliant.
2862         * tst-cleanup1.c: Likewise.
2864         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
2865         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2866         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2867         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2868         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2869         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2870         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
2871         CLEANUP_JMP_BUF.
2872         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2873         * tst-cancel12.c: New file.
2874         * tst-cancel13.c: New file.
2875         * tst-cancel14.c: New file.
2876         * tst-cancel15.c: New file.
2877         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
2878         and tst-cancel15.
2880         * tst-cancel1.c: Add some comments.
2882         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
2883         timeout correctly.
2885 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
2887         * Makefile (CFLAGS-pthread_cancel.c): Define.
2889 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
2891         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
2892         Change type of __writer element to int.
2893         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2894         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2895         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2896         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2897         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2898         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
2899         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2900         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
2901         Compare with TID to determine deadlocks.
2902         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2903         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2904         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
2905         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2906         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2907         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2908         Likewise.
2909         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2910         Likewise.
2911         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2912         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2913         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2914         Likewise.
2915         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2916         Likewise.
2917         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2918         * Makefile (tests): Add tst-rwlock12.
2919         * tst-rwlock12.c: New file.
2921 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
2923         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
2924         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
2925         Remove bogus hidden_proto.
2926         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2927         Likewise.
2928         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
2929         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
2930         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
2931         ___lll_mutex_timedlock): Likewise.
2933 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
2935         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2936         (__pthread_cond_signal): Add some code to eventually handle
2937         cond_lock!=0.
2939 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
2941         * Makefile (tests): Add tst-exec4.
2942         (tst-exec4-ARGS): Define.
2943         * tst-exec4.c: New file.
2945 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
2947         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2948         Also fail if tv_nsec < 0.
2949         (__lll_timedwait_tid): Likewise.
2950         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
2951         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
2952         Likewise.
2953         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
2954         Likewise.
2955         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
2956         Likewise.
2957         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2958         Likewise.
2959         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
2960         Likewise.
2961         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
2962         Likewise.
2964         * Makefile (tests): Add tst-sem8 and tst-sem9.
2965         * tst-sem8.c: New file.
2966         * tst-sem9.c: New file.
2967         * sem_open.c: Fix creation of in_use record if the file exists but
2968         no internal record.
2970         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
2971         definitions.
2973         * sysdeps/pthread/timer_create.c (timer_create): In case
2974         evp==NULL, assign timer ID to sival_ptr.
2976         * descr.h (struct pthread_unwind_buf): Change type of prev element to
2977         struct pthread_unwind_buf *.
2978         (struct pthread): Likewise for cleanup_jmp_buf element.
2980         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
2981         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
2982         * unwind.c (__pthread_unwind_next): Likewise.
2984 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
2986         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2987         (lll_futex_timed_wait): Use int for futex value parameter.
2988         (lll_futex_wake): Likewise.
2989         (lll_futex_requeue): Likewise.
2991         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
2992         Replace one memory operation with one register operation.
2994         * tst-join4.c (do_test): Fix error message.
2996         * tst-rwlock6.c (do_test): Use correct format specifier.
2998         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2999         (__lll_mutex_lock_wait): Replace one memory operation with one
3000         register operation.
3001         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
3002         (__lll_mutex_lock_wait): Likewise.
3004         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3005         (__lll_mutex_cond_lock): Add one to value parameter of
3006         __lll_lock_wait to reflect reality in the futex syscall.
3007         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3008         (lll_mutex_cond_lock): Likewise.
3010 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3012         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
3013         New function.
3014         (lll_mutex_cond_lock): Define.
3016 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
3018         * Makefile (tests): Add tst-signal6.
3019         * tst-signal6.c: New file.
3021         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
3022         (__lll_mutex_unlock_force): New function
3023         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3025         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3026         (__lll_mutex_unlock_force): New function.
3027         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3029         * tst-rwlock7.c (do_test): Use correct format specifier.
3031         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
3032         Find break parameter in correct asm argument.
3034 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
3036         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
3037         Remove out4.
3038         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
3039         error occured.
3040         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3041         Add __mutex.
3042         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
3043         lll_futex_requeue, lll_mutex_unlock_force): Define.
3045 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3047         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3048         (pthread_cond_t): Add __mutex.
3049         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
3050         lll_futex_requeue, lll_mutex_unlock_force): Define.
3052 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3054         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
3055         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3056         Add __mutex field.
3057         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
3058         Define.
3059         (lll_futex_wait, lll_futex_wake): Define.
3060         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
3061         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
3062         FUTEX_REQUEUE instead of FUTEX_WAIT.
3063         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
3064         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
3065         mutex which was used in condvar structure.  Call
3066         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
3067         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3069         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
3070         include tcb-offsets.h.  Read wakeup value in locked region.
3071         Use the value of gbr register as THREAD_ID.
3072         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3073         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3074         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3076         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
3077         macros.
3079 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
3081         * sysdeps/pthread/pthread_cond_broadcast.c
3082         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
3084 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
3086         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
3087         typo in register name.
3088         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
3089         correctly.  Actually use requeue.  Little optimization.
3090         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
3091         mutex address early.  Handle cancellation state as 32-bit value.
3092         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3093         Remove unnecessary label.
3095 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
3097         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
3098         instead of FUTEX_WAIT.
3099         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
3100         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3101         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3102         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3103         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3104         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
3105         used in condvar structure.  Call __pthread_mutex_cond_lock instead
3106         of __pthread_mutex_lock_internal.
3107         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3108         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3109         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3110         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
3111         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3112         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3113         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
3114         Add pthread_mutex_cond_lock.
3115         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
3116         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
3117         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
3118         lll_mutex_cond_lock.
3119         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3120         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3121         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3122         Add __mutex field.
3123         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3124         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3126         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
3127         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3129         * pthreadP.h: Declare __pthread_mutex_cond_lock.
3130         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
3131         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
3132         macro don't define aliases.
3134         * cancellation.c: Remove __pthread_enable_asynccancel_2.
3135         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
3136         * sysdeps/pthread/pthread_cond_timedwait.c: Use
3137         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
3138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3139         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3140         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3141         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3142         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3144 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
3146         * sem_open.c: Fix one endless loop.  Implement correct semantics
3147         wrt opening the same semaphore more then once.
3148         * sem_close.c: Adjust for sem_open change.
3149         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
3150         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
3151         * Makefile (tests): Add tst-sem7.
3152         * tst-sem7.c: New file.
3154 2003-05-16  Roland McGrath  <roland@redhat.com>
3156         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
3157         uninitialized variable braino.
3159 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
3161         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
3162         test for syscall availability.
3164         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
3165         __no_posix_timers to -1 if the syscalls don't exist.
3167         * pthread_join.c (pthread_join): Set tid field of the joined
3168         thread to -1.  This isn't necessary but helps to recognize some
3169         error conditions with almost no cost.
3171         * allocatestack.c (FREE_P): Also negative values indicate an
3172         unused stack.
3174         * unwind.c: Include <unistd.h>.
3176 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
3178         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
3180 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
3182         * Makefile (crti-objs, crtn-objs): New variables.
3183         (omit-deps, extra-objs): Add crtn.
3184         ($(objpfx)libpthread.so): Depend on both crti and crtn
3185         and links to them in multidir.
3186         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
3188 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
3190         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3191         (lll_mutex_unlock): Use atomic_exchange_rel.
3193 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
3195         * cond-perf.c (cons): Add missing locking around setting of alldone.
3197 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
3199         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
3200         related macros.
3201         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3203 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
3205         * tst-sem6.c: New file.
3206         * Makefile (tests): Add tst-sem6.
3208         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
3209         Use atomic_exchange_rel instead of atomic_exchange.
3210         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
3211         Likewise.
3213         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
3214         code for lll_futex_wait and lll_futex_wake in static apps.  Use
3215         vsyscall is possible.
3217         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
3218         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
3219         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
3220         pthread_setaffinity_np.
3221         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
3222         and pthread_setaffinity_np.
3223         * Makefile (libpthread-routines): Add pthread_getaffinity and
3224         pthread_setaffinity.
3226         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
3227         use it in case mmap to allocate the stack fails.
3228         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
3229         ARCH_MAP_FLAGS here.
3230         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
3231         ARCH_RETRY_MMAP.
3233 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
3235         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
3236         handler implementation.  It is now lockless in fork().
3237         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3238         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3239         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
3240         declare the __fork_*_lists.
3241         (struct fork_handler): Include pointers to all three functions.
3242         Add next, refcntr and need_signal elements.
3243         (__fork_handlers): New declaration.
3244         (__register_atfork_malloc): Remove declaration.
3245         (HAVE_register_atfork_malloc): Remove definition.
3246         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
3247         __pthread_child_handler variable.
3248         (__libc_pthread_init): Use __register_atfork instead of explicitly
3249         adding to the list.
3250         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
3251         and lll_futex_wake.
3252         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3254         * unwind.c (unwind_cleanup): Print error message and then abort.  This
3255         function must never be reached.
3257         * cond-perf.c: New file.
3259 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
3261         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
3263 2003-05-04  Roland McGrath  <roland@redhat.com>
3265         * Makefile ($(objpfx)../libc.so): New target.
3267 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
3269         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3270         (pthread_condattr_t): Size is only an int, don't use long for
3271         alignment.
3272         (pthread_mutexattr_t): Likewise.
3273         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3274         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3275         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3277 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
3279         * sysdeps/i386/tls.h: Define THREAD_ID.
3280         * sysdeps/ia64/tls.h: Likewise.
3281         * sysdeps/powerpc/tls.h: Likewise.
3282         * sysdeps/s390/tls.h: Likewise.
3283         * sysdeps/sh/tls.h: Likewise.
3284         * sysdeps/x86_64/tls.h: Likewise.
3285         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
3286         record ownership.
3287         * pthread_mutex_timedlock.c: Likewise.
3288         * pthread_mutex_trylock.c: Likewise.
3289         * pthread_mutex_unlock.c: Likewise.
3290         * pthread_rwlock_trywrlock.c: Likewise.
3291         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
3292         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3293         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3294         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3296         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
3297         flag.
3299 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
3301         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3302         (__SIZEOF_PTHREAD_COND_T): Define to 48.
3303         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
3304         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3305         Make __align long long instead of long.
3306         (pthread_rwlock_t): Formatting.
3307         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3308         (pthread_rwlock_t): Formatting.
3309         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3310         (pthread_cond_t): Make __align long long instead of long.
3311         (pthread_rwlock_t): Move __flags field to the same position as in
3312         linuxthreads.
3314 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
3316         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
3317         * tst-rwlock7.c (do_test): Likewise.
3319 2003-04-26  Roland McGrath  <roland@redhat.com>
3321         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
3323 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
3325         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
3326         sizeof (struct pthread).
3327         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
3328         1 struct pthread.
3329         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
3330         to 0.
3331         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
3332         struct pthread.
3333         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
3334         to 32-bit bytes.
3335         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
3336         tcbp.
3337         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
3338         unneccessarily.
3339         (NO_TLS_OFFSET): Define.
3340         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
3341         add TLS_TCB_SIZE unnecessarily.
3343 2003-04-22  Roland McGrath  <roland@redhat.com>
3345         * Makeconfig (shared-thread-library): Reverse link order to work
3346         around linker bug.
3348 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
3350         * semaphore.h: Fix typo in comment.
3352 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
3354         * sysdeps/pthread/sigfillset.c: New file.
3356         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
3357         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
3358         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
3359         * sysdeps/pthread/sigaction.c: Likewise.
3360         * sysdeps/pthread/sigprocmask.c: New file.
3361         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
3362         __SIGRTMIN+1.
3363         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3364         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
3365         in this case.
3367 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
3369         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3370         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
3372         * sysdeps/unix/sysv/linux/unregister-atfork.c
3373         (__unregister_atfork): Don't free memory not allocated dynamically.
3375         * semaphore.h: Remove __THROW marker from cancellation points.
3376         * nptl/sysdeps/pthread/pthread.h: Likewise.
3378 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
3380         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
3381         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
3382         __THROW.
3384 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
3386         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
3388 2003-04-15  Roland McGrath  <roland@redhat.com>
3390         * forward.c (__pthread_unwind): Tweak to avoid warning.
3392 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
3394         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
3396 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
3398         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
3399         overflow CFA advance instructions.
3400         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3402 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
3404         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
3405         * sysdeps/i386/pthread_spin_lock.c: Likewise.
3406         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
3407         defined.
3409         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
3410         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
3411         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
3412         DW_CFA_advance_loc for .Laddl-.Lsubl.
3414 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
3416         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
3417         position-independent unwind data for static libraries.
3418         Add missing unwind info.  Add comments.
3420         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
3421         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3422         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3423         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3425 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
3427         * Makefile: Make sure all cancellation points are compiled with
3428         exception and asynchronous unwind tables.
3430         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
3431         which mishandles loading of global object addresses in PIC.
3432         (THREAD_SETMEM_NC): Likewise.
3434 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3436         * pthread.h: Define new data structure for cleanup buffer.  Declare
3437         new cleanup handler interfaces.
3438         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
3439         (struct pthread): Add cleanup_jmp_buf pointer.  Define
3440         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
3441         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
3442         it.  Declare old cleanup handler installation functions.
3443         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
3444         handling.
3445         * cleanup_defer.c: Likewise.
3446         * cleanup_compat.c: New file.  Old cleanup code.
3447         * cleanup_def_compat.c: New file.  Old cleanup code.
3448         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
3449         if own thread descriptor.
3450         * unwind.c: New file.
3451         * forward.c: Add __pthread_unwind.
3452         * init.c (pthread_functions): Add __pthread_unwind.
3453         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
3454         Add ptr___pthread_unwind.
3455         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
3456         and unwind function.
3457         * Makefile (libpthread-routines): Add cleanup_compat,
3458         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
3459         table generation if necessary.
3460         * version.c: Record whether unwind support is compiled in.
3461         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
3462         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
3463         handler interfaces.
3464         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
3465         complication to generate unwind information for syscall wrappers.
3466         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3467         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3468         __cleanup_fct_attribute.
3470         * Makefile: Add rules to build and run tst-cleanup0.
3471         * tst-cleanup0.c: New file.
3472         * tst-cleanup0.expect: New file.
3474         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
3475         caller.  Optimize to avoid often unecessary local variable.
3477 2003-04-11  Roland McGrath  <roland@redhat.com>
3479         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
3480         sets variable `multidir'; include that.
3481         (generated): Add it.
3482         ($(objpfx)$(multidir)/crti.o): New target.
3483         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
3485 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3487         * tst-attr2.c (do_test): Add cast to avoid warning.
3488         * tst-mutex4.c (do_test): Likewise.
3490 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
3492         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
3493         in child.
3495 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
3497         * Makefile (tests): Add tst-detach1.
3498         * tst-detach1.c: New file.
3500 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
3502         * sysdeps/pthread/pthread.h: Remove duplicate
3503         pthread_cleanup_{push,pop} definitions.
3505         * tst-barrier2.c: Eliminate warnings.
3506         * tst-cancel4.c: Likewise.
3507         * tst-cond4.c: Likewise.
3508         * tst-cond6.c: Likewise.
3509         * tst-detach1.c: Likewise.
3510         * tst-rwlock4.c: Likewise.
3511         * tst-rwlock6.c: Likewise.
3512         * tst-rwlock7.c: Likewise.
3513         * tst-sem3.c: Likewise.
3514         * tst-spin2.c: Likewise.
3515         * tst-umask1.c: Likewise.
3517 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
3519         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
3521 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
3523         * descr.h (struct pthread): Move cancelhandling member to the front.
3525 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
3527         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
3528         malloc_parent, and malloc_child statically.
3529         (__register_atfork_malloc): New function.
3530         (free_mem): Don't free any of the malloc_* variables on the list.
3531         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
3532         Define HAVE_register_atfork_malloc.
3534 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
3536         * sysdeps/pthread/createthread.c (create_thread): Add some more
3537         comments explaining when to set multiple_threads and when not.
3539         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3540         THREAD_ATOMIC_BIT_SET if not already defined.
3541         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3542         THREAD_ATOMIC_BIT_SET:
3543         * sysdeps/x86_64/tls.h: Likewise.
3544         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
3545         THREAD_ATOMIC_CMPXCHG_VAL.
3546         (_pthread_cleanup_pop_restore): Likewise.
3547         * cancellation.c (__pthread_enable_asynccancel): Likewise.
3548         (__pthread_enable_asynccancel_2): Likewise.
3549         (__pthread_disable_asynccancel): Likewise.
3550         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3551         (__libc_disable_asynccancel): Likewise.
3552         * init.c (sigcancel_handler): Likewise.
3553         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
3554         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
3556 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
3558         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
3559         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3560         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
3561         * Makefile (tests): Add tst-cancel11.
3562         * tst-cancel11.c: New file.
3564 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
3566         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
3567         round, not the first.  Use specific_used flag instead of local
3568         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
3569         (__free_tcb): Don't call deallocate_tsd here.
3570         (start_thread): Call deallocate_tsd here.
3571         * pthread_setspecific.c: Set specific_used flag really only when
3572         needed.
3573         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
3574         * tst-tsd3.c: New file.
3575         * tst-tsd4.c: New file.
3577 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3579         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
3580         Use atomic_exchange_and_add instead of __lll_add.
3581         (__lll_mutex_timedlock): Likewise.
3582         Patch by Ian Wienand.
3584 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
3586         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3587         (SINGLE_THREAD_P): Fix typo.
3588         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
3590 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3592         * Makefile (tests): Add tst-align.
3593         * tst-align.c: New file.
3594         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
3596         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
3597         function correctly.
3599         * tst-tsd2.c: Add casts to avoid warnings.
3601 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
3603         * descr.h (struct pthread): Move most often used elements to the front.
3605 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
3607         * Makefile (libpthread-routines): Add pthread_atfork.
3608         (libpthread-static-only-routines): Add pthread_atfork.
3610 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3612         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
3613         of TLS_DTV_AT_TP.
3614         (INSTALL_DTV): Add parens.
3615         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
3616         Use passed descr instead of THREAD_SELF.
3617         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
3618         (__lll_mutex_timedlock_wait): Correct expected value after
3619         spurious wakeup.
3620         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
3621         Release lock before waking up the waiters.
3622         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
3623         criteria.  Reorderstruct passed to cleanup handler.  Fix
3624         handling of cancellation and failung pthread_mutex_unlock call.
3625         Use __pthread_enable_asynccancel_2 instead of
3626         __pthread_enable_asynccancel.
3627         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3628         Return result of lock re-get if it fails.
3629         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
3630         for __pthread_cleanup_push.
3631         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
3632         completely broken rwlock implementation.
3633         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3634         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3635         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3636         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3637         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3638         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
3639         versioned_symbol macro.
3640         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
3641         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
3643 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
3645         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
3646         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
3647         and __helper_tid.
3648         (struct timer): Remove th and bar field.
3649         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
3650         debugging code.  Create only one helper thread.
3651         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
3652         helper thread.
3653         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3654         Renamed.  Define statically.  Use thread info from siginfo.
3655         (__helper_once): New variable.
3656         (__helper_tid): New variable.
3657         (__reset_helper_control): New function.
3658         (__start_helper_thread): New function.
3660         * pthread_create.c (start_thread): Don't use setjmp inside
3661         __builtin_expect to work around gcc bug.
3663         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
3664         timer_delete syscall fails, but not with ENOSYS, set
3665         __no_posix_timers.
3667         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
3668         (timer_settime): Fix typo.
3669         * sysdeps/unix/sysv/linux/timer_getoverr.c
3670         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
3672 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
3674         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
3675         offset of cleanupbuf.__prev.
3677 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
3679         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
3680         of included file.
3682 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
3684         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
3685         NULL provide default definition to syscall.
3687 2003-03-25  Roland McGrath  <roland@redhat.com>
3689         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
3690         (timer_id2ptr): Fix typo.
3692 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
3694         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
3695         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
3696         * sysdeps/ia64/pthreaddef.h: Likewise.
3697         * sysdeps/powerpc/pthreaddef.h: Likewise.
3698         * sysdeps/s390/pthreaddef.h: Likewise.
3699         * sysdeps/sh/pthreaddef.h: Likewise.
3700         * sysdeps/x86_64/pthreaddef.h: Likewise.
3701         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
3702         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
3703         being changed.
3704         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3705         SIGTIMER is not unblocked.
3706         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
3707         RT signal taken.
3708         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
3709         be send.
3710         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
3711         pass pointer through as ID.
3712         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
3713         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
3714         * sysdeps/unix/sysv/linux/timer_create.c: New file.
3715         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
3716         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
3717         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
3718         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
3719         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
3720         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
3721         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
3722         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
3723         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
3724         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
3725         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
3726         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
3727         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
3728         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
3729         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
3730         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
3731         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
3732         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
3733         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
3734         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
3735         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
3736         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
3737         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
3738         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
3739         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
3740         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
3741         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
3742         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
3743         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
3744         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
3746         * pthreadP.h: Remove FRAME_LEFT definition.
3747         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
3748         already left frame.  Programs which have this problem are not POSIX
3749         compliant.
3750         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
3752 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
3754         * sysdeps/pthread/tst-timer.c: Check return values of the
3755         functions we test.
3757 2003-03-23  Roland McGrath  <roland@redhat.com>
3759         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
3760         * tst-tls3mod.c: Likewise.
3761         * tst-tls1.c: Likewise.
3762         * tst-tls2.c: Likewise.
3764         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
3765         undefined behavior.
3767         * tst-join5.c (tf1, tf2): Add a cast.
3769         * Makeconfig (includes): Append -I$(..)nptl to this variable.
3771         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
3772         Don't test anything.
3773         * tst-cond4.c: Likewise.
3774         * tst-cond6.c: Likewise.
3775         * tst-flock2.c: Likewise.
3776         * tst-mutex4.c: Likewise.
3777         * tst-rwlock4.c: Likewise.
3778         * tst-signal1.c: Likewise.
3779         * tst-spin2.c: Likewise.
3780         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
3782         * tst-mutex4.c: Use test-skeleton.c.
3783         * tst-spin2.c: Likewise.
3784         * tst-sysconf.c: Likewise.
3785         * tst-barrier2.c: Likewise.
3786         * tst-cond4.c: Likewise.
3787         * tst-cond6.c: Likewise.
3788         * tst-rwlock4.c: Likewise.
3789         * tst-unload.c: Likewise.
3790         * tst-flock2.c (do_test): Use return instead of exit.
3792 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
3794         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
3796 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
3798         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3799         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
3800         instead of __lll_compare_and_swap.
3801         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3802         Likewise.
3803         Removed definition if __lll_compare_and_swap.
3805         * cancellation.c: Adjust for new form of compare&exchange macros.
3806         * cleanup_defer.c: Likewise.
3807         * init.c: Likewise.
3808         * libc-cancellation.c: Likewise.
3809         * old_pthread_cond_broadcast.c: Likewise.
3810         * old_pthread_cond_signal.c: Likewise.
3811         * old_pthread_cond_timedwait.c: Likewise.
3812         * old_pthread_cond_wait.c: Likewise.
3813         * pthread_cancel.c: Likewise.
3814         * pthread_create.c: Likewise.
3815         * pthread_detach.c: Likewise.
3816         * pthread_join.c: Likewise.
3817         * pthread_key_delete.c: Likewise.
3818         * pthread_setcancelstate.c: Likewise.
3819         * pthread_setcanceltype.c: Likewise.
3820         * pthread_timedjoin.c: Likewise.
3821         * pthread_tryjoin.c: Likewise.
3822         * sysdeps/pthread/createthread.c: Likewise.
3824 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
3826         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
3827         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
3828         definitions.  Replace uses with calls to atomic_* functions.
3829         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3830         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
3831         __lll_test_and_set calls with atomic_exchange_and_add and
3832         atomic_exchange calls respectively.
3833         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
3834         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
3835         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
3836         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3837         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
3838         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
3839         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
3841         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
3842         returns the old value.
3844 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
3846         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
3847         int for variable OLDVAL and correct inline assembler contraint.
3848         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
3849         type int for variable OLD.
3851         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
3852         only for s390-32.
3853         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3854         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
3855         instead of multiple_threads field in the TCB.
3857 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
3859         * sysdeps/i386/i686/bits/atomic.h: Removed.
3860         * sysdeps/i386/i586/bits/atomic.h: Removed.
3861         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
3862         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
3863         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
3864         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
3865         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
3866         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
3867         * atomic.h: Removed.  Moved to glibc.
3869         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
3870         support for clock selection.
3872         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
3873         signalling waiters.
3875 2003-03-18  Roland McGrath  <roland@redhat.com>
3877         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3878         Add __lll_rel_instr first.  Add memory clobber.
3879         (lll_mutex_unlock): Use __lll_test_and_set.
3880         From Paul Mackerras <paulus@samba.org>.
3882         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
3883         unconditionally.
3884         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3885         (SINGLE_THREAD_P):  Add `header.' prefix.
3886         From Paul Mackerras <paulus@samba.org>.
3888         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
3889         pthread_timedjoin_np to ...
3890         (libpthread: GLIBC_2.3.3): ... here.
3891         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
3893         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3894         Avoid shadowing VAL variable.
3896         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3897         New macro.
3899 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
3901         * Makefile (tests): Add tst-cond11.
3902         * tst-cond11.c: New file.
3904         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
3905         struct passed to cleanup handler to eliminate one more
3906         instruction.
3907         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3909         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3910         (pthrad_cond_t): Replace __unused field with __clock.
3912         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
3913         waken all waiters in cleanup handler.
3914         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3915         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3917         * pthread_condattr_getclock.c: New file.
3918         * pthread_condattr_setclock.c: New file.
3919         * sysdeps/pthread/pthread.h: Declare these new functions.
3920         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
3921         * Makefile (libpthread-routines): Add the new functions.
3922         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
3923         Renamed field to value.  Document use of the bits.
3924         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
3925         change.
3926         * pthread_condattr_setpshared.c: Likewise.
3927         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
3928         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
3929         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3930         Add __clock field.
3931         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3932         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3933         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3934         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3935         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3936         Implement clock selection.
3937         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3938         * pthread-errnos.sym: Add ENOSYS.
3939         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3940         _POSIX_CLOCK_SELECTION.
3941         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3943         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
3944         invalid .size directive.
3946 2003-03-17  Roland McGrath  <roland@redhat.com>
3948         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3949         Formatting tweaks.
3951 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3953         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
3954         Use __lll_add instead of spelling it out.  Use protected symbol names.
3955         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
3956         Use __lll_add.
3957         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
3958         Renamed from lll_compare_and_swap.  Use new name where necessary.
3959         (__lll_add): Defined.
3960         (__lll_dec_if_positive): Defined.
3961         (__lll_test_and_set): Defined.
3962         * sysdeps/ia64/pthread_spin_init.c: Removed.
3963         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
3964         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
3965         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
3966         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
3967         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
3968         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
3969         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
3970         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
3971         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
3972         __sync_lock_release_si.
3973         Patch by Jakub Jelinek.
3975         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
3976         Fix timeout handling.
3977         (__lll_timedwait_tid): Likewise.
3978         (lll_unlock_wake_cb): Wake up other waiters if necessary.
3979         Patch by Jakub Jelinek.
3981         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
3983 2003-03-17  Roland McGrath  <roland@redhat.com>
3985         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
3986         * sysdeps/pthread/pthread_spin_init.c: New file.
3987         * sysdeps/pthread/pthread_spin_unlock.c: New file.
3988         * sysdeps/powerpc/Makefile: New file.
3989         * sysdeps/powerpc/pthread_spin_lock.c: New file.
3990         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
3991         * sysdeps/powerpc/pthreaddef.h: New file.
3992         * sysdeps/powerpc/tcb-offsets.sym: New file.
3993         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
3994         * sysdeps/powerpc/tls.h: New file.
3995         * sysdeps/powerpc/bits/atomic.h: New file.
3996         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
3997         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
3998         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
4000         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
4001         * sysdeps/unix/sysv/linux/sem_post.c: New file.
4002         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
4003         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
4004         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
4005         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
4006         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
4007         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
4008         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
4009         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
4010         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
4011         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
4012         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
4013         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
4014         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
4016         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
4017         not gettimeofday.
4018         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
4019         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4020         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
4021         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
4022         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4024 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
4026         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
4027         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4028         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4029         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4030         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
4032 2003-03-16  Roland McGrath  <roland@redhat.com>
4034         * tst-fork4.c: Include <string.h>.
4035         * tst-signal2.c: Likewise.
4036         * tst-mutex5.c (do_test): exit -> return.
4037         * tst-mutex2.c: Include <stdlib.h>.
4039 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
4041         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4042         (__lll_mutex_timedlock_wait): Correct expected value after
4043         spurious wakeup.  Otherwise we would never wait again.
4045         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
4046         zone versus inline asm stupidity.  Use correct instructions.
4048         * tst-rwlock6.c: Add some more status output.
4050 2003-03-15  Roland McGrath  <roland@redhat.com>
4052         * sysdeps/pthread/configure.in: New file.
4053         * sysdeps/pthread/configure: New file (generated).
4055 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
4057         * allocatestack.c (allocate_stack): Store the exact stack size of
4058         user allocated stacks.
4060 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
4062         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
4063         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
4064         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
4065         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
4066         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
4067         Use `header.' prefix.
4068         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
4070 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
4072         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
4073         __builtin_frame_address, use stack pointer.
4075         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
4076         instead of __builtin_frame_pointer.
4078 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
4080         * tst-basic1.c (do_test): Add cast to avoid warning.
4081         * tst-basic2.c (do_test): Likewise.
4083         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
4084         amount of stack correction.
4086         * tst-fork4.c: Use test-skeleton.c.
4088 2003-03-14  Roland McGrath  <roland@redhat.com>
4090         * init.c: Fix typo "#eli" for "#else".
4092 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
4094         * allocatestack.c (__stack_user): Use hidden_data_def.
4095         * pthread_create.c (__pthread_keys): Likewise.
4097         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
4099 2003-03-14  Roland McGrath  <roland@redhat.com>
4101         * tst-fork4.c: New file.
4102         * Makefile (tests): Add it.
4104         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
4105         we always define the padding space.
4106         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
4107         stopped supporting its own extensions fully.
4108         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
4109         struct also called `header', so `header.multiple_threads' is the field
4110         name to use on all machines.
4111         * allocatestack.c (allocate_stack): Use `header.' prefix.
4112         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4113         * pthread_create.c (__pthread_create_2_1): Likewise.
4114         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
4115         (THREAD_SELF): Likewise.
4116         * sysdeps/x86_64/tls.h: Likewise.
4117         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
4118         (SINGLE_THREAD_P): Likewise.
4119         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
4120         (SINGLE_THREAD_P): Likewise.
4121         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
4122         (SINGLE_THREAD_P): Likewise.
4124         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
4125         value directly.
4127 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
4129         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
4130         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
4132         * pthread_create.c (start_thread): setjmp is expected to return 0.
4134         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
4135         (THREAD_GETMEM_NC): Likewise.
4137 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
4139         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
4140         and the size of the stack which must be allocated is a multiple,
4141         allocate one more page.
4142         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
4143         MULTI_PAGE_ALIASING.
4145 2003-03-13  Roland McGrath  <roland@redhat.com>
4147         * pthread_create.c (start_thread): Set EXITING_BIT after the
4148         event-reporting (and destructors), not before.
4150 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
4152         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
4153         lll_futex_wake): Declare register variables as long int instead of
4154         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
4155         Make syscall arguments clobbered by the syscall.
4156         (lll_futex_wait): Define using lll_futex_timed_wait.
4158         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
4159         to void *.
4161         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
4162         PPID if [! NDEBUG].
4164         * allocatestack.c (nptl_ncreated): Only declare if
4165         COLORING_INCREMENT != 0.
4167         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
4168         (__libc_enable_asynccancel_2): Remove prototype.
4170         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
4171         ctid to match kernel.
4173 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4175         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
4176         libc_multiple_threads.
4177         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
4178         __libc_multiple_threads to...
4179         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
4181         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
4182         versioning.
4183         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4184         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4186         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
4187         (__pthread_once_internal): Define.
4189         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
4190         macros instead of .symver directly.
4191         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4192         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
4194         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
4195         * sysdeps/x86_64/tcb-offsets.sym: New file.
4196         * sysdeps/x86_64/Makefile: New file.
4198         * sysdeps/i386/tcb-offsets.sym: Add SELF.
4199         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
4200         to access own pthread_t in TCB.
4201         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4202         Likewise.
4203         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4204         Likewise.
4205         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4207 2003-03-12  Roland McGrath  <roland@redhat.com>
4209         * pthread-errnos.sym: New file.
4210         * Makefile (gen-as-const-headers): New variable, list that file.
4211         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
4212         header <pthread-errnos.h> instead of defining errno values here.
4213         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4214         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4215         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4216         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4217         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4218         Likewise.
4219         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4220         Likewise.
4221         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4222         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4223         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4224         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4225         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4226         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4227         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4228         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4229         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4230         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4231         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4232         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
4233         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
4234         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
4235         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4236         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4237         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4238         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4239         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4240         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
4241         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
4242         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
4243         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
4244         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
4245         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
4246         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4247         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4249         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
4250         CLONE_CHILD_SETTID worked.
4252 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4254         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
4255         file.
4256         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
4257         file.
4259         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4260         (pthread_cond_t): Add padding.
4262         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
4263         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
4264         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
4266         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
4267         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
4268         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
4269         (__pthread_rwlock_timedrdlock): Likewise.
4270         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
4271         (__pthread_rwlock_wrlock): Likewise.
4272         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
4273         (__pthread_rwlock_rdlock): Likewise.
4275         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
4277         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
4278         result of lock re-get if it fails.
4280 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4282         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
4283         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4284         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4285         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4286         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4287         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4288         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4289         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4290         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4291         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4293         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
4294         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
4296         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
4297         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
4298         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
4299         (create_thread): Likewise.
4300         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
4301         * init.c (__pthread_initialize_minimal_internal): Initialize
4302         __libc_multiple_threads_ptr if necessary.
4303         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
4304         __pthread_multiple_threads and __libc_multiple_threads_ptr.
4305         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
4306         __libc_multiple_threads.
4307         (__libc_pthread_init): Return pointer to __libc_pthread_init if
4308         necessary.
4310         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
4311         (THREAD_SETMEM_NC): Likewise.
4313         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
4314         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
4315         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
4316         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
4318         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
4319         Eliminate one entire instruction.
4321         * cancellation.c (__pthread_enable_asynccancel_2): New function.
4322         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
4323         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4324         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
4325         instead of __pthread_enable_asynccancel.
4326         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4327         (__pthread_cond_wait): Likewise.
4328         * sysdeps/pthread/pthread_cond_timedwait.c
4329         (__pthread_cond_timedwait): Likewise.
4330         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4332         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4333         (__condvar_cleanup): Wake up all waiters in case we got signaled
4334         after being woken up but before disabling asynchronous
4335         cancellation.
4336         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4337         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4338         (__condvar_cleanup): Likewise.
4340         * init.c (__NR_set_tid_address): If already defined, don't redefine.
4341         Make it an error if architecture has no #if case.  Add x86-64.
4343         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
4344         pt-initfini.s generation.
4346         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
4347         (TLS_INIT_TP): Fix typo.
4349 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4351         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
4352         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
4354         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
4355         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4356         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
4357         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
4358         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
4359         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4360         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4361         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4363 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4365         * sysdeps/pthread/pthread_cond_timedwait.c
4366         (__pthread_cond_timedwait): Return the result of the final
4367         locking.  If it succeeds, the regular function return value.
4369         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
4370         Return result of the final locking.
4371         * version.c (__nptl_main): Work around problems with the strange
4372         INTERNAL_SYSCALL macro on ppc32.
4373         * init.c (__pthread_initialize_minimal_internal): Unblock
4374         SIGCANCEL in case the parent blocked it.
4375         Reported by Paul Mackerras <paulus@samba.org>.
4377         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
4378         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
4379         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
4381 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4383         * sysdeps/pthread/pthread_cond_timedwait.c
4384         (__pthread_cond_timedwait): Unlock and fail if
4385         __pthread_mutex_unlock_internal failed.
4387         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
4388         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
4389         Use ARCH_CLONE.
4390         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
4391         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
4392         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
4393         ALLOCATE_STACK): New macros.
4394         (TLS_TPADJ): New macro.
4395         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
4396         (allocate_stack): Handle TLS_DTV_AT_TP and
4397         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
4398         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
4399         Don't set PD->self.
4400         * init.c [__ia64__] (__NR_set_tid_address): Define.
4402         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
4403         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
4404         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
4405         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
4406         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
4407         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
4408         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
4409         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
4410         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
4411         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
4412         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
4413         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
4414         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
4415         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
4416         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
4417         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
4418         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
4419         * sysdeps/ia64/bits/atomic.h: New file.
4420         * sysdeps/ia64/Makefile: New file.
4421         * sysdeps/ia64/pthread_spin_init.c: New file.
4422         * sysdeps/ia64/pthread_spin_lock.c: New file.
4423         * sysdeps/ia64/pthread_spin_trylock.c: New file.
4424         * sysdeps/ia64/pthread_spin_unlock.c: New file.
4425         * sysdeps/ia64/pthreaddef.h: New file.
4426         * sysdeps/ia64/tcb-offsets.sym: New file.
4427         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
4428         * sysdeps/ia64/tls.h: New file.
4430         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
4431         to syscall instead of no arguments.
4433 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
4435         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
4436         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
4437         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
4438         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
4440         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
4441         unused code.
4443         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
4445         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4446         lowlevelbarrier.sym.
4447         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
4448         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
4449         Include lowlevelbarrier.h and don't define offsets locally.
4450         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
4452         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
4453         (__lll_mutex_lock_wait): Reverse order of first two parameters.
4454         (__lll_mutex_timedlock_wait): Likewise.
4455         (lll_mutex_lock): Adjust asm for that.
4456         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
4457         (lll_lock): Adjust asm for operand order change.
4458         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
4459         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
4461         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
4462         Reverse order of parameters.
4463         (__lll_timedwait_tid): Remove regparms attribute.
4464         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
4465         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
4467         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4468         (__lll_timedwait_tid): Remove one unnecessary instruction.
4470         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
4471         __lll_mutex_timedlock_wait only for NOT_IN_libc.
4472         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
4473         lowlevelmutex.S.
4475         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
4476         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
4477         for NOT_IN_libc.
4478         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
4479         lowlevellock.S.
4481         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
4482         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
4483         for libc.so.
4484         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
4485         define LOCK here (if UP is not defined).  The actual code is in
4486         lowlevelmutex.S.
4488         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
4489         LOCK is already defined.  Don't define lll_unlock_wake_cb and
4490         __lll_timedwait_tid for libc.so.
4491         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
4492         define LOCK here (if UP is not defined).  The actual code is in
4493         lowlevellock.S.
4495         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
4496         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
4497         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
4498         instead of lowlevelsem.h.
4499         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4500         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4501         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4503         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4504         lowlevelrwlock.sym.
4505         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
4506         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
4507         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
4509         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
4510         register loading.
4511         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
4512         last changed.  D'oh.
4514         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
4516         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
4517         of __libc_locking_needed.
4518         (lll_trylock): Initialize %eax to zero.
4520         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
4521         pthread_cond_t definition.
4523 2003-03-10  Roland McGrath  <roland@redhat.com>
4525         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
4526         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
4527         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
4528         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
4529         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
4531         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
4532         Instead of setting PD->multiple_threads, set globals
4533         __pthread_multiple_threads and __libc_multiple_threads.
4534         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4535         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
4536         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
4538         * descr.h (struct pthread): Conditionalize first member on
4539         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
4540         containing an anonymous tcbhead_t.  Move `list' member out.
4541         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
4542         * allocatestack.c: Remove use of `header.data.' prefix.
4543         * pthread_create.c: Likewise.
4544         * init.c (__pthread_initialize_minimal_internal): Likewise.
4545         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4546         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
4547         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
4548         * sysdeps/x86_64/tls.h: Likewise.
4549         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
4550         (SINGLE_THREAD_P): Likewise.
4551         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
4552         (SINGLE_THREAD_P): Likewise.
4553         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
4554         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
4556 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
4558         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
4560         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
4561         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4563         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
4564         leftovers from the ia32 code.
4566         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
4567         memory load.
4568         (clear_once_control): Don't load %esi.
4570         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
4571         handling.
4573         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4575         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
4576         * sysdeps/unix/sysv/linux/createthread.c: ...here.
4578         * Makefile (tests): Add tst-cond10.
4579         * tst-cond10.c: New file.
4581 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
4583         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
4584         * tst-signal3.c (do_test): Likewise.
4585         * tst-sem5.c (do_test): Likewise.
4586         * tst-kill6.c (do_test): Likewise.
4587         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
4589         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
4590         of inc/dec.
4591         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
4592         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
4593         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4594         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4595         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4596         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4597         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4598         Likewise.
4599         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4600         Likewise.
4601         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4602         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4603         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4604         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4605         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4606         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
4607         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4608         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4610         * allocatestack.c (allocate_stack): If mprotect() fails free the
4611         TLS memory.
4613 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
4615         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
4617         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
4618         lll_wake_tid.  This was used only to work around kernel limits in
4619         the early days.
4620         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
4621         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
4622         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
4623         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
4625         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
4626         (__pthread_initialize_minimal_internal): Change initialization of
4627         __static_tls_align_m1 appropriately.
4628         * pthreadP.h (__static_tls_align_m1): Renamed from
4629         __static_tls_align.
4630         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
4631         instead of __static_tls_align-1.
4633 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
4635         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
4637         * pthread_create.c: Define __pthread_keys using nocommon
4638         attribute, not by placing it explicitly in bss.
4639         Remove DEFINE_DEALLOC definition.  Not needed anymore.
4641         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
4642         Use it in mmap call to allocate stacks.
4644         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
4646         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
4647         result of the thread function.
4649 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
4651         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
4652         version is just fine.
4654         * sysdeps/unix/sysv/linux/libc_pthread_init.c
4655         (__pthread_child_handler): Renamed from pthread_child_handler,
4656         exported, and marked hidden.  Change all users.
4657         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
4658         free __pthread_child_handler from child list.
4660 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4662         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
4664         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4665         Fix handling of cancellation and failing pthread_mutex_unlock call.
4666         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4667         (__pthread_cond_wait): Likewise.
4669         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4670         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
4671         lll_futex_timed_wait call.
4672         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4673         (pthread_rwlock_timedwrlock): Likewise.
4675         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
4676         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
4677         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
4679         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
4680         check of lll_futex_wake return value.
4682 2003-03-03  Roland McGrath  <roland@redhat.com>
4684         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
4686         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4687         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
4688         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
4690 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
4692         * sysdeps/pthread/timer_create.c (timer_create): Return correct
4693         error for CPU clocks.
4695         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4696         _POSIX_MONOTONIC_CLOCK.
4697         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4699         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
4700         recent kernels.
4702 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
4704         * descr.h (struct pthread): Move cleanup field to the front.
4706 2003-03-01  Roland McGrath  <roland@redhat.com>
4708         * sem_open.c (sem_open): Braino fix.
4710 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
4712         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
4713         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
4714         __pthread_cleanup_pop functionality.
4715         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4717         * descr.h (struct pthread): Move tid field to the front now that
4718         it is often used.
4720         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
4721         (__lll_mutex_timedlock_wait): Remove.
4722         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
4723         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4724         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
4725         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4726         (lll_unlock_wake_cb): Don't save and restore %esi.
4727         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
4728         %esi.
4729         (__lll_timedwait_tid): Add alignment.
4730         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
4731         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
4732         %esi.
4733         (__lll_timedwait_tid): Removed.
4734         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
4735         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
4736         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4737         (pthread_barrier_wait): Don't save, load, and restore %esi for
4738         last thread.
4739         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4740         (__pthread_cond_signal): Don't save, load, and restore %esi.
4741         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
4742         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
4743         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4744         Don't save, load, and restore %esi.
4746 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
4748         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
4749         Release lock before waking up the waiters.
4751         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
4753         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
4754         (reader_thread): Likewise.
4756         * sysdeps/pthread/pthread_rwlock_unlock.c
4757         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
4758         to wake up readers if there are none.
4760         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
4761         Release internal lock before wake threads.
4763 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
4765         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
4766         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
4767         predefined.
4768         * tst-rwlock9.c: Likewise.
4769         * tst-rwlock10.c: New file.
4770         * tst-rwlock11.c: New file.
4772         * Makefile (tests): Add tst-dlsym1.
4773         * tst-dlsym1.c: New file.
4775         * init.c (__pthread_initialize_minimal_internal): Set
4776         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
4777         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
4779 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
4781         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
4783         * tst-cond2.c: Fix sychronization with child.
4785         * tst-rwlock8.c (reader_thread): Remove unused variable.
4787         * Makefile: Add rules to build and run tst-tls3.
4788         * tst-tls3.c: New file.
4789         * tst-tls3mod.c: New file.
4791         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
4792         * tst-rwlock8.c: New file.
4793         * tst-rwlock9.c: New file.
4794         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
4795         complete broken rwlock implementation.
4796         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4797         Likewise.
4798         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4799         Likewise.
4800         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4801         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4802         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
4803         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4804         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4805         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
4806         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4808 2003-02-23  Roland McGrath  <roland@redhat.com>
4810         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
4812 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
4814         * Makefile (tests): Add tst-context1.
4815         * tst-context1.c: New file.
4817         * Makefile (tests): Add tst-tls1 and tst-tls2.
4818         * tst-tls1.c: New file.
4819         * tst-tls2.c: New file.
4821         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
4822         for failed cmpxchg.
4824         * pthread_create.c (start_thread): Set EXITING_BIT early.
4826         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
4827         (THREAD_GETMEM_NC): Likewise.
4829 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
4831         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
4832         off 3 more bytes by using offset-less instructions when possible.
4834         * Makefile: Add dependency for $(objpfx)version.d.
4836         * eintr.c (eintr_source): Add unnecessary return but the compiler
4837         insists.
4839         * tst-kill3.c: Include <unistd.h>.
4841 2003-02-21  Roland McGrath  <roland@redhat.com>
4843         * pthread_create.c (start_thread): Call __libc_thread_freeres.
4845 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
4847         * Makefile (tests): Add tst-eintr1.
4848         (distribute): Add eintr.c.
4849         * tst-eintr1.c: New file.
4850         * eintr.c: New file.
4852         * pthread_cancel.c (pthread_cancel): Use tkill directly.
4854         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
4855         Disallow sending SIGCANCEL.
4857         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
4858         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
4859         * tst-kill1.c: New file.
4860         * tst-kill2.c: New file.
4861         * tst-kill3.c: New file.
4862         * tst-kill5.c: New file.
4863         * tst-kill6.c: New file.
4864         * tst-basic7.c: Renamed to...
4865         * tst-kill4.c: ...this.
4867 2003-02-21  Roland McGrath  <roland@redhat.com>
4869         * Makefile (install-lib-ldscripts): New variable.
4871 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
4873         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
4874         * pthread_cancel.c: Use INVALID_TD_P.
4875         * pthread_detach.c: Likewise.
4876         * pthread_getschedparam.c: Likewise.
4877         * pthread_setschedparam.c: Likewise.
4878         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
4879         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
4880         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
4881         * pthread_timedjoin.c: Likewise.
4883         * tst-basic7.c: Include <signal.h>.
4885         * pthread_join.c (pthread_join): Limited checking for invalid
4886         descriptors.
4887         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
4889 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
4891         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
4892         beginning of the loop.  Clear the entire first block of TSD.
4893         * Makefile (tests): Add tst-key4.
4894         * tst-key4.c: New file.
4896 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
4898         * Makefile (tests): Add tst-basic7.
4899         * tst-basic7.c: New file.
4901         * pthread_create.c (deallocate_tsd): Mark as internal_function.
4902         Add some more __builtin_expect.
4904         * pthreadP.h: Define dummy version of DEBUGGING_P.
4906 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
4908         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
4909         _POSIX_THREAD_PRIORITY_SCHEDULING.
4910         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
4911         _XOPEN_REALTIME_THREADS.
4912         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4914         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
4915         kernel returns EINVAL for PID <= 0, work around it.
4917         * Makefile (tests): Add tst-signal5.
4918         * tst-signal5.c: New file.
4920         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
4921         and LOGIN_NAME_MAX.
4923         * tst-cancel1.c (tf): Block all signals.
4925         * Makefile (tests): Add tst-basic6.
4926         * tst-basic6.c: New file.
4928         * tst-basic1.c: Add test for process ID.
4930         * Makefile (tests): Add tst-cancel10.
4931         * tst-cancel10.c: New file.
4933         * Makefile (tests): Add tst-signal4.
4934         * tst-signal4.c: New file.
4936         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
4937         __sigismember instead of sigismember.  Add __builtin_expect.
4939 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
4941         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
4942         pthread_setcancelstate, and pthread_rwlock_setpshared.
4944         * tst-cancel7.c (do_test): Make sure the pid file exists before
4945         canceling the thread.
4947         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
4948         pthread_rwlock_timedrdlock tests.
4949         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
4950         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4951         Check for invalid tv_nsec field.
4952         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4953         Likewise.
4955         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
4956         recursive mutex of overflow.
4958         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
4960         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
4961         going into an endless loop.
4962         * Makefile (tests): Add tst-cancel9.
4963         * tst-cancel9.c: New file.
4965         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
4967 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
4969         * tst-mutex5.c (do_test): Add more timedlock tests.
4971         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
4972         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
4974         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4975         use INLINE_SYSCALL.  Error number is returned, not -1.
4977         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
4978         and __deallocate_stack with internal_function.
4979         * pthread_create.c: Adjust definitions appropriately.
4980         * allocatestack.c: Likewise.
4982         * pthread_join.c: Add one more __builtin_expect.
4983         * pthread_timedjoin.c: Likewise.
4985         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
4986         not data of sequence number does not match.
4987         Add one __builtin_expect.
4989         * Makefile (tests): Add tst-clock1.
4990         * tst-clock1.c: New file.
4992         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
4993         negative arguments.
4994         * Makefile (tests): Add tst-basic5.
4995         * tst-basic5.c: New file.
4997 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
4999         * Makefile (tests): Add tst-basic4.
5000         * tst-basic4.c: New file.
5002         * pthreadP.h: Add declaraction for __nptl_nthreads.
5003         * pthread_create.c: Define __nptl_nthreads
5004         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
5005         after thread is done.  If then zero, call exit(0).
5006         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5007         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
5008         * init.c (pthread_functions): Initialize ptr_nthreads.
5009         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
5010         (__reclaim_stacks): Decrement __nptl_nthreads.
5011         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
5012         Define.
5013         * Makefile (tests): Add tst-basic3.
5014         * tst-basic3.c: New file.
5016         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
5017         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
5018         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
5019         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
5020         if asynchronous canceling is enabled.
5021         * pthread_join.c (pthread_join): When recognizing circular joins,
5022         take into account the other thread might be already canceled.
5023         * Makefile (tests): Add tst-join5.
5024         * tst-join5.c: New file.
5026         * Makefile (tests): Add tst-join4.
5027         * tst-join4.c: New file.
5029 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
5031         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
5033 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5035         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
5036         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
5037         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
5038         warning.
5039         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
5040         to avoid warning.
5041         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
5042         error if lll_futex_wake failed.
5044 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
5046         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
5047         handling of cancellation and failung pthread_mutex_unlock call.
5048         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5049         * Makefile (tests): Add tst-cond8 and tst-cond9.
5050         * tst-cond8.c: New file.
5051         * tst-cond9.c: New file.
5053         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
5055         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
5056         non-standard initializers with __USE_GNU.
5058         * Makefile (tests): Add tst-cleanup3.
5059         * tst-cleanup3.c: New file.
5061 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
5063         * Makefile (tests): Add tst-attr1 and tst-attr2.
5064         * tst-attr1.c: New file.
5065         * tst-attr2.c: New file.
5067         * Makefile: Add rules to build and run tst-atfork2 test.
5068         * tst-atfork2.c: New file.
5069         * tst-atfork2mod.c: New file.
5071         * sysdeps/unix/sysv/linux/unregister-atfork.c
5072         (__unregister_atfork): Free the memory allocated for the handlers
5073         after removing them from the lists.
5075         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
5076         cleanup function.
5078         * tst-atfork1.c (do_test): Wait for the child we forked.
5079         Report error in child.
5081         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
5083         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
5085 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
5087         * Makefile (tests): Add tst-cancel8.
5088         * tst-cancel8.c: New file.
5090         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
5091         clearing of control variable.
5092         * Makefile (tests): Add tst-once3 and tst-once4.
5093         * tst-once3.c: New file.
5094         * tst-once4.c: New file.
5096 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
5098         * sysdeps/sh/Makefile: New file.
5099         * sysdeps/sh/bits/atomic.h: New file.
5100         * sysdeps/sh/pthread_spin_init.c: New file.
5101         * sysdeps/sh/pthread_spin_lock.c: New file.
5102         * sysdeps/sh/pthread_spin_trylock.S: New file.
5103         * sysdeps/sh/pthread_spin_unlock.S: New file.
5104         * sysdeps/sh/pthreaddef.h: New file.
5105         * sysdeps/sh/tcb-offsets.sym: New file.
5106         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
5107         * sysdeps/sh/tls.h: New file.
5108         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
5109         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
5110         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
5111         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
5112         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
5113         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
5114         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
5115         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
5116         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
5117         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
5118         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
5119         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
5120         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
5121         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
5122         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
5123         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
5124         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
5125         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
5126         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
5127         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
5128         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
5129         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
5130         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
5131         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
5132         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
5133         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
5134         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
5135         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
5136         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
5137         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
5139 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
5141         * tst-cond2.c: Rearrange code to not rely on behavior undefined
5142         according to POSIX.
5144         * tst-basic2.c (do_test): Lock mutex before creating the thread.
5146 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
5148         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
5149         (TLS_GET_FS): New #define.
5150         (TLS_SET_FS): New #define.
5151         Correct value of __NR_set_thread_area.
5153         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
5155 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
5157         * Makefile (tests): Add tst-popen1.
5158         * tst-popen1.c: New file.
5160         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
5161         but inactive generalization.
5162         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5163         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5164         Minor optimization, remove one instruction.
5165         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5167 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5169         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
5171 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5173         * init.c (__NR_set_tid_address): Add #ifdef for s390.
5174         * sysdeps/pthread/pthread_barrier_wait.c: New file.
5175         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
5176         * sysdeps/pthread/pthread_cond_signal.c: New file.
5177         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
5178         * sysdeps/pthread/pthread_cond_wait.c: New file.
5179         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
5180         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
5181         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
5182         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
5183         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
5184         * sysdeps/s390/Makefile: New file.
5185         * sysdeps/s390/bits/atomic.h: New file.
5186         * sysdeps/s390/pthread_spin_init.c: New file.
5187         * sysdeps/s390/pthread_spin_lock.c: New file.
5188         * sysdeps/s390/pthread_spin_trylock.c: New file.
5189         * sysdeps/s390/pthread_spin_unlock.c: New file.
5190         * sysdeps/s390/pthreaddef.h: New file.
5191         * sysdeps/s390/tcb-offsets.sym: New file.
5192         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
5193         * sysdeps/s390/tls.h: New file.
5194         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
5195         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
5196         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
5197         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
5198         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
5199         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
5200         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5201         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
5202         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
5203         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
5204         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
5205         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
5206         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
5207         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
5208         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
5209         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
5210         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
5211         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
5212         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
5213         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
5214         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
5215         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5216         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
5218 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
5220         * atomic.h: Add a couple more default implementations.
5221         (atomic_compare_and_exchange_acq): Use
5222         __arch_compare_and_exchange_32_acq in return value definition.  It
5223         always exists.
5224         (atomic_bit_set): Renamed from atomic_set_bit.
5225         Add missing atomic_ prefixes.
5227         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
5228         thread library is available, use correct value to mark initialized
5229         once variable.
5231 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
5233         * allocatestack.c (allocate_stack): Use __getpagesize instead of
5234         __sysconf to determine pagesize.
5236         * pthread_create.c: Include <atomic.h>.
5237         * allocatestack.c (allocate_stack): Implement coloring of the
5238         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
5239         size minus one.  Adjust users.
5240         * sysdeps/i386/i686/Makefile: New file.
5242 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
5244         * allocatestack.c: Improve comment throughout the file.
5246         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5247         (__lll_lock_wait): Add branch prediction.
5248         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
5249         (__lll_lock_wait): Likewise.
5250         (lll_unlock_wake_cb): Removed.
5252 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
5254         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
5255         _POSIX_THREAD_PRIORITY_SCHEDULING.
5257 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
5259         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5260         Fix return type of ptr___pthread_getspecific.
5262 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
5264         * Makefile (tests): Add tst-umask1.
5265         (tst-umask1-ARGS): Define.
5266         * tst-umask1.c: New file.
5268 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
5270         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
5271         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
5272         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
5273         pthread_rwlock_unlock.
5274         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
5275         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
5276         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
5277         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
5278         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5279         New file.
5280         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
5281         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5282         New file.
5283         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
5284         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
5285         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
5286         New file.
5287         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
5288         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
5289         New file.
5290         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
5291         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
5292         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
5293         New file.
5294         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
5295         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
5296         New file.
5297         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
5299         * Makefile (libpthread-routines): Remove lowlevelcond and
5300         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
5301         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
5302         and pthread_cond_broadcast.
5303         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
5304         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
5305         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
5306         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
5307         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
5308         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
5309         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
5310         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
5311         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
5312         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
5313         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
5314         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
5315         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
5316         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
5317         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
5318         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
5319         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
5320         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
5321         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
5322         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
5323         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
5324         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
5325         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
5326         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
5327         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
5328         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
5329         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
5330         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
5331         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
5332         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
5333         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
5335         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
5336         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
5337         of the code is moved to ...
5338         * sysdeps/pthread/createthread.c: ...here.  New file.
5340 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
5342         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
5343         (__new_sem_post): Clear %eax before returning.
5344         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
5346         * Makefile (tests): Add tst-cleanup2.
5347         * tst-cleanup2.c: New file.
5349         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
5350         Interpret first parameter correctly.
5352 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
5354         * Makefile (headers): Add bits/semaphore.h.
5356 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
5358         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
5359         if not SHARED.
5361 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
5363         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
5364         must be used and mapping failed.
5365         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
5367         * Makefile (CFLAGS-pthread_self.os): Define this, not
5368         CFLAGS-pthread_self.c.
5370 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5372         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
5373         lll_unlock_wake_cb.
5375         * Makefile (libpthread-routines): Add version.  Add rules to build
5376         version.os and banner.h.
5377         * version.c: New file.
5379 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
5381         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
5382         the alias unconditional.
5383         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
5385 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5387         * Makefile (CFLAGS-pthread_self.c): New definition.
5389 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5391         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
5392         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
5393         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
5394         * init.c (__pthread_initialize_minimal_internal): Likewise.
5396 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
5398         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
5400         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
5401         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5402         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5403         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
5404         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5405         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5407 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5409         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
5410         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
5411         * tst-cancel-wrappers.sh: Remove all exceptions.
5413 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
5415         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
5416         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
5418         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
5419         Use __libc_pthread_functions array if SHARED.
5421         * pthreadP.h: Move pthread_cond_2_0_t definition to...
5422         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
5424         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
5425         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
5426         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
5427         __libc_ptf_call instead of __libc_maybe_call.
5428         (PTF): New #define.
5429         (__libc_cleanup_region_start): Wrap function name with PTF call.
5430         (__libc_cleanup_region_end): Likewise.
5431         (__libc_cleanup_end): Likewise.
5433         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
5434         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
5435         * pthread_key_create.c: Add __pthread_key_create_internal alias.
5436         * pthreadP.h: Add prototypes.
5438         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
5439         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
5440         __pthread_rwlock_unlock aliases.
5441         * pthreadP.h: Add prototypes for new aliases.
5443         * pthreadP.h (struct pthead_functions): Moved to...
5444         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
5445         * init.c (pthread_functions): Add initializers for new elements.
5447         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
5448         __pthread_cleanup_pop_restore aliases.
5449         * pthreadP.h: Add prototypes.
5451         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
5452         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
5453         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
5454         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
5455         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5456         * pthreadP.h: Adjust prototypes and callers.
5458 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
5460         * Makefile (tests): Add tst-cancel7.
5461         (tst-cancel7-ARGS): New variable.
5462         * tst-cancel7.c: New file.
5464         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
5465         around gcc defficiencies.
5466         * old_pthread_cond_signal.c: Likewise.
5467         * old_pthread_cond_timedwait.c: Likewise.
5468         * old_pthread_cond_wait.c: Likewise.
5470         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
5472 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5474         * Makefile (tests): Add tst-cond7.
5475         * tst-cond7.c: New file.
5477         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5478         (condvar_cleanup): Get condvar address from the right place.
5480         * atomic.h: Correct definitions of atomic_full_barrier,
5481         atomic_read_barrier, atomic_write_barrier.
5483         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
5484         race-free.
5485         * old_pthread_cond_signal.c: Likewise.
5486         * old_pthread_cond_timedwait.c: Likewise.
5487         * old_pthread_cond_wait.c: Likewise.
5489 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
5491         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
5493 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5495         * pthreadP.h (pthread_cond_2_0_t): New type.
5496         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
5497         Use new type for the 2.0 condvar function prototypes.
5498         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
5499         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
5500         parameter.
5501         * old_pthread_cond_destroy.c: Likewise.
5502         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
5503         * old_pthread_cond_signal.c: Likewise.
5504         * old_pthread_cond_timedwait.c: Likewise.
5505         * old_pthread_cond_wait.c: Likewise.
5507         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5508         (__pthread_cond_wait): Don't save cancellation mode and seq value
5509         in same location.
5511         * herrno.c (__h_errno_location): Don't define as weak.
5513 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5515         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
5516         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
5517         and pthread_cond_wait.
5518         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
5519         Renamed to...
5520         (__pthread_cond_broadcast_2_0): ... this.
5521         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
5522         Renamed to...
5523         (__pthread_cond_destroy_2_0): ... this.
5524         * old_pthread_cond_init.c (__old_pthread_cond_init):
5525         Renamed to...
5526         (__pthread_cond_init_2_0): ... this.
5527         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
5528         Renamed to...
5529         (__pthread_cond_signal_2_0): ... this.
5530         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
5531         Renamed to...
5532         (__pthread_cond_wait_2_0): ... this.
5533         * pthread_cond_destroy.c: Include shlib-compat.h.
5534         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
5535         * pthread_cond_init.c: Include shlib-compat.h.
5536         (pthread_cond_init): Change strong_alias into versioned_symbol.
5537         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
5538         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
5539         fields.
5540         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
5541         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
5542         __pthread_cond_wait_2_0): New prototypes.
5543         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
5544         __old_pthread_cond_init, __old_pthread_cond_signal,
5545         __old_pthread_cond_wait): Removed.
5546         * init.c: Include shlib-compat.h.
5547         (pthread_functions): Guard ptr___pthread_attr_init_2_0
5548         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
5549         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
5550         ptr___pthread_cond_*_2_0 fields.
5551         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
5552         pthread_cond_*@GLIBC_2.0 compatibility symbols.
5554         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
5555         LIBC_SIGACTION was not yet defined.
5556         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
5557         [!defined LIBC_SIGACTION] (__sigaction): New function and
5558         libc_hidden_weak.
5559         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
5560         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
5562 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5564         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
5566 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
5568         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5569         New, larger type definition.
5570         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
5571         implementation.
5572         * Versions [libpthread]: Add definitions for new pthread_cond_*
5573         interfaces for version GLIBC_2.3.2.
5574         * pthread_cond_init.c: Update initialization for new type definition.
5575         * Makefile (libpthread-routines): Remove pthread_cond_wait,
5576         pthread_cond_timedwait, pthread_cond_signal, and
5577         pthread_cond_broadcast.  Add old_pthread_cond_init,
5578         old_pthread_cond_destroy, old_pthread_cond_wait,
5579         old_pthread_cond_timedwait, old_pthread_cond_signal, and
5580         old_pthread_cond_broadcast.
5581         * old_pthread_cond_broadcast.c: New file.
5582         * old_pthread_cond_destroy.c: New file.
5583         * old_pthread_cond_init.c: New file.
5584         * old_pthread_cond_signal.c: New file.
5585         * old_pthread_cond_timedwait.c: New file.
5586         * old_pthread_cond_wait.c: New file.
5587         * pthreadP.h: Add prototypes for the compatibility interfaces.
5589         * pthread_cond_destroy.c: Don't include <errno.h>.
5591 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
5593         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
5594         unnecessary zero offset when addressing MUTEX.
5596 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
5598         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
5599         __register_atfork.
5600         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
5601         for __register_atfork.
5603 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
5605         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
5606         instead of ASSEMBLER test macro.
5608         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
5609         __libc_current_sigrtmax): Add libc_hidden_def.
5611         * sysdeps/pthread/list.h: Remove assert.h include.
5613 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
5615         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
5616         __pthread_initialize_minimal_internal not
5617         __pthread_initialize_minimal.
5619 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
5621         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
5622         __pthread_initialize_minimal as hidden.
5624         * init.c (__pthread_initialize_minimal_internal): Don't mark as
5625         constructor.
5627 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
5629         * Makefile ($(inst_libdir)/libpthread.so): Depend on
5630         $(common-objpfx)format.lds, include that into the output script.
5631         Fix comment.
5632         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
5634 2002-12-28  Andreas Jaeger  <aj@suse.de>
5636         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
5637         nsec resolution changes.
5638         (xstat64_conv): Likewise.
5639         (xstat32_conv): Likewise.
5640         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
5641         struct kernel_stat.
5642         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
5643         structs stat and stat64.
5644         * time/time.h (__timespec_defined): Define for __USE_MISC.
5645         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
5647 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
5649         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
5650         argument.
5651         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
5652         (pthread_exit): Use strong_alias to avoid warnings.
5653         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
5654         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
5655         ptr___pthread_attr_init_2_*.
5656         * init.c (pthread_functions): Adjust.
5658 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
5660         * forward.c: Make all functions available by default again.  It
5661         caused too much trouble.
5663         * pt-siglongjmp.c: Removed.
5665 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
5667         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
5668         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
5669         * sysdeps/i386/Makefile: New file.
5670         * sysdeps/i386/tcb-offsets.sym: New file.
5671         * sysdeps/pthread/tcb-offsets.h: New file.
5672         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5673         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
5675         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
5676         __register_atfork...
5677         (GLIBC_2.3.2): ...here.
5679 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
5681         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
5682         pthread_attr_setstackaddr with __attribute_deprecated__.
5684 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
5686         * pt-system.c (system): Remove cancellation handling.
5687         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
5688         cancellation routines.
5690 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
5692         * descr.h: Include <dl-sysdep.h>.
5693         (struct pthread): Move header.data.list to the back of the struct.
5694         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
5695         (MULTIPLE_THREADS_OFFSET): Adjust offset.
5696         (SYSINFO_OFFSEET): Likewise.
5698 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
5700         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
5701         Define.
5702         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
5703         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
5704         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
5705         (USE_DL_SYSINFO): Undef.
5707 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
5709         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
5710         $(common-objpfx)libc.so.
5711         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
5712         it is bigger than pipe buffer size even on arches with bigger
5713         page size.
5714         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
5716 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
5718         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
5719         correct errno access for case that USE___THREAD is not defined.
5721 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
5723         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
5724         Patch by Marijn Ros <marijn@mad.scientist.com>.
5726 2002-12-22  Roland McGrath  <roland@redhat.com>
5728         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
5730 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
5732         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
5734 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
5736         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
5737         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
5738         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
5740         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
5741         of int $0x80.
5742         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
5743         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
5744         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
5745         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5746         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5747         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
5748         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
5749         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
5751         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
5752         sysenter.
5753         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
5755         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
5757         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
5758         in new TCB.
5759         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
5760         that sysinfo is properly initialized.
5761         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
5762         to 1 only for ld.so.
5764         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
5765         RTLD_CORRECT_DYNAMIC_WEAK.
5767 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
5769         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
5770         Use return 0 as 6th argument to FORWARD4.
5771         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
5773 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
5775         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
5776         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
5777         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
5778         (INIT_SYSINFO): New #define.
5779         (TLS_TP_INIT): Use INIT_SYSINFO.
5780         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5781         At test to make sure SYSINFO_OFFSET value is correct.
5782         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
5784 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
5786         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
5787         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
5788         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
5789         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
5790         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
5791         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
5792         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
5794 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
5796         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
5797         macro instead of using int $0x80 directly.
5799         * sysdeps/pthread/bits/stdio-lock.h: New file.
5800         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
5801         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
5802         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
5803         * Makefile (routines): Add libc-lowlevelmutex.
5805         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
5806         __i686.get_pc_thunk.dx.
5808 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
5810         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
5811         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
5812         ($(objpfx)tst-cancel-wrappers.out): New rule.
5813         * tst-cancel-wrappers.sh: New test.
5814         * tst-locale1.c: Include signal.h.
5815         (uselocale): Test static linking of __libc_current_sigrt*.
5817 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
5819         * Makefile (tests): Add tst-cancel6.
5820         * tst-cancel6.c: New file
5822 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
5824         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
5825         Define meaningfully for assembler as well.
5826         * pthreadP.h (struct pthread_functions): Remove
5827         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
5828         and ptr_pthread_attr_init_2_1 fields.
5829         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
5830         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
5831         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
5832         (FORWARD3): Define using FORWARD4.
5833         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
5834         versions.
5835         * pt-system.c: Remove duplicate stdlib.h include.
5837 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
5839         * sem_init.c: Define sem_init@GLIBC_2.0.
5840         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
5841         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
5843         * flockfile.c: Moved to...
5844         * sysdeps/pthread/flockfile.c: ...here.  New file.
5845         * funlockfile.c: Moved to...
5846         * sysdeps/pthread/funlockfile.c: ...here.  New file.
5847         * ftrylockfile.c: Moved to...
5848         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
5850 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
5852         * libc-cancellation.c: Guard both function with
5853         #if !defined NOT_IN_libc.
5854         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
5855         automatically provided pthread wrappers.
5856         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
5857         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
5858         nor in libpthread.
5859         * pt-open.c: Removed.
5860         * pt-fcntl.c: Removed.
5861         * pt-fsync.c: Removed.
5862         * pt-lseek.c: Removed.
5863         * pt-msgrcv.c: Removed.
5864         * pt-msgsnd.c: Removed.
5865         * pt-msync.c: Removed.
5866         * pt-nanosleep.c: Removed.
5867         * pt-open64.c: Removed.
5868         * pt-pause.c: Removed.
5869         * pt-pread.c: Removed.
5870         * pt-pread64.c: Removed.
5871         * pt-pwrite.c: Removed.
5872         * pt-pwrite64.c: Removed.
5873         * pt-read.c: Removed.
5874         * pt-recv.c: Removed.
5875         * pt-recvfrom.c: Removed.
5876         * pt-recvmsg.c: Removed.
5877         * pt-send.c: Removed.
5878         * pt-sendto.c: Removed.
5879         * pt-sigtimedwait.c: Removed.
5880         * pt-sigwait.c: Removed.
5881         * pt-wait.c: Removed.
5882         * pt-waitpid.c: Removed.
5883         * pt-write.c: Removed.
5884         * pt-accept.c: Removed.
5885         * pt-close.c: Removed.
5886         * pt-connect.c: Removed.
5887         * pt-lseek64.c: Removed.
5888         * pt-sendmsg.c: Removed.
5889         * pt-tcdrain.c: Removed.
5891 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
5893         * init.c (__pthread_initialize_minimal_internal): Renamed from
5894         __pthread_initialize_minimal.  Make old name an alias.  This
5895         converts a normal relocation into a relative relocation.
5897         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
5899         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
5900         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
5901         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
5902         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
5903         pt-sigwaitinfo, pt-waitid, and pt-writev.
5904         * pt-creat.c: Removed.
5905         * pt-poll.c: Removed.
5906         * pt-pselect.c: Removed.
5907         * pt-readv.c: Removed.
5908         * pt-select.c: Removed.
5909         * pt-sigpause.c: Removed.
5910         * pt-sigsuspend.c: Removed.
5911         * pt-sigwaitinfo.c: Removed.
5912         * pt-waitid.c: Removed.
5913         * pt-writev.c: Removed.
5915         * init.c (pthread_functions): New variable.
5916         (__pthread_initialize_minimal): Pass pointer to pthread_functions
5917         (or NULL) to __libc_pthread_init.
5918         * forward.c: Rewrite to use __libc:pthread_functions array to get
5919         function addresses.
5920         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
5921         prototype.
5922         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5923         Take new parameter.  Copy content of variable pointed to by it
5924         to __libc_pthread_init.
5926         * pthreadP.h (struct pthread_functions): New type.
5927         (__libc_pthread_init): Declare.
5929         * pthread_attr_destroy.c: Add namespace protected alias.
5930         * pthread_attr_getdetachstate.c: Likewise.
5931         * pthread_attr_getinheritsched.c: Likewise.
5932         * pthread_attr_getschedparam.c: Likewise.
5933         * pthread_attr_getschedpolicy.c: Likewise.
5934         * pthread_attr_getscope.c: Likewise.
5935         * pthread_attr_setdetachstate.c: Likewise.
5936         * pthread_attr_setinheritsched.c: Likewise.
5937         * pthread_attr_setschedparam.c: Likewise.
5938         * pthread_attr_setschedpolicy.c: Likewise.
5939         * pthread_attr_setscope.c: Likewise.
5940         * pthread_cond_broadcast.c: Likewise.
5941         * pthread_cond_destroy.c: Likewise.
5942         * pthread_cond_init.c: Likewise.
5943         * pthread_cond_signal.c: Likewise.
5944         * pthread_cond_wait.c: Likewise.
5945         * pthread_condattr_destroy.c: Likewise.
5946         * pthread_condattr_init.c: Likewise.
5947         * pthread_equal.c: Likewise.
5948         * pthread_exit.c: Likewise.
5949         * pthread_getschedparam.c: Likewise.
5950         * pthread_self.c: Likewise.
5951         * pthread_setcancelstate.c: Likewise.
5952         * pthread_setschedparam.c: Likewise.
5953         * pthread_mutex_destroy.c: Likewise.
5954         * pthread_mutex_init.c: Likewise.
5955         * pthreadP.h: Add prototypes for the aliases.
5957         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
5958         multiple_threads member in correct TCB to 1.
5960         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
5961         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
5962         member of thread decriptor, otherwise return unconditionally 1.
5964 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
5966         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
5967         regular Linux version.  Remove file.
5968         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
5969         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
5970         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
5971         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
5972         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
5973         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
5974         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
5975         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
5976         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
5977         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
5978         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
5979         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
5980         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
5981         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
5982         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
5983         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
5984         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
5985         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
5986         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
5987         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
5988         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
5989         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
5990         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
5991         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
5992         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
5993         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
5994         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
5995         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
5996         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
5997         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
5999 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
6001         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
6002         * sysdeps/unix/sysv/linux/open.c: Removed.
6003         * sysdeps/unix/sysv/linux/fsync.c: Removed.
6004         * sysdeps/unix/sysv/linux/lseek.c: Removed.
6005         * sysdeps/unix/sysv/linux/msync.c: Removed.
6006         * sysdeps/unix/sysv/linux/read.c: Removed.
6007         * sysdeps/unix/sysv/linux/close.c: Removed.
6008         * sysdeps/unix/sysv/linux/creat.c: Removed.
6009         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
6010         * sysdeps/unix/sysv/linux/pause.c: Removed.
6011         * sysdeps/unix/sysv/linux/select.c: Removed.
6012         * sysdeps/unix/sysv/linux/write.c: Removed.
6014 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
6016         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
6017         element in TCB to see whether locking is needed.
6019         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
6020         MULTIPLE_THREADS_OFFSET value is correct.
6022         * sysdeps/unix/sysv/linux/close.c: New file.
6023         * sysdeps/unix/sysv/linux/connect.S: New file.
6024         * sysdeps/unix/sysv/linux/creat.c: New file.
6025         * sysdeps/unix/sysv/linux/fsync.c: New file.
6026         * sysdeps/unix/sysv/linux/llseek.c: New file.
6027         * sysdeps/unix/sysv/linux/lseek.c: New file.
6028         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
6029         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
6030         * sysdeps/unix/sysv/linux/msync.c: New file.
6031         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
6032         * sysdeps/unix/sysv/linux/open.c: New file.
6033         * sysdeps/unix/sysv/linux/open64.c: New file.
6034         * sysdeps/unix/sysv/linux/pause.c: New file.
6035         * sysdeps/unix/sysv/linux/poll.c: New file.
6036         * sysdeps/unix/sysv/linux/pread.c: New file.
6037         * sysdeps/unix/sysv/linux/pread64.c: New file.
6038         * sysdeps/unix/sysv/linux/pselect.c: New file.
6039         * sysdeps/unix/sysv/linux/pwrite.c: New file.
6040         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
6041         * sysdeps/unix/sysv/linux/readv.c: New file.
6042         * sysdeps/unix/sysv/linux/recv.S: New file.
6043         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
6044         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
6045         * sysdeps/unix/sysv/linux/select.c: New file.
6046         * sysdeps/unix/sysv/linux/send.S: New file.
6047         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
6048         * sysdeps/unix/sysv/linux/sendto.S: New file.
6049         * sysdeps/unix/sysv/linux/sigpause.c: New file.
6050         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
6051         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6052         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6053         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6054         * sysdeps/unix/sysv/linux/system.c: New file.
6055         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
6056         * sysdeps/unix/sysv/linux/wait.c: New file.
6057         * sysdeps/unix/sysv/linux/waitid.c: New file.
6058         * sysdeps/unix/sysv/linux/waitpid.c: New file.
6059         * sysdeps/unix/sysv/linux/writev.c: New file.
6060         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
6062         * pt-readv.c: Fix comment.
6064 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
6066         * tst-cleanup1.c: Include stdlib.h.
6068         * tst-cancel5.c: New test.
6069         * Makefile (tests): Add tst-cancel5.
6070         (tst-cancel5): Link against libc.so libpthread.so in that order.
6072 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
6074         * forward.c (test_loaded): Prevent recursive calls.
6076         * Makefile (routines): Add libc-cancellation.
6077         * libc-cancellation.c: New file.
6078         * descr.h (struct pthread): Add multiple_threads field.
6079         * allocatestack.c (allocate_stack): Initialize multiple_header field of
6080         new thread descriptor to 1.
6081         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
6082         Initialize multiple_thread field after successful thread creation.
6083         * cancellation.c (__do_cancel): Move to pthreadP.h.
6084         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
6085         (__pthread_disable_asynccancel): Add internal_function attribute.
6086         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
6087         * pthread_setcancelstate.c: Likewise.
6088         * pthread_setcanceltype.c: Likewise.
6089         * pthread_exit.c: Likewise.
6090         * pthreadP.h (CANCELLATION_P): Likewise.
6091         (__do_cancel): Define as static inline.
6092         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
6093         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
6094         declarations.
6095         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
6096         fields.  Define MULTIPLE_THREADS_OFFSET.
6097         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
6098         declaration.
6099         * sysdeps/unix/sysv/linux/accept.S: New file.
6100         * sysdeps/unix/sysv/linux/read.c: New file.
6101         * sysdeps/unix/sysv/linux/write.c: New file.
6102         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
6103         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
6104         initialization of __libc_locking_needed.
6105         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
6106         __libc_locking_needed, use multiple_threads field in TCB.
6107         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6109 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
6111         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
6112         version.
6113         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
6115         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
6116         access to __libc_locking_needed for PIC.
6118 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
6120         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
6121         declare for libc.so.
6122         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
6123         expression.
6124         (__libc_lock_lock): Put into statement expression.
6125         (__libc_lock_unlock): Remove trailing semicolon.
6126         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
6128 2002-12-12  Roland McGrath  <roland@redhat.com>
6130         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
6131         "m" constraint to refer to __libc_locking_needed.  Declare it here.
6133 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
6135         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
6136         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
6137         Initialize __libc_locking_needed.
6138         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
6139         instead of __register_pthread_fork_handler.
6140         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
6141         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
6142         fork-gen with libc_pthread_init.
6143         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
6144         of __register_pthread_fork_handler.
6145         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
6146         of __register_pthread_fork_handler.
6147         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
6148         __libc_locking_needed to determine whether lock prefix can be avoided.
6149         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6151 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
6153         * Makefile (tests): Add tst-cleanup1.
6154         * tst-cleanup1.c: New file.
6155         * cancellation.c (__cleanup_thread): Removed.
6156         (__do_cancel): Remove call to __cleanup_thread.
6157         * pthreadP.h: Remove __cleanup_thread prorotype.
6159         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6160         Remember function and argument even if cancellation handler
6161         function is not available.
6162         (__libc_cleanup_region_end): Execute registered function directly if
6163         pthread functions are not available.
6164         (__libc_cleanup_end): Likewise.
6166         * init.c (__pthread_initialize_minimal): Fix initialization in
6167         static lib by preventing gcc from being too clever.
6169 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
6171         * init.c (__pthread_initialize_minimal): Remove unneccesary
6172         sigaddset call.
6174         * Makefile (tests): We can run tst-locale2 now.
6176 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
6178         * Versions: Remove duplicated sigwait entry.
6180 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
6182         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
6183         inside libpthread.
6185         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
6187         * pthreadP.h: Declare __pthread_enable_asynccancel and
6188         __pthread_disable_asynccancel.
6189         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
6190         (CANCEL_RESET): Use __pthread_disable_asynccancel.
6191         * cancellation.c (__pthread_enable_asynccancel): New function.
6192         (__pthread_disable_asynccancel): New function.
6193         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
6194         * pt-close.c: Likewise.
6195         * pt-connect.c: Likewise.
6196         * pt-creat.c: Likewise.
6197         * pt-fcntl.c: Likewise.
6198         * pt-fsync.c: Likewise.
6199         * pt-lseek.c: Likewise.
6200         * pt-lseek64.c: Likewise.
6201         * pt-msgrcv.c: Likewise.
6202         * pt-msgsnd.c: Likewise.
6203         * pt-msync.c: Likewise.
6204         * pt-nanosleep.c: Likewise.
6205         * pt-open.c: Likewise.
6206         * pt-open64.c: Likewise.
6207         * pt-pause.c: Likewise.
6208         * pt-poll.c: Likewise.
6209         * pt-pread.c: Likewise.
6210         * pt-pread64.c: Likewise.
6211         * pt-pselect.c: Likewise.
6212         * pt-pwrite.c: Likewise.
6213         * pt-pwrite64.c: Likewise.
6214         * pt-read.c: Likewise.
6215         * pt-readv.c: Likewise.
6216         * pt-recv.c: Likewise.
6217         * pt-recvfrom.c: Likewise.
6218         * pt-recvmsg.c: Likewise.
6219         * pt-select.c: Likewise.
6220         * pt-send.c: Likewise.
6221         * pt-sendmsg.c: Likewise.
6222         * pt-sendto.c: Likewise.
6223         * pt-sigpause.c: Likewise.
6224         * pt-sigsuspend.c: Likewise.
6225         * pt-sigtimedwait.c: Likewise.
6226         * pt-sigwait.c: Likewise.
6227         * pt-sigwaitinfo.c: Likewise.
6228         * pt-system.c: Likewise.
6229         * pt-tcdrain.c: Likewise.
6230         * pt-wait.c: Likewise.
6231         * pt-waitid.c: Likewise.
6232         * pt-waitpid.c: Likewise.
6233         * pt-write.c: Likewise.
6234         * pt-writev.c: Likewise.
6235         * pthread_join.c: Likewise.
6236         * pthread_timedjoin.c: Likewise.
6238         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
6239         (__xpg_sigpause): New function.
6240         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
6242 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
6244         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
6246         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
6247         _GI_pthread_cleanup_pop to pthreadP.h.
6249         * ftrylockfile.c: Use _IO_lock_trylock instead of
6250         pthread_mutex_trylock.
6252         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
6253         (CANCEL_RESET): Likewise.
6254         (__pthread_setcanceltype_): Declare.
6255         (__pthread_mutex_lock_internal): Declare.
6256         (__pthread_mutex_unlock_internal): Declare.
6257         (__pthread_once_internal): Declare.
6258         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
6259         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
6261         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
6262         and pthread_mutex_unlock.
6263         * pthread_cond_wait.c: Likewise.
6264         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
6265         * pthread_mutex_unlock.c: Likewise.
6267         * pthread_setcanceltype.c: Add additional alias
6268         __pthread_setcanceltype.
6270         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
6271         * sem_open.c (sem_open): Likewise.
6272         Use __libc_open, __libc_write, and __libc_close instead of
6273         open, write, and close respectively.
6275         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
6276         Rewrite as statement expression since it must return a value.
6278         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
6279         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
6280         __pthread_kill.
6282         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
6283         alias __pthread_once_internal.
6285         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
6287 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
6289         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
6290         * tst-stdio1.c: New file.
6291         * tst-stdio2.c: New file.
6293         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
6295         * Makefile (tests): Comment out tst-locale2 for now.
6296         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
6298         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
6299         -D_IO_MTSAFE_IO.
6300         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
6301         Use _IO_lock_init instead of explicit assignment.
6303         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
6304         Define __libc_lock_* and __libc_lock_recursive macros with
6305         lowlevellock macros, not pthread mutexes.
6307         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
6308         of pthread_mutex_lock.
6309         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
6310         instead of pthread_mutex_unlock.
6312 2002-12-06  Roland McGrath  <roland@redhat.com>
6314         * allocatestack.c (__stack_user): Use uninitialized defn.
6315         * init.c (__pthread_initialize_minimal): Initialize it here.
6317 2002-12-05  Roland McGrath  <roland@redhat.com>
6319         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
6320         string.
6321         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
6323         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
6324         missing & here too.
6326 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
6328         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6329         lowlevellock.
6330         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
6331         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
6332         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
6333         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
6334         for __libc_lock_* macros.
6335         * Makefile (routines): Add libc-lowlevellock.
6337 2002-10-09  Roland McGrath  <roland@redhat.com>
6339         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
6340         Under [__PIC__], call the function via the pointer fetched for
6341         comparison rather than a call by name that uses the PLT.
6342         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
6343         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
6344         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
6345         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
6346         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
6348 2002-12-04  Roland McGrath  <roland@redhat.com>
6350         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
6352         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
6353         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
6355         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
6357 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6359         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
6360         a completely opaque, non-integer type.
6361         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6363 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
6365         * sysdeps/i386/tls.h: Include stdlib.h.
6366         * sysdeps/x86_64/tls.h: Likewise.
6368 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6370         * Makefile (tests): Add tst-locale2.
6371         (tests-static): Likewise.
6372         * tst-locale2.c: New file.
6374         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
6375         volatile and add memory clobbers to lock operations.
6377 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
6379         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
6380         * sysdeps/i386/i486/bits/atomic.h: New file.
6381         * sysdeps/i386/i586/bits/atomic.h: New file.
6382         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
6383         include i486 version.
6384         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
6385         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
6386         Patch by Marijn Ros <marijn@mad.scientist.com>.
6388         * allocatestack.c (get_cached_stack): Don't crash if we first
6389         found a stack with a larger size then needed.
6390         Reported by Hui Huang <hui.huang@sun.com>.
6392         * Makefile (tests): Add tst-sysconf.
6393         * tst-sysconf.c: New file.
6395         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
6396         PTHREAD_THREADS_MAX.
6398 2002-12-02  Roland McGrath  <roland@redhat.com>
6400         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
6401         Declare using hidden_proto instead of attribute_hidden, so there are
6402         non-.hidden static symbols for gdb to find.
6403         (__pthread_keys): Likewise.
6404         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
6405         * allocatestack.c (__stack_user): Likewise.
6406         * pthread_create.c (__pthread_keys): Likewise.
6407         (__nptl_threads_events, __nptl_last_event): Make these static instead
6408         of hidden.
6409         * pthread_key_create.c (__pthread_pthread_keys_max,
6410         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
6412 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
6414         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
6415         statically.
6416         * tst-locale1.c: New file.
6418         * pthread_cond_timedwait.c: Include <stdlib.h>.
6420         * Makefile (tests): Add tst-fork2 and tst-fork3.
6421         * tst-fork2.c: New file.
6422         * tst-fork3.c: New file.
6424 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
6426         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
6428         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
6429         require it to 200112L.
6431         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
6432         instruction only if HAVE_CMOV is defined.
6433         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
6435         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
6437         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
6439         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
6441         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
6443 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
6445         * sysdeps/x86_64/bits/atomic.h: New file.
6447         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
6448         16-bit operations.
6450         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
6451         possible since gettid cannot fail.
6453         * sysdeps/x86_64/pthreaddef.h: New file.
6455         * sysdeps/i386/pthreaddef.h (gettid): Removed.
6457         * sysdeps/x86_64/pthread_spin_init.c: New file.
6458         * sysdeps/x86_64/pthread_spin_lock.c: New file.
6459         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
6460         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
6462         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
6463         Add missing lock prefix.  Minute optimization.
6465         * tst-spin2.c (main): Also check successful trylock call.
6467         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
6468         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
6470         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
6471         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
6473         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
6474         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
6475         value in case of an error.  Add support for INTERNAL_SYSCALL.
6477         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
6478         value in case of an error.
6480         * sysdeps/x86_64/tls.h: New file.
6482 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6484         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
6485         takes the array member name and the index as parameters.
6486         (THREAD_SETMEM_NC): Likewise.
6487         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
6488         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
6489         interfaces.
6491         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
6492         to decide which code to use.
6493         (THREAD_SETMEM_NC): Likewise.
6495         * allocatestack.c (queue_stack): Don't remove stack from list here.
6496         Do it in the caller.  Correct condition to prematurely terminate
6497         loop to free stacks.
6498         (__deallocate_stack): Remove stack from list here.
6500 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6502         * Makefile (tests): Add tst-stack1.
6503         * tst-stack1.c: New file.
6505         * allocatestack.c (allocate_stack): Initialize the TCB on a user
6506         provided stack.
6508         * pthread_attr_getstack.c: Return bottom of the thread area.
6510 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
6512         * Makefile (libpthread-routines): Add pt-allocrtsig and
6513         pthread_kill_other_threads.
6514         * pt-allocrtsig.c: New file.
6515         * pthread_kill_other_threads.c: New file.
6516         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
6517         all three functions.
6518         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6519         allocrtsig.
6520         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
6521         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
6522         and __libc_allocate_rtsig_private.
6523         * Versions (libpthread): Export pthread_kill_other_threads_np,
6524         __libc_current_sigrtmin, and __libc_current_sigrtmax.
6526 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
6528         * allocatestack.c (allocate_stack): stackaddr in attribute points to
6529         the end of the stack.  Adjust computations.
6530         When mprotect call fails dequeue stack and free it.
6531         * pthread_attr_setstack.c: Store top of the stack in stackaddr
6532         attribute.
6533         * pthread_getattr_np.c: Likewise.
6535         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
6536         surprises.
6538 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
6540         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
6541         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
6543 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
6545         * pthread_getspecific.c: Optimize access to first 2nd-level array.
6546         * pthread_setspecific.c: Likewise.
6548 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
6550         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
6551         definitions.  Get them from the official place.
6552         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
6554         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
6555         Use new CLONE_ flags in clone() calls.
6557         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
6558         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
6560         * Versions: Add pthread_* functions for libc.
6561         * forward.c: New file.
6563         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
6564         errno-loc.
6565         * herrno.c: New file.
6566         * res.c: New file.
6568         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
6569         sem_trywait, and sem_timedwait.  Add herrno and res.
6570         * sem_init.c: Don't initialize lock and waiters members.
6571         * sem_open.c: Likewise.
6572         * sem_post.c: Removed.
6573         * sem_wait.c: Removed.
6574         * sem_trywait.c: Removed.
6575         * sem_timedwait.c: Removed.
6576         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
6577         Includes full implementations of sem_post, sem_wait, sem_trywait,
6578         and sem_timedwait.
6579         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
6580         for new implementation.
6581         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
6582         and waiters fields.
6584         * tst-sem3.c: Improve error message.
6585         * tst-signal3.c: Likewise.
6587         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
6588         to tell the kernel about the termination futex and to initialize tid
6589         member.  Don't initialize main_thread.
6590         * descr.h (struct pthread): Remove main_thread member.
6591         * cancelllation.c (__do_cancel): Remove code handling main thread.
6592         The main thread is not special anymore.
6594         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
6595         size of the stacks to stack_cache_actsize.
6597         * pt-readv.c: Add missing "defined".
6598         * pt-sigwait.c: Likewise.
6599         * pt-writev.c: Likewise.
6601 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
6603         * Versions: Export __connect from libpthread.
6604         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6606         * Makefile (libpthread-routines): Add pt-raise.
6607         * sysdeps/unix/sysv/linux/raise.c: New file.
6608         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
6609         * sysdeps/generic/pt-raise.c: New file.
6611         * pthread_cond_init.c: Initialize all data elements of the condvar
6612         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
6614         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
6615         * pthread_create.c: Likewise.
6617         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
6618         * tst-key1.c: New file.
6619         * tst-key2.c: New file.
6620         * tst-key3.c: New file.
6622         * Versions: Export pthread_detach for version GLIBC_2.0.
6623         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
6625 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
6627         * pthread_key_create.c: Terminate search after an unused key was found.
6628         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6630         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
6631         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6633 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
6635         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
6636         dynamic lookup for errno in PIC.
6638         * allocatestack.c (get_cached_stack): Rearrange code slightly to
6639         release the stack lock as soon as possible.
6640         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
6641         the static TLS block.
6642         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
6644         * cancellation.c: Renamed from cancelation.c.
6645         * Makefile: Adjust accordingly.
6646         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
6647         * cleanup_defer.c: Use CANCELLATION_P.
6648         * pthread_testcancel.c: Likewise.
6649         * descr.h: Fix spelling in comments.
6650         * init.c: Likewise.
6651         * pthread_getattr_np.c: Likewise.
6652         * pthread_getschedparam.c: Likewise.
6653         * pthread_setschedparam.c: Likewise.
6654         * Versions: Likewise.
6656         * pt-pselect.c: New file.
6657         * Makefile (libpthread-routines): Add pt-pselect.
6658         * Versions: Add pselect.
6660         * tst-cancel4.c: New file.
6661         * Makefile (tests): Add tst-cancel4.
6663 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
6665         * pthread_mutex_lock.c: Always record lock ownership.
6666         * pthread_mutex_timedlock.c: Likewise.
6667         * pthread_mutex_trylock.c: Likewise.
6669         * pt-readv.c: New file.
6670         * pt-writev.c: New file.
6671         * pt-creat.c: New file.
6672         * pt-msgrcv.c: New file.
6673         * pt-msgsnd.c: New file.
6674         * pt-poll.c: New file.
6675         * pt-select.c: New file.
6676         * pt-sigpause.c: New file.
6677         * pt-sigsuspend.c: New file.
6678         * pt-sigwait.c: New file.
6679         * pt-sigwaitinfo.c: New file.
6680         * pt-waitid.c: New file.
6681         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
6682         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
6683         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
6684         * Versions: Add all the new functions.
6686         * tst-exit1.c: New file.
6687         * Makefile (tests): Add tst-exit1.
6689         * sem_timedwait.c: Minor optimization for more optimal fastpath.
6691 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
6693         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
6695         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
6696         call.  pthread_join is an official cancellation point.
6697         * pthread_timedjoin.c: Likewise.
6699         * pthread_cond_wait.c: Revert order in which internal lock are dropped
6700         and the condvar's mutex are retrieved.
6701         * pthread_cond_timedwait.c: Likewise.
6702         Reported by dice@saros.East.Sun.COM.
6704 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
6706         * pthreadP.h: Cut out all type definitions and move them...
6707         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
6708         * pthreadP.h: Include <internaltypes.h>.
6710         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
6711         performance tweaks.
6713         * sem_trywait.c: Shuffle #includes around to get right order.
6714         * sem_timedwait.c: Likewise.
6715         * sem_post.c: Likewise.
6716         * sem_wait.c: Likewise.
6718         * nptl 0.3 released.
6720         * Makefile (tests): Add tst-signal3.
6721         * tst-signal3.c: New file.
6723 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
6725         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
6726         the asms modify the sem object.
6727         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
6729         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
6730         the actual members.
6731         * pthreadP.h (struct sem): New type.  Actual semaphore type.
6732         * semaphoreP.h: Include pthreadP.h.
6733         * sem_getvalue.c: Adjust to sem_t change.
6734         * sem_init.c: Likewise.
6735         * sem_open.c: Likewise.
6736         * sem_post.c: Likewise.
6737         * sem_timedwait.c: Likewise.
6738         * sem_trywait.c: Likewise.
6739         * sem_wait.c: Likewise.
6741 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
6743         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
6744         * tst-basic2.c: New file.
6745         * tst-exec1.c: New file.
6746         * tst-exec2.c: New file.
6747         * tst-exec3.c: New file.
6749         * tst-fork1.c: Remove extra */.
6751         * nptl 0.2 released.  The API for IA-32 is complete.