Update.
[glibc.git] / nptl / ChangeLog
blob68e643f282396f8a429bab944f0e40885b2f2a3e
1 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
4         of pthread-functions.h and pthreaddef.h.
5         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
7         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
8         Change __data.__nwaiters from int to unsigned int.
10         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
11         sysconf (_SC_THREAD_CPUTIME) returns negative value.
13         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
14         before return type.
16         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
17         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
19 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
21         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
22         test fails, remove message queue.
23         (tf_msgsnd): Likewise.
25 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
27         * tst-clock1.c: Change #ifdef to #if defined.
28         * tst-clock2.c: Likewise.
29         * tst-cond11.c: Likewise.
31 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
33         * sysdeps/pthread/timer_create.c (timer_create): Use
34         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
35         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
36         THREAD_CPUTIME.
38 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
40         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
41         _POSIX_THREAD_CPUTIME): Define to 0.
43 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
45         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
46         and _POSIX_THREAD_CPUTIME to zero.
47         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
48         * tst-barrier2.c: Fix testing for POSIX feature.
49         * tst-clock1.c: Likewise.
50         * tst-clock2.c: Likewise.
51         * tst-cond11.c: Likewise.
52         * tst-cond4.c: Likewise.
53         * tst-cond6.c: Likewise.
54         * tst-flock2.c: Likewise.
55         * tst-mutex4.c: Likewise.
56         * tst-mutex9.c: Likewise.
57         * tst-rwlock12.c: Likewise.
58         * tst-rwlock4.c: Likewise.
59         * tst-signal1.c: Likewise.
60         * tst-spin2.c: Likewise.
61         * sysdeps/pthread/posix-timer.h: Likewise.
62         * sysdeps/pthread/timer_create.c: Likewise.
63         * sysdeps/pthread/timer_routines.c: Likewise.
65 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
67         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
68         (__lll_mutex_timedlock_wait): Address futex correctly.
70         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
71         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
72         make sure 2 is stored in the futex and we looked at the old value.
73         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
74         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
75         which might very well made the code not working at all before.
76         [BZ #417]
78 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
80         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
81         allow SIGSETXID to be sent.
82         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
83         for SIGSETXID to be defined.
84         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
85         SIGSETXID cannot be blocked.
87         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
88         Add __extension__ to long long types.
89         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
90         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
91         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
92         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
93         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
94         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
95         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
97 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
99         * descr.h (struct pthread): Add stopped_start field.
100         * sysdeps/pthread/createthread.c (create_thread): Set
101         start_stopped flag in descriptor for new thread appropriately.
102         * pthread_create.c (start_thread): Only take lock to be stopped on
103         startup if stopped_start flag says so.
105 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
107         * pthread_create.c (__pthread_create_2_1): Remember whether thread
108         is created detached and if yes, do not try to free the stack in case
109         the thread creation failed.
110         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
111         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
112         case there has been no error.  [BZ #405]
114         * pthread_create.c (start_thread): Don't wait for scheduler data
115         etc to be set at the beginning of the function.  The cancellation
116         infrastructure must have been set up.  And enable async
117         cancellation before potentially going to sleep.  [BZ #401]
119 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
121         * Versions: Remove exports for pthread_set*id_np functions.
122         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
123         for now.
124         * Makefile: Don't build pthread_set*id code for now.
126 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
128         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
129         internal use.
130         * allocatestack.c (__nptl_setxid): New function.
131         * descr.h (struct xid_command): Define type.
132         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
133         (sighandler_setxid): New function.
134         (__pthread_initialize_minimal): Register sighandler_setxid for
135         SIGCANCEL.
136         * pt-allocrtsig.c: Update comment.
137         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
138         Declare __nptl_setxid.
139         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
140         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
141         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
142         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
143         and pthread_setresuid_np.
144         * pthread_setgid_np.c: New file.
145         * pthread_setuid_np.c: New file.
146         * pthread_setegid_np.c: New file.
147         * pthread_seteuid_np.c: New file.
148         * pthread_setregid_np.c: New file.
149         * pthread_setreuid_np.c: New file.
150         * pthread_setresgid_np.c: New file.
151         * pthread_setresuid_np.c: New file.
152         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
153         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
154         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
155         and pthread_setresuid_np.
156         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
157         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
158         pthread_setregid, and pthread_setresgid.
160 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
162         * allocatestack.c (allocate_stack): Return EAGAIN instead of
163         ENOMEM when out of memory.
165 2004-09-10  Roland McGrath  <roland@redhat.com>
167         [BZ #379]
168         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
169         code, since we don't try to use the broken CLONE_STOPPED any more.
170         * pthread_create.c (start_thread): Likewise.
172 2004-09-15  Richard Henderson  <rth@redhat.com>
174         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
176 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
178         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
179         (__libc_unwind_longjmp): Delete macro and declare as function.
180         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
181         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
182         nptl directory.
183         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
184         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
185         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
187 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
189         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
190         for __USE_XOPEN2K.
191         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
192         types also for __USE_XOPEN2K.
193         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
194         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
195         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
196         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
197         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
198         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
199         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
200         [BZ #320]
202 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
204         * sysdeps/pthread/pthread.h
205         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
206         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
207         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
208         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
209         [BZ #375]
211 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
213         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
214         PSEUDO to be used with . prefix.
216         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
217         Use atomic_increment instead of atomic_exchange_and_add.
218         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
219         Likewise.
220         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
221         Likewise.
222         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
223         Likewise.
225         * allocatestack.c (allocate_stack): Use atomic_increment_val
226         instead of atomic_exchange_and_add.
227         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
228         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
229         Likewise.
230         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
231         Likewise.
233         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
234         the initialization function might throw.
236 2005-09-05  Richard Henderson  <rth@redhat.com>
238         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
239         Move definition inside libpthread, libc, librt check.  Provide
240         definition for rtld.
242 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
244         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
245         * sysdeps/i386/jmpbuf-unwind.h: Likewise
246         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
247         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
248         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
249         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
250         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
251         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
252         * unwind.c: Use it.
254         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
255         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
256         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
257         Likewise.
258         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
259         Decrement __nwaiters.  If pthread_cond_destroy has been called and
260         this is the last waiter, signal pthread_cond_destroy caller and
261         avoid using the pthread_cond_t structure after unlock.
262         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
263         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
264         Read clock type from the least significant bits of __nwaiters instead
265         of __clock.
266         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
267         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
269 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
271         [BZ #342]
272         * Makefile (tests): Add tst-cond20 and tst-cond21.
273         * tst-cond20.c: New test.
274         * tst-cond21.c: New test.
275         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
276         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
277         it unsigned int.
278         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
279         Likewise.
280         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
281         (pthread_cond_t): Likewise.
282         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
283         Likewise.
284         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
285         Likewise.
286         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
287         Likewise.
288         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
289         (cond_nwaiters): New.
290         (clock_bits): New.
291         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
292         if there are waiters not signalled yet.
293         Wait until all already signalled waiters wake up.
294         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
295         __nwaiters.  If pthread_cond_destroy has been called and this is the
296         last waiter, signal pthread_cond_destroy caller and avoid using
297         the pthread_cond_t structure after unlock.
298         (__pthread_cond_wait): Increment __nwaiters in the beginning,
299         decrement it when leaving.  If pthread_cond_destroy has been called
300         and this is the last waiter, signal pthread_cond_destroy caller.
301         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
302         Likewise.  Read clock type from the least significant bits of
303         __nwaiters instead of __clock.
304         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
305         whether clock ID can be encoded in COND_CLOCK_BITS bits.
306         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
307         clock type just from the last COND_CLOCK_BITS bits of value.
308         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
309         instead of __clock, just from second bit of condattr's value.
311 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
313         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
314         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
315         != 64.
316         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
318 2004-08-15  Roland McGrath  <roland@frob.com>
320         * pthread_atfork.c: Update copyright terms including special exception
321         for these trivial files, which are statically linked into executables
322         that use dynamic linking for the significant library code.
324 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
326         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
327         pthread_rwlock_rdlock.
328         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
329         Decrease __nr_readers_queued after reacquiring lock.
330         * sysdeps/pthread/pthread_rwlock_timedrdlock
331         (pthread_rwlock_timedrdlock): Likewise.
332         Reported by Bob Cook <bobcook47@hotmail.com>.
334 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
336         * tst-rwlock14.c (tf): Read main thread handle from *ARG
337         before pthread_barrier_wait.
339 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
341         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
342         Remove unnecessary exception handling data.
344 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
346         [BZ #284]
347         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
348         instead of clockid_t.
350 2004-07-21  Roland McGrath  <roland@redhat.com>
352         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
354 2004-07-19  Roland McGrath  <roland@redhat.com>
356         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
358 2004-07-02  Roland McGrath  <roland@redhat.com>
360         * configure: Don't exit.
362 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
364         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
365         (__pthread_cond_timedwait): Check for invalid nanosecond in
366         timeout value.
368 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
370         * Makefile: Add rules to build and run tst-fini1.
371         * tst-fini1.c: New file.
372         * tst-fini1mod.c: New file.
374 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
376         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
377         if no cancellation support is needed.
378         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
379         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
380         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
381         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
382         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
383         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
384         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
385         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
386         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
388         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
389         only if not already defined.
391 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
393         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
394         constraint "m" instead of "0" for futex.
396         * shlib-versions: Add powerpc64-.*-linux.*.
398 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
400         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
401         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
402         for valid tv_nsec.
403         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
404         1 billion and 64-bit tv_nsec which is valid when truncated to 32
405         bits.
407 2004-06-29  Roland McGrath  <roland@redhat.com>
409         * Banner: NPTL no longer has its own version number.
410         * Makefile (nptl-version): Variable removed.
411         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
412         using $(version), the glibc version number.
414 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
416         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
417         Fix branch offset for a PLT entry.
418         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
419         Likewise.
420         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
421         Likewise.
422         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
423         Likewise.
424         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
425         Likewise.
427 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
429         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
430         unconditionally.
432 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
434         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
435         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
436         instead of tv_sec.
437         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
438         (pthread_rwlock_timedrdlock): Likewise.
440 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
442         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
443         Set __r7 to val, not mutex.
445 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
447         * Makefile: Add rules to build tst-rwlock14.
448         * tst-rwlock14.c: New file.
450 2004-06-24  Boris Hu  <boris.hu@intel.com>
452         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
453         check.
454         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
456 2004-06-19  Andreas Jaeger  <aj@suse.de>
458         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
459         assembler in last patch.
461 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
463         * sysdeps/pthread/pthread_cond_timedwait.c
464         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
465         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
466         (__pthread_cond_timedwait): Check for invalid nanosecond in
467         timeout value.
468         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
469         * tst-cond19.c: New file.
470         * Makefile: Add rules to build and run tst-cond19.
472 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
474         * tst-context1.c (GUARD_PATTERN): Defined.
475         (tst_context_t): Define struct containing ucontext_t & guard words.
476         (ctx): Declare as an array of tst_context_t.
477         (fct): Verify uc_link & guard words are still valid.
478         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
480 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
482         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
483         Add __data.__futex field, reshuffle __data.__clock.
484         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
485         (__pthread_cond_signal): Increment __futex at the same time as
486         __wakeup_seq or __total_seq.  Pass address of __futex instead of
487         address of low 32-bits of __wakeup_seq to futex syscall.
488         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
489         (__pthread_cond_wait): Likewise.  Pass __futex value from before
490         releasing internal lock to FUTEX_WAIT.
491         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
492         (__pthread_cond_timedwait): Likewise.
493         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
494         (FUTEX_CMP_REQUEUE): Define.
495         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
496         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
497         Pass __futex value from before the unlock and __futex address instead
498         of address of low 32-bits of __wakeup_seq to futex syscall.
499         Fallback to FUTEX_WAKE all on any errors.
501 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
503         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
504         comment typo.
505         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
506         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
507         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
508         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
509         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
511 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
513         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
514         Add memory clobber to inline assembly.
515         (__lll_mutex_trylock): Likewise.
516         (__lll_mutex_cond_trylock): Likewise.
518 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
520         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
521         Pass val argument as 6th system call argument in %r7.
523 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
525         * Makefile (tests): Add tst-cond16.
526         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
527         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
528         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
529         Add __data.__futex field, reshuffle __data.__clock.
530         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
531         (__pthread_cond_signal): Increment __futex at the same time as
532         __wakeup_seq or __total_seq.  Pass address of __futex instead of
533         address of low 32-bits of __wakeup_seq to futex syscall.
534         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
535         (__pthread_cond_wait): Likewise.  Pass __futex value from before
536         releasing internal lock to FUTEX_WAIT.
537         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
538         (__pthread_cond_timedwait): Likewise.
539         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
540         (FUTEX_CMP_REQUEUE): Define.
541         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
542         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
543         Pass __futex value from before the unlock and __futex address instead
544         of address of low 32-bits of __wakeup_seq to futex syscall.
545         Fallback to FUTEX_WAKE all on any errors.
546         * sysdeps/unix/sysv/linux/alpha/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/alpha/bits/pthreadtypes.h (pthread_cond_t):
551         Add __data.__futex field, reshuffle __data.__clock.
552         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
553         Define.
554         (lll_futex_requeue): Add val argument, return 1 unconditionally
555         for the time being.
556         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
557         Add __data.__futex field, reshuffle __data.__clock.
558         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
559         Define.
560         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
561         internally.  Return non-zero if error, zero if success.
562         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
563         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
564         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
565         Define.
566         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
567         internally.  Return non-zero if error, zero if success.
568         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
569         Add __data.__futex field, reshuffle __data.__clock.
570         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
571         Define.
572         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
573         internally.  Return non-zero if error, zero if success.
574         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
575         Add __data.__futex field, reshuffle __data.__clock.
576         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
577         Add __data.__futex field, reshuffle __data.__clock.
578         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
579         Increment __futex at the same time as __wakeup_seq or __total_seq.
580         Pass address of __futex instead of address of low 32-bits of
581         __wakeup_seq to futex syscall.
582         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
583         Pass __futex value from before releasing internal lock
584         to FUTEX_WAIT.
585         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
586         Likewise.  Avoid unnecessary shadowing of variables.
587         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
588         Set __futex to 2 * __total_seq.  Pass __futex value from before the
589         unlock and __futex address instead of address of low 32-bits of
590         __wakeup_seq to futex_requeue macro, adjust for new return value
591         meaning.
592         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
593         (__pthread_cond_signal): Increment __futex at the same time as
594         __wakeup_seq or __total_seq.  Pass address of __futex instead of
595         address of low 32-bits of __wakeup_seq to futex syscall.
596         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
597         (__pthread_cond_wait): Likewise.  Pass __futex value from before
598         releasing internal lock to FUTEX_WAIT.
599         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
600         (__pthread_cond_timedwait): Likewise.
601         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
602         (FUTEX_CMP_REQUEUE): Define.
603         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
604         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
605         Pass __futex value from before the unlock and __futex address instead
606         of address of low 32-bits of __wakeup_seq to futex syscall.
607         Fallback to FUTEX_WAKE all on any errors.
609 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
611         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
612         Add nop to align the end of critical section.
613         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
615 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
617         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
618         Add __broadcast_seq field.
619         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
620         all waiters as woken with woken_seq and bump broadcast counter.
621         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
622         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
623         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
624         Comment typo fixes.  Avoid returning -ETIMEDOUT.
626 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
628         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
629         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
630         Reported by Kaz Kojima.
632 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
634         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
636 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
638         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
639         __broadcast_seq with bc_seq after acquiring internal lock instead of
640         before it.
642 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
644         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
645         compilation.
646         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
647         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
648         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
649         (pthread_cond_t): Add __data.__broadcast_seq field.
650         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
651         (FRAME_SIZE): Define.
652         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
653         Comment typo fixes.
654         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
655         Define.
656         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
657         typo fixes.
658         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
659         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
660         fixes.
662 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
664         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
665         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
666         Add __broadcast_seq field.
667         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
668         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
669         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
670         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
671         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
672         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
673         all waiters as woken with woken_seq and bump broadcast counter.
674         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
675         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
676         __broadcast_seq field.
677         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
678         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
679         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
680         * pthread_cond_init.c: Initialize __broadcast_seq field.
681         * Makefile (tests): Add tst-cond17 and tst-cond18.
682         Add .NOTPARALLEL goal.
683         * tst-cond16.c: New file.  From Jakub.
684         * tst-cond17.c: New file.  From Jakub.
685         * tst-cond18.c: New file.  From Jakub.
687 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
689         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
690         unwind info.
692         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
693         Parametrize frame size.  Correct some unwind info.
694         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
696 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
698         * tst-stack3.c: Note testing functionality beyond POSIX.
700 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
702         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
703         Change conditional from ifdef to if.
705 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
707         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
708         SYSDEP_CANCEL_ERROR): Define.
709         (PSEUDO): Use it.
711 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
713         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
715 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
717         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
719 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
721         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
722         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
723         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
724         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
726 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
728         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
729         thread has all signals blocked.
731 2004-04-18  Andreas Jaeger  <aj@suse.de>
733         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
734         (SEM_VALUE_MAX): Add missing brace.
736 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
738         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
739         in rt subdir.
740         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
741         * sysdeps/pthread/tst-mqueue8x.c: New test.
742         * tst-cancel4.c: Update comment about message queues.
744         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
745         return it_value { 0, 0 }.
746         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
747         like SIGEV_SIGNAL.
748         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
749         assertion for SIGEV_NONE.
750         (thread_attr_compare): Compare all attributes, not just a partial
751         subset.
753 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
755         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
757 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
759         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
760         Just use a plain number.
761         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
762         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
763         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
764         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
765         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
766         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
767         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
769 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
771         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
772         frame info.
773         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
775 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
777         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
778         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
779         of calling sigwaitinfo.
781 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
783         * allocatestack.c (allocate_stack): Set reported_guardsize
784         unconditionally.
785         * pthread_getattr_np.c (pthread_getattr_np): Use
786         reported_guardsize instead of guardsize.
787         * descr.h (struct pthread): Add reported_guardsize field.
789 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
791         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
793 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
795         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
797 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
799         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
800         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
801         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
802         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
803         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
804         Define.
805         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
806         (_POSIX_MESSAGE_PASSING): Define.
807         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
808         (_POSIX_MESSAGE_PASSING): Define.
809         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
810         (_POSIX_MESSAGE_PASSING): Define.
812 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
814         * tst-context1.c (fct): Check whether correct stack is used.
816 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
818         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
819         matching constraints for asm mem parameters.
821         * tst-clock2.c (tf): Don't define unless needed.
823 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
825         * Makefile (link-libc-static): Use $(static-gnulib) instead of
826         $(gnulib).
828 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
830         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
831         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
832         * pthreadP.h: Declare __nptl_deallocate_tsd.
833         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
834         Adjust caller.
836         * Makefile (tests): Add tst-tsd5.
837         * tst-tsd5.c: New file.
839 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
841         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
842         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
843         is SHLIB_COMPAT check.
844         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
845         (__pthread_attr_getaffinity_old): Likewise.
846         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
847         (__pthread_getaffinity_old): Likewise.
848         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
849         (__pthread_setaffinity_old): Likewise.
851 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
853         * allocatestack.c (_make_stacks_executable): Call
854         _dl_make_stack_executable first.
856 2004-03-24  Roland McGrath  <roland@redhat.com>
858         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
859         constraint instead of "0".
861 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
863         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
864         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
866         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
867         code to avoid warning.
869 2004-03-24  Andreas Jaeger  <aj@suse.de>
871         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
872         (__pthread_attr_setaffinity_old): Remove const.
874 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
876         * sysdeps/unix/sysv/linux/smp.h: New file.
877         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
878         * init.c: Define __is_smp.
879         (__pthread_initialize_minimal_internal): Call is_smp_system to
880         initialize __is_smp.
881         * pthreadP.h: Declare __is_smp.
882         Define MAX_ADAPTIVE_COUNT is necessary.
883         * pthread_mutex_init.c: Add comment regarding __spins field.
884         * pthread_mutex_lock.c: Implement adaptive mutex type.
885         * pthread_mutex_timedlock.c: Likewise.
886         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
887         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
888         Add __spins field.
889         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
890         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
891         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
892         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
893         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
894         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
895         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
896         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
897         lll_mutex_cond_trylock.
898         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
899         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
900         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
901         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
902         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
903         Define BUSY_WAIT_NOP.
904         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
905         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
907         * tst-mutex5.c: Add support for testing adaptive mutexes.
908         * tst-mutex7.c: Likewise.
909         * tst-mutex5a.c: New file.
910         * tst-mutex7a.c: New file.
911         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
913         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
914         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
915         vgettimeofday call might destroy the content.
917         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
918         @pause in the loop.
920         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
921         No need to restrict type of ret.  Make it int.  Add comment.
923         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
924         Remove unnecessary setne instruction.
926 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
928         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
929         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
930         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
931         If realloc fails, break out of the loop.
933 2004-03-20  Andreas Jaeger  <aj@suse.de>
935         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
936         (__pthread_setaffinity_old): Fix interface.
937         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
938         (__pthread_getaffinity_old): Likewise.
940         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
941         (__pthread_setaffinity_new): Remove duplicate declaration.
943 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
945         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
946         the return value to a safe register.
947         (CDISABLE): Set the function argument correctly.
949 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
951         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
952         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
953         Rewrite so that only one locked memory operation per round is needed.
954         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
955         (pthread_barrier_wait): After wakeup, release lock only when the
956         last thread stopped using the barrier object.
957         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
958         (__pthread_cond_wait): Don't store mutex address if the current
959         value is ~0l.  Add correct cleanup support and unwind info.
960         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
961         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
962         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
963         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
964         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
965         Add correct cleanup support and unwind info.
966         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
967         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
968         information for syscall wrappers.
970 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
972         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
973         cpusetsize field, remove next.
974         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
975         parameter for size of the CPU set.
976         (pthread_setaffinity_np): Likewise.
977         (pthread_attr_getaffinity_np): Likewise.
978         (pthread_attr_setaffinity_np): Likewise.
979         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
980         interface change, keep compatibility code.
981         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
982         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
983         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
984         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
985         __pthread_getaffinity_np.
986         * Versions: Add version for changed interfaces.
987         * tst-attr3.c: Adjust test for interface change.
988         * pthread_getattr_np.c: Query the kernel about the affinity mask with
989         increasing buffer sizes.
990         * pthread_attr_destroy.c: Remove unused list handling.
991         * pthread_attr_init.c: Likewise.
993 2004-03-17  Roland McGrath  <roland@redhat.com>
995         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
996         first argument to clock_getres so we ever enable kernel timers.
998 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
1000         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
1002 2004-03-12  Richard Henderson  <rth@redhat.com>
1004         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
1005         oldvalue from CENABLE to CDISABLE.
1007 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
1009         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
1010         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1011         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1012         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1014 2004-03-11  Richard Henderson  <rth@redhat.com>
1016         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
1017         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
1018         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
1020 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1022         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
1023         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
1024         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
1026 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1028         * forward.c (__pthread_cond_broadcast_2_0,
1029         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
1030         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
1031         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
1033 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1035         * sysdeps/sh/tcb-offsets.sym: Add PID.
1036         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
1037         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
1039 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
1041         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
1042         include <sysdep-cancel.h>, vfork is no cancellation point.
1043         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
1044         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
1045         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
1047 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
1049         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
1050         libc_hidden_def.
1051         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
1052         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
1053         Likewise.
1054         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
1055         Likewise.
1056         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
1057         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
1058         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
1059         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
1060         of DO_CALL_VIA_BREAK.  Work around a gas problem.
1062         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
1063         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
1064         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
1065         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
1066         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
1067         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
1069         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
1070         a local register for saving old PID.  Negate PID in parent upon exit.
1072         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
1073         tcb-offsets.h.
1074         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1075         before syscall, set to the old value in the parent afterwards.
1076         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
1077         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
1078         tcb-offsets.h.
1079         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1080         before syscall, set to the old value in the parent afterwards.
1081         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
1082         * sysdeps/s390/tcb-offsets.sym: Add PID.
1084         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
1085         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
1086         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
1087         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
1088         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
1089         * sysdeps/sparc/tcb-offsets.sym: Add PID.
1091 2004-03-10  Andreas Schwab  <schwab@suse.de>
1093         * sysdeps/ia64/tcb-offsets.sym: Add PID.
1094         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
1095         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
1097 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
1099         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
1100         * tst-cancel21.c (do_one_test): Likewise.
1101         Reported by Gordon Jin <gordon.jin@intel.com>.
1103 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
1105         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
1106         if non-zero and set to INT_MIN if zero.
1107         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
1108         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
1109         (SAVE_PID, RESTORE_PID): Define.
1110         (__vfork): Use it.
1111         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
1112         Use relative path to avoid including NPTL i386/vfork.S.
1113         (SAVE_PID, RESTORE_PID): Define.
1114         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
1115         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
1116         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
1117         tst-vfork2x.
1118         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
1119         * tst-vfork1.c: New test.
1120         * tst-vfork2.c: New test.
1121         * tst-vfork1x.c: New test.
1122         * tst-vfork2x.c: New test.
1124 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
1126         * sysdeps/i386/tcb-offsets.sym: Add PID.
1127         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1128         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
1129         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
1131 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
1133         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
1135 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1137         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1138         _rtld_global_ro.
1140 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
1142         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1143         _rtld_global_ro.
1145         * tst-once4.c: Remove unnecessary macro definition.
1147         * tst-mutex7.c (do_test): Limit thread stack size.
1148         * tst-once2.c (do_test): Likewise.
1149         * tst-tls3.c (do_test): Likewise.
1150         * tst-tls1.c (do_test): Likewise.
1151         * tst-signal3.c (do_test): Likewise.
1152         * tst-kill6.c (do_test): Likewise.
1153         * tst-key4.c (do_test): Likewise.
1154         * tst-join4.c (do_test): Likewise.
1155         * tst-fork1.c (do_test): Likewise.
1156         * tst-context1.c (do_test): Likewise.
1157         * tst-cond2.c (do_test): Likewise.
1158         * tst-cond10.c (do_test): Likewise.
1159         * tst-clock2.c (do_test): Likewise.
1160         * tst-cancel10.c (do_test): Likewise.
1161         * tst-basic2.c (do_test): Likewise.
1162         * tst-barrier4.c (do_test): Likewise.
1164 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
1166         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
1168 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
1170         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1171         (__pthread_cond_timedwait): Optimize wakeup test.
1172         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1173         (__pthread_cond_wait): Likewise.
1174         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1175         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1176         Likewise.
1178 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
1180         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1181         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
1182         the atomic instruction needed.
1183         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1184         (__lll_mutex_lock_wait): Likewise.
1186 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
1188         * Makefile (tests): Add tst-cond14 and tst-cond15.
1189         * tst-cond14.c: New file.
1190         * tst-cond15.c: New file.
1192 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
1194         * sysdeps/pthread/createthread.c (create_thread): Remove use of
1195         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
1196         needs to be implemented differently to be useful.
1198 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
1200         * pthread_attr_setschedparam.c: Don't test priority against limits
1201         here.  Set ATTR_FLAG_SCHED_SET flag.
1202         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
1203         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
1204         from parent thread to child.  If attribute is used and scheduling
1205         parameters are not inherited, copy parameters from attribute or
1206         compute them.  Check priority value.
1207         * pthread_getschedparam.c: If the parameters aren't known yet get
1208         them from the kernel.
1209         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
1210         ATTR_FLAG_POLICY_SET flag for thread.
1211         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
1212         and ATTR_FLAG_POLICY_SET.
1214         * sysdeps/pthread/createthread.c: Use tgkill if possible.
1216         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
1217         fail if stack address hasn't been set.  Just return 0.
1219 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
1221         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
1222         libpthread for the files in this list.
1223         (CFLAGS-tst-unload): Removed.
1224         * tst-unload.c (do_test): Don't use complete path for
1225         LIBPHREAD_SO.
1227         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
1228         tst-_res1mod2.
1230 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
1232         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1233         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
1234         operation per round is needed.
1235         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1236         (__lll_mutex_lock_wait): Likewise.
1238 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
1240         * tst-cancel9.c (cleanup): Don't print to stderr.
1242 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1244         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
1246 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
1248         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1249         (__syscall_error_handler2): Call CDISABLE.
1250         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1251         (__syscall_error_handler2): Call CDISABLE.
1253         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1254         Release lock before the loop, don't reacquire it.
1256         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
1258 2004-02-19  Andreas Schwab  <schwab@suse.de>
1260         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1261         Fix last change.
1263 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
1265         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
1266         (pthread_barrier_wait): After wakeup, release lock only when the
1267         last thread stopped using the barrier object.
1268         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
1269         (pthread_barrier_wait): Likewise.
1270         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1271         Likewise.
1272         * Makefile (tests): Add tst-barrier4.
1273         * tst-barrier4.c: New file.
1275         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1276         (__pthread_cond_timedwait): Perform timeout test while holding
1277         internal lock to prevent wakeup race.
1278         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1279         * sysdeps/pthread/pthread_cond_timedwait.c
1280         (__pthread_cond_timedwait): Likewise.
1281         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1282         (__pthread_cond_timedwait): Likewise.
1284 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
1286         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
1287         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
1288         * Makefile (tests): Add tst-rwlock13.
1289         * tst-rwlock13.c: New test.
1291 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
1293         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1294         (__condvar_tw_cleanup): Little optimization.
1295         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1297 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
1299         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
1300         libpthread as "lib" parameter to SHLIB_COMPAT.
1301         (__novmx_siglongjmp): Fix typo in function name.
1302         (__novmx_longjmp): Fix typo in function name.
1304 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1306         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
1307         __builtin_expect.
1309         * sysdeps/generic/pt-longjmp.c: Moved to...
1310         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
1312 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
1314         * Makefile (libpthread-routines): Add pt-cleanup.
1315         * pt-longjmp.c: Removed.
1316         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
1317         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
1318         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
1319         Version longjmp, siglongjmp for GLIBC_2.3.4.
1320         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
1322 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1324         * sysdeps/pthread/pthread_cond_timedwait.c
1325         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
1326         Reuse code.  Add __builtin_expects.
1328         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1329         (__pthread_cond_timedwait): Get internal lock in case timeout has
1330         passed before the futex syscall.
1331         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1333 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
1335         * allocatestack.c: Pretty printing.
1337         * sysdeps/pthread/createthread.c (create_thread): Don't add
1338         CLONE_DETACHED bit if it is not necessary.
1340 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
1342         * pthread_getattr_np.c: Include ldsodefs.h.
1344 2004-01-16  Richard Henderson  <rth@redhat.com>
1346         * allocatestack.c: Don't declare __libc_stack_end.
1347         * init.c (__pthread_initialize_minimal_internal): Likewise.
1348         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
1350 2004-01-15  Richard Henderson  <rth@redhat.com>
1352         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
1353         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
1354         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
1355         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
1356         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
1357         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
1358         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
1359         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
1361 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
1363         * init.c (pthread_functions): Make array const.
1365 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
1367         * allocatestack.c (__make_stacks_executable): Change interface.
1368         Check parameters.  Pass parameter on to libc counterpart.
1369         * pthreadP.h: Change declaration.
1371 2004-01-13  Richard Henderson  <rth@redhat.com>
1373         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
1374         prototype form.
1375         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
1376         Likewise.
1378         * sysdeps/alpha/Makefile: New file.
1379         * sysdeps/alpha/tcb-offsets.sym: New file.
1380         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1381         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
1383         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
1384         on powerpc version.
1386 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
1388         * Makefile (tests): Add tst-backtrace1.
1389         * tst-backtrace1.c: New test.
1391 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
1393         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
1394         register as second parameter to the REGISTER macro.
1395         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
1396         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
1397         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
1398         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
1399         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
1400         of thread register as second parameter to REGISTER macro in 64 case.
1402 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
1404         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
1405         (CFLAGS-getpid.o): Defined.
1406         (CFLAGS-getpid.os): Defined.
1408 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
1410         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
1411         returned for main thread does not overlap with any other VMA.
1412         Patch by Jakub Jelinek.
1414 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
1416         * tst-raise1.c: Include stdio.h.
1418 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
1420         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
1421         setting with __ASSUME_TGKILL || defined __NR_tgkill.
1422         If pid is 0, set it to selftid.
1423         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
1424         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
1425         != 0, return self->tid without doing a syscall.
1426         * descr.h (struct pthread): Move pid field after tid.
1428         * Makefile (tests): Add tst-raise1.
1429         * tst-raise1.c: New file.
1431 2003-12-23  Roland McGrath  <roland@redhat.com>
1433         * tst-oddstacklimit.c: New file.
1434         * Makefile (tests): Add it.
1435         (tst-oddstacklimit-ENV): New variable.
1437         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
1438         value up to page size for __default_stacksize.
1440 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
1442         * Makefile (tests): Add tst-eintr5.
1443         * tst-eintr5.c: New file.
1445         * eintr.c (eintr_source): Prevent sending signal to self.
1447         * tst-eintr2.c (tf1): Improve error message.
1449 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
1451         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
1452         * sysdeps/unix/sysv/linux/getpid.c: New file.
1453         * pthread_cancel.c: Add comment explaining use of PID field.
1454         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1455         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
1456         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
1457         temporarily to signal the field must not be relied on and updated
1458         by getpid().
1459         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
1460         temporarily negative.
1461         * sysdeps/unix/sysv/linux/raise.c: Likewise.
1463 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
1465         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
1466         (eintr_source): If ARG != NULL, use pthread_kill.
1467         * tst-eintr1.c: Adjust for this change.
1468         * tst-eintr2.c: Likewise.
1469         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
1470         * tst-eintr3.c: New file.
1471         * tst-eintr4.c: New file.
1473 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
1475         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
1476         if CANCELSTATE_BITMASK is set.
1477         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
1478         Likewise.
1480         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
1481         (tests-reverse): Add tst-cancel23.
1482         * tst-cancel22.c: New test.
1483         * tst-cancel23.c: New test.
1485 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
1487         * tst-eintr1.c: Better error messages.
1489         * Makefile (tests): Add tst-eintr2.
1490         * tst-eintr2.c: New file.
1492 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
1494         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
1495         (CFLAGS-tst-cancelx21.c): Set.
1496         * tst-cancel21.c: New test.
1497         * tst-cancelx21.c: New test.
1499         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
1500         comparison operand.
1501         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
1502         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
1503         * pt-longjmp.c: Include jmpbuf-unwind.h.
1504         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
1505         _JMPBUF_UNWINDS.  Adjust compared pointers.
1506         * init.c (__pthread_initialize_minimal_internal): Initialize
1507         pd->stackblock_size.
1508         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
1509         * sysdeps/alpha/jmpbuf-unwind.h: New file.
1510         * sysdeps/i386/jmpbuf-unwind.h: New file.
1511         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
1512         * sysdeps/s390/jmpbuf-unwind.h: New file.
1513         * sysdeps/sh/jmpbuf-unwind.h: New file.
1514         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
1515         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
1516         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
1517         (_JMPBUF_CFA_UNWINDS): Remove.
1518         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
1520 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
1522         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
1523         (CFLAGS-tst-cancelx20.c): Set.
1524         * tst-cancel20.c: New test.
1525         * tst-cancelx20.c: New test.
1527 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
1529         * init.c (__pthread_initialize_minimal_internal): Don't treat
1530         architectures with separate register stack special here when
1531         computing default stack size.
1533 2003-12-17  Roland McGrath  <roland@redhat.com>
1535         * Makefile (tst-cancelx7-ARGS): New variable.
1536         Reportd by Greg Schafer <gschafer@zip.com.au>.
1538 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
1540         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
1541         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
1542         (tst-stack3-ENV): Set.
1543         ($(objpfx)tst-stack3-mem): New.
1544         * tst-stack3.c: New test.
1546 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
1548         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
1549         Add unwind directives.  Drop unused .regstk directive.
1550         (_fini_EPILOG_BEGINS): Add unwind directives.
1552 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
1554         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
1555         Assume parameter is a pointer.
1556         (lll_futex_wake): Likewise.
1557         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
1558         Likewise.
1559         (lll_futex_wake): Likewise.
1560         Reported by Boris Hu.
1561         * sysdeps/unix/sysv/linux/unregister-atfork.c
1562         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
1564         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
1566 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
1568         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
1569         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
1570         __rtld_lock_initialize for ld.so lock.
1571         Patch in part by Adam Li <adam.li@intel.com>.
1573 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
1575         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
1576         in $(gnulib).  Also, remove stale comment.
1578 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
1580         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
1581         advantage of new syscall stub and optimize accordingly.
1583         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
1584         from SYS_futex, to match expectations of
1585         sysdep.h:DO_INLINE_SYSCALL.
1586         (lll_futex_clobbers): Remove.
1587         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
1588         (lll_futex_wake): Likewise.
1589         (lll_futex_requeue): Likewise.
1590         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
1591         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
1592         Jelinek).
1593         (__lll_mutex_lock): Likewise.
1594         (__lll_mutex_cond_lock): Likewise.
1595         (__lll_mutex_timed_lock): Likewise.
1596         (__lll_mutex_unlock): Likewise.
1597         (__lll_mutex_unlock_force): Likewise.
1599         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
1600         comes before the include of <sysdep.h>.
1601         (THREAD_SELF_SYSINFO): New macro.
1602         (THREAD_SYSINFO): Likewise.
1603         (INIT_SYSINFO): New macro.
1604         (TLS_INIT_TP): Call INIT_SYSINFO.
1606         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
1608         * sysdeps/pthread/createthread.c (create_thread): Use
1609         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
1610         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
1611         THREAD_SELF_SYSINFO instead of open code.
1612         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
1613         (THREAD_SYSINFO): Likewise.
1615         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
1617         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
1619 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
1621         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
1622         instead of .init.  Patch by David Mosberger.
1624 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
1626         * sysdeps/pthread/configure.in: Remove broken declaration in C
1627         cleanup handling check.
1629 2003-11-30  Andreas Jaeger  <aj@suse.de>
1631         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
1632         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
1633         Likewise.
1635 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
1637         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
1638         * pthread_attr_destroy.c: Include shlib-compat.h.
1639         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
1640         is set in iattr->flags.
1641         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
1643 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
1645         * Makefile (distribute): Add tst-cleanup4aux.c.
1647         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
1648         include.
1650 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
1652         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
1653         pthread_cond_signal.
1655         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
1656         store mutex address if the current value is ~0l.
1657         * sysdeps/pthread/pthread_cond_timedwait.c
1658         (__pthread_cond_timedwait): Likewise.
1659         * sysdeps/pthread/pthread_cond_broadcast.c
1660         (__pthread_cond_broadcast): Don't use requeue for pshared
1661         condvars.
1663         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1664         (__pthread_cond_wait): Don't store mutex address if the current
1665         value is ~0l.
1666         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1667         (__pthread_cond_timedwait): Likewise.
1668         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1669         (__pthread_cond_broadcast): Don't use requeue for pshared
1670         condvars.
1672         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
1673         element with ~0l for pshared condvars, with NULL otherwise.
1675         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1676         (__pthread_cond_wait): Don't store mutex address if the current
1677         value is ~0l.
1678         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1679         (__pthread_cond_timedwait): Likewise.
1680         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1681         (__pthread_cond_broadcast): Don't use requeue for pshared
1682         condvars.
1684         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
1685         * tst-cond12.c: New file.
1686         * tst-cond13.c: New file.
1688 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
1690         * sysdeps/pthread/configure.in: Make missing forced unwind support
1691         fatal.
1693 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
1695         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
1697 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
1699         * Makefile: Add magic to clean up correctly.
1701 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
1703         * unwind.c (FRAME_LEFT): Define.
1704         (unwind_stop): Handle old style cleanups here.
1705         (__pthread_unwind): Handle old style cleanups only if
1706         !HAVE_FORCED_UNWIND.
1707         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
1708         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
1709         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
1710         ($(objpfx)tst-cleanupx4): Likewise.
1711         * tst-cleanup4.c: New test.
1712         * tst-cleanup4aux.c: New.
1713         * tst-cleanupx4.c: New test.
1715 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
1717         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
1718         lll_mutex_*lock macros to skip atomic operations on some archs.
1720 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
1722         * sysdeps/pthread/tst-timer.c (main): Initialize
1723         sigev2.sigev_value as well.
1725 2003-10-15  Roland McGrath  <roland@redhat.com>
1727         * sysdeps/pthread/configure.in: Barf if visibility attribute support
1728         is missing.
1729         * sysdeps/pthread/configure: Regenerated.
1731 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1733         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
1734         locking macros.  No distinction between normal and mutex locking
1735         anymore.
1736         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
1737         Merge bits from lowlevelmutex.S we still need.
1738         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
1739         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
1740         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
1741         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
1742         new mutex implementation.
1743         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
1744         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
1745         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1746         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1747         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1748         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1749         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1750         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1751         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1752         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
1753         symbol for entry point to avoid cancellation.
1755 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
1757         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
1758         changes.
1759         (SAVE_OLDTYPE_0): Fix a typo.
1761 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
1763         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
1764         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
1766 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1768         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
1769         correct offset.
1771 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
1773         * Makefile (tests): Add tst-cancel19.
1774         * tst-cancel19.c: New test.
1776 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1778         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
1779         restoring of the old cancellation type.
1781 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
1783         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
1785 2003-09-27  Wolfram Gloger  <wg@malloc.de>
1787         * sysdeps/pthread/malloc-machine.h: New file
1789 2003-09-24  Roland McGrath  <roland@redhat.com>
1791         * allocatestack.c (__make_stacks_executable): Don't ignore return
1792         value from _dl_make_stack_executable.
1794 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
1796         * allocatestack.c (__make_stacks_executable): Also change
1797         permission of the currently unused stacks.
1799         * allocatestack.c (change_stack_perm): Split out from
1800         __make_stacks_executable.
1801         (allocate_stack): If the required permission changed between the time
1802         we started preparing the stack and queueing it, change the permission.
1803         (__make_stacks_executable): Call change_stack_perm.
1805         * Makefile: Build tst-execstack-mod locally.
1806         * tst-execstack-mod.c: New file.
1808 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
1810         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
1812 2003-09-23  Roland McGrath  <roland@redhat.com>
1814         * tst-execstack.c: New file.
1815         * Makefile (tests): Add it.
1816         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
1817         (LDFLAGS-tst-execstack): New variable.
1819         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
1820         whether to use PROT_EXEC for stack mmap.
1821         (__make_stacks_executable): New function.
1822         * pthreadP.h: Declare it.
1823         * init.c (__pthread_initialize_minimal_internal): Set
1824         GL(dl_make_stack_executable_hook) to that.
1826 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1828         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
1829         recommendation from AMD re avoidance of lock prefix.
1831 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
1833         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
1834         lll_futex_timed_wait instead of lll_futex_wait.
1835         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
1836         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
1837         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
1838         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
1839         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
1840         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
1841         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
1842         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
1843         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
1844         Completely revamp the locking macros.  No distinction between
1845         normal and mutex locking anymore.
1846         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1847         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
1848         __lll_lock_timedwait): Fix prototypes.
1849         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
1850         __lll_lock_timedwait): Likewise.
1851         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
1852         macros, add __builtin_expect.
1853         (lll_mutex_timedlock): Likewise.  Fix return value.
1854         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
1855         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
1856         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
1857         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
1858         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
1859         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
1860         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
1861         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
1863 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1865         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1866         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
1867         operation if possible.
1869         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
1870         like jumping over the lock prefix.
1872 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
1874         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
1875         locking macros.  No distinction between normal and mutex locking
1876         anymore.
1877         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1878         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1879         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1880         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
1881         locking.  Merge bits from lowlevelmutex.S we still need.
1882         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1883         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1884         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
1885         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
1886         * Makefile (routines): Remove libc-lowlevelmutex.
1887         (libpthread-rountines): Remove lowlevelmutex.
1888         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
1889         for new mutex implementation.
1890         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1891         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1892         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1893         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1894         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1895         Likewise.
1896         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1897         Likewise.
1898         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1899         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1900         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
1901         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1902         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1903         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1904         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1905         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1906         Likewise.
1907         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1908         Likewise.
1909         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1910         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1911         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1912         Don't use requeue.
1913         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1914         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
1916 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
1918         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
1919         in parameters of asm with output parameters.
1921         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
1922         type of DECR parameter to int.
1923         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
1925 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
1927         * tst-attr3.c (tf, do_test): Print stack start/end/size and
1928         guardsize for each thread.
1930 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1932         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
1933         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1934         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
1936         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1937         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
1938         NULL.
1939         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
1940         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
1941         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1942         (pthread_getaffinity_np): Add hidden_def.
1944         * Makefile (tests): Add tst-attr3.
1945         * tst-attr3.c: New test.
1947         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
1949 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1951         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
1952         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
1954 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1956         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
1957         * tst-align.c: Include tst-stack-align.h.
1958         (tf, do_test): Use TEST_STACK_ALIGN macro.
1960 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
1962         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
1963         variable.
1965 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
1967         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
1968         stack-related values for the initial thread.
1970 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1972         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
1974 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
1976         * pthread_mutex_lock.c: Minor code rearrangements.
1978 2003-09-05  Roland McGrath  <roland@redhat.com>
1980         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
1981         Instead, include ../nptl_db/db_info.c to do its magic.
1982         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
1983         (__pthread_pthread_key_2ndlevel_size): Likewise.
1984         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
1985         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
1986         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
1987         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
1988         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
1989         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
1990         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
1991         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
1992         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
1993         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
1994         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
1995         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
1996         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
1997         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
1998         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
1999         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
2000         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
2002 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
2004         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
2005         of pthread_t to be compatible with LT.
2006         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2007         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2008         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2009         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2010         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
2011         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2012         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2014 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
2016         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
2018 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
2020         * unwind-forcedunwind.c: Move to...
2021         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
2022         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
2023         * sysdeps/pthread/jmpbuf-unwind.h: New file.
2024         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
2025         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
2026         * unwind.c: Include jmpbuf-unwind.h.
2027         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
2029 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
2031         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
2032         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
2033         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
2034         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
2035         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2036         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
2037         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
2038         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
2039         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
2040         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
2041         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
2042         function.
2043         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
2044         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
2045         * Makefile (tests): Add tst-stack2.
2046         * tst-stack2.c: New test.
2047         * tst-stack1.c: Include limits.h and sys/param.h.
2048         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
2050         * pthread_condattr_setpshared.c: Include errno.h.
2051         (pthread_condattr_setpshared): Return EINVAL if pshared
2052         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
2054         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
2055         defined symbol for entry point to avoid cancellation.
2056         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2057         Likewise.
2058         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
2059         Likewise.
2060         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2061         Likewise.
2062         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
2063         Likewise.
2064         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2065         Likewise.
2066         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
2067         __close_nocancel, __read_nocancel, __write_nocancel,
2068         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
2069         libpthread.so or librt.so, define to corresponding function
2070         without _nocancel suffix.
2071         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
2072         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
2073         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
2075         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
2077 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
2079         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
2080         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
2082         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
2083         in subsections has a symbol associated with it.
2085         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
2086         defined symbol for entry point to avoid cancellation.
2087         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
2089 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2091         * Makefile (tests): Add tst-tls5.
2092         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
2093         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
2094         ($(objpfx)tst-tls5): New.
2095         ($(objpfx)tst-tls6.out): Likewise.
2096         (tests): Depend on $(objpfx)tst-tls6.out.
2097         * tst-tls3.c: Include stdint.h and pthreaddef.h.
2098         (do_test): Check pthread_self () return value alignment.
2099         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
2100         (tf): Check pthread_self () return value alignment.
2101         * tst-tls5.c: New test.
2102         * tst-tls5.h: New.
2103         * tst-tls5mod.c: New.
2104         * tst-tls5moda.c: New.
2105         * tst-tls5modb.c: New.
2106         * tst-tls5modc.c: New.
2107         * tst-tls5modd.c: New.
2108         * tst-tls5mode.c: New.
2109         * tst-tls5modf.c: New.
2110         * tst-tls6.sh: New test.
2112         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
2113         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
2114         * init.c (pthread_functions): Initialize them.
2115         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
2116         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
2117         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
2118         pthread_cond_timedwait@@GLIBC_2.3.2.
2120 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2122         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
2123         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
2124         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
2125         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
2126         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
2127         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2129         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
2131         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
2132         _POSIX_THREAD_PRIORITY_SCHEDULING.
2133         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2135 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
2137         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
2138         nested function, use static inline function from libio.h.
2139         Code by Richard Henderson.
2141         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
2142         weak.
2144 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
2146         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
2147         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
2148         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
2149         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
2150         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
2151         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
2152         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
2153         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
2154         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
2155         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
2156         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
2157         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
2158         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
2159         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
2160         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
2161         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
2162         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
2163         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
2164         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
2165         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
2166         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
2167         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
2168         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
2169         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
2170         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
2171         * sysdeps/sparc/tls.h: New file.
2172         * sysdeps/sparc/tcb-offsets.sym: New file.
2173         * sysdeps/sparc/Makefile: New file.
2174         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
2175         * init.c [__sparc__] (__NR_set_tid_address): Define.
2177 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
2179         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
2180         _IO_release_lock): Define.
2182 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
2184         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
2185         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
2187 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
2189         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
2190         (__pthread_cleanup_class): Add missing return types of member
2191         functions.
2193 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
2195         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2196         (lll_mutex_unlock_force): Add memory barrier between store and futex
2197         syscall.
2199 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
2201         * tst-cancel4.c (do_test): Also unlink tempfname and remove
2202         tempmsg in first loop.
2204 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
2206         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2207         _POSIX_THREAD_PRIORITY_SCHEDULING.
2208         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2210 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2212         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
2213         (__rtld_lock_default_lock_recursive,
2214         __rtld_lock_default_unlock_recursive): Define.
2215         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
2216         __rtld_lock_unlock_recursive): Define using
2217         GL(_dl_rtld_*lock_recursive).
2218         * init.c (__pthread_initialize_minimal_internal): Initialize
2219         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
2220         Lock GL(_dl_load_lock) the same number of times as
2221         GL(_dl_load_lock) using non-mt implementation was nested.
2223         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
2224         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
2226 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
2228         * tst-cancel17.c (do_test): Make len2 maximum of page size and
2229         PIPE_BUF.
2231 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2233         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
2235 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
2237         * sysdeps/pthread/createthread.c (do_clone): Move error handling
2238         to first syscall error check.  Move syscall error check for tkill
2239         into __ASSUME_CLONE_STOPPED #ifdef.
2241 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
2243         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
2244         is not defined, do explicit synchronization.
2245         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
2246         is not defined also unlock pd->lock for non-debugging case in case
2247         it is necessary.
2248         * pthread_create.c (start_thread): Always get and release pd->lock
2249         if __ASSUME_CLONE_STOPPED is not defined.
2250         (start_thread_debug): Removed.  Adjust users.
2251         * allocatestack.c (allocate_stack): Always initialize lock if
2252         __ASSUME_CLONE_STOPPED is not defined.
2253         * Makefile (tests): Add tst-sched1.
2254         * tst-sched1.c: New file.
2256         * sysdeps/pthread/createthread.c (do_clone): Only use
2257         sched_setschduler and pass correct parameters.
2259 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2261         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
2262         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
2263         PTHREAD_STACK_MIN in comments.
2265 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2267         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2268         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
2269         argument.
2270         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
2271         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
2272         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
2273         (__pthread_cleanup_upto): Fix prototype.
2274         (_longjmp_unwind): Adjust caller.
2275         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
2276         Change second argument to const struct pointer.
2277         * tst-sem8.c (main): Remove unused s2 and s3 variables.
2278         * tst-sem9.c (main): Likewise.
2279         * unwind.c: Include string.h for strlen prototype.
2281 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
2283         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2284         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
2285         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
2286         Define HAVE_CMOV.
2287         Patch by Nicholas Miell <nmiell@attbi.com>.
2289 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
2291         * init.c (__pthread_initialize_minimal_internal): Initialize
2292         GL(dl_init_static_tls).
2293         * pthreadP.h (__pthread_init_static_tls): New prototype.
2294         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
2295         New functions.
2296         * Makefile (tests): Add tst-tls4.
2297         (modules-names): Add tst-tls4moda and tst-tls4modb.
2298         ($(objpfx)tst-tls4): Link against libdl and libpthread.
2299         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
2300         tst-tls4modb.so.
2301         * tst-tls4.c: New file.
2302         * tst-tls4moda.c: New file.
2303         * tst-tls4modb.c: New file.
2305 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
2307         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
2308         before __timer_dealloc.
2309         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
2310         Don't call list_unlink.
2312 2003-07-29  Roland McGrath  <roland@redhat.com>
2314         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
2316 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
2318         * tst-cancel17.c (do_test): Check if aio_cancel failed.
2319         Don't reuse struct aiocb A if it failed.
2320         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
2321         not just one byte, as that does not block.
2323 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
2325         * sysdeps/pthread/unwind-resume.c: New file.
2326         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
2327         unwind-resume in csu subdir.
2328         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
2329         exceptions.
2330         (librt-sysdep_routines, librt-shared-only-routines): Add
2331         rt-unwind-resume.
2332         * sysdeps/pthread/rt-unwind-resume.c: New file.
2333         * unwind-forcedunwind.c: New file.
2334         * Makefile (libpthread-routines): Add unwind-forcedunwind.
2335         (libpthread-shared-only-routines): Likewise.
2336         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
2337         * pthreadP.h (pthread_cancel_init): New prototype.
2338         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
2340         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
2341         attr argument const struct pthread_attr *.
2343         * res.c (__res_state): Return __resp.
2344         * descr.h: Include resolv.h.
2345         (struct pthread): Add res field.
2346         * pthread_create.c: Include resolv.h.
2347         (start_thread): Initialize __resp.
2348         * Makefile (tests): Add tst-_res1.
2349         (module-names): Add tst-_res1mod1, tst-_res1mod2.
2350         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
2351         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
2352         libpthread.
2353         * tst-_res1.c: New file.
2354         * tst-_res1mod1.c: New file.
2355         * tst-_res1mod2.c: New file.
2357 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
2359         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
2361         * Makefile: Define various *-no-z-defs variables for test DSOs
2362         which has undefined symbols.
2364 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
2366         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2367         Retry if the stwcx fails to store once_control.
2369 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
2371         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
2372         pthread_attr_setaffinity.
2373         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
2374         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
2375         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
2376         * pthread_attr_destroy.c: Free cpuset element if allocated.
2377         * pthread_create.c: Pass iattr as additional parameter to
2378         create_thread.
2379         * sysdeps/pthread/createthread.c: If attribute is provided and
2380         a new thread is created with affinity set or scheduling parameters,
2381         start thread with CLONE_STOPPED.
2382         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
2383         pthread_attr_setaffinity.
2384         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2385         cpuset element.
2387 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
2389         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
2391 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
2393         * sysdeps/pthread/configure.in: Require CFI directives also for
2394         ppc and s390.
2396 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
2398         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2399         Add cfi directives.
2401 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2403         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
2404         CLEANUP_JMP_BUF.
2405         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
2406         registers as variables.  Call __pthread_mutex_unlock_usercnt.
2407         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2408         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
2409         not self pointer in __writer.  Compare with TID to determine
2410         deadlocks.
2411         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2412         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2413         Likewise.
2414         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2415         Likewise.
2416         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
2417         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2418         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
2419         macros also when compiling librt.
2421 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
2423         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
2424         -fasynchronous-unwind-tables.
2425         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2426         (PSEUDO): Add cfi directives.
2427         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
2428         Likewise.
2429         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2430         Likewise.
2432 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
2434         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
2435         __pthread_unregister_cancel): Add prototypes and hidden_proto.
2436         * unwind.c (__pthread_unwind_next): Add hidden_def.
2437         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
2438         Likewise.
2439         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2440         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2441         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2442         Likewise.
2443         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
2444         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2445         Likewise.
2446         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
2447         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
2448         __pthread_unregister_cancel and __pthread_unwind_next.
2450 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
2452         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
2453         different symbol for the cancellation syscall wrapper and
2454         non-cancellation syscall wrapper.
2455         (PSEUDO_END): Define.
2457 2003-07-05  Richard Henderson  <rth@redhat.com>
2459         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
2460         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
2461         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2462         return actual return value from the syscall, not 0.
2464 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
2466         * descr.h (struct pthread): Add pid field.
2467         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
2468         (__reclaim_stacks): Likewise.
2469         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
2470         also check for PID of the signal source.
2471         (__pthread_initialize_minimal_internal): Also initialize pid field
2472         of initial thread's descriptor.
2473         * pthread_cancel.c: Use tgkill instead of tkill if possible.
2474         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2475         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
2476         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2477         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2479 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
2481         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
2482         Fix use of parameter.
2483         (__libc_cleanup_pop): Likewise.
2485 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
2487         * init.c (sigcancel_handler): Change parameters to match handler
2488         for SA_SIGACTION.  Check signal number and code to recognize
2489         invalid invocations.
2491 2003-07-03  Roland McGrath  <roland@redhat.com>
2493         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
2494         Apply sizeof (struct pthread) bias to r13 value.
2496 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
2498         * sysdeps/pthread/configure.in: Require CFI directives.
2500         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
2501         definition.
2502         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
2503         libpthread compilation.
2504         * unwind.c (__pthread_unwind): Add hidden_def.
2505         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
2507 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2509         * libc-cancellation.c (__libc_cleanup_routine): Define.
2510         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
2511         (__pthread_cleanup_pop): Define.
2513 2003-07-01  Richard Henderson  <rth@redhat.com>
2515         * sysdeps/alpha/elf/pt-initfini.c: New file.
2516         * sysdeps/alpha/pthread_spin_lock.S: New file.
2517         * sysdeps/alpha/pthread_spin_trylock.S: New file.
2518         * sysdeps/alpha/pthreaddef.h: New file.
2519         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
2520         * sysdeps/alpha/tls.h: New file.
2521         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
2522         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
2523         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
2524         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
2525         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
2526         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
2527         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
2528         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
2529         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
2530         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
2532 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2534         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
2535         cleanup support and unwind info.
2537 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
2539         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2540         Use correct cleanup handler registration.  Add unwind info.
2541         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
2542         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
2543         * tst-once3.c: Add cleanup handler and check it is called.
2544         * tst-once4.c: Likewise.
2545         * tst-oncex3.c: New file.
2546         * tst-oncex4.c: New file.
2547         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
2549 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
2551         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
2553 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
2555         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
2556         (tf_msgsnd): Likewise.
2558         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
2559         premature returns a bit more.
2561 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
2563         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
2564         definition to the front.
2566         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
2567         the cleanup functions to make the names unique.  Fix dwarf opcode
2568         un unwind table.
2569         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
2570         functions to make the names unique.  Fix CFA offset for two blocks.
2572 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
2574         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
2575         missing closing braces.
2576         Patch by Christophe Saout <christophe@saout.de>.
2578 2003-06-24  Roland McGrath  <roland@redhat.com>
2580         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
2582 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
2584         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
2585         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
2587         * pthreadP.h: Declare __find_thread_by_id.
2588         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
2589         * pthread_clock_gettime.c: Allow using other thread's clock.
2590         * pthread_clock_settime.c: Likewise.
2591         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2592         * Makefile: Add rules to build and run tst-clock2.
2593         * tst-clock2.c: New file.
2595 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
2597         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
2598         to use exception-based cleanup handler.
2599         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2601         * tst-cond8.c (ch): Announce that we are done.
2603         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
2605         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
2606         Also test aio_suspend with timeout value.
2608 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
2610         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
2611         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
2612         attribute_hidden.
2614         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
2615         (__pthread_mutex_lock_internal): Likewise.
2616         (__pthread_mutex_unlock_internal): Likewise.
2617         (__pthread_mutex_unlock_usercnt): Declare.
2618         * pthread_mutex_destroy.c: Always fail if used in any way.
2619         * pthread_mutex_init.c: Update comment.
2620         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
2621         * pthread_mutex_timedlock.c: Adjust __nusers.
2622         * pthread_mutex_trylock.c: Adjust __nusers.
2623         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
2624         and public interfaces are wrapper with pass additional parameter.
2625         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
2626         parameter zero.
2627         * tst-mutex8.c: New file.
2628         * Makefile (tests): Add tst-mutex8.
2629         * sysdeps/pthread/pthread_cond_timedwait.c: Call
2630         __pthread_mutex_unlock_usercnt.
2631         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2632         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2633         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2634         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2635         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2636         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
2637         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2638         Add __nusers.
2639         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2640         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2641         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2642         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2643         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2645         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
2646         * pthread_mutex_timedlock.c: Likewise.
2647         * pthread_mutex_trylock.c: Adjust __nusers.
2648         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
2649         * tst-mutex9.c: New file.
2650         * Makefile (tests): Add tst-mutex9.
2651         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
2652         * sysdeps/ia64/tls.h: Likewise.
2653         * sysdeps/powerpc/tls.h: Likewise.
2654         * sysdeps/s390/tls.h: Likewise.
2655         * sysdeps/sh/tls.h: Likewise.
2656         * sysdeps/x86_64/tls.h: Likewise.
2657         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2658         Change type of __owner.
2659         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2660         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2661         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2662         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2663         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2665 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
2667         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
2668         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
2670         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
2671         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
2672         instead of nr to lll_futex_wake.  Only set errno and return -1
2673         if err < 0.
2675         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
2676         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2677         return actual return value from the syscall, not 0.
2679 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
2681         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
2682         find a random value.
2683         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
2684         errno==EIDRM.
2686         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
2687         compat_timer_settime.
2688         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
2689         compat_timer_gettime.
2690         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
2691         compat_timer_getoverrun.
2692         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
2693         compat_timer_delete.
2695         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
2696         error-checking mutex detect busy mutexes.
2698 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2700         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
2701         Add ax to clobber list.
2702         (lll_mutex_cond_lock): Likewise.
2703         (lll_mutex_unlock): Likewise.
2704         (lll_lock): Likewise.
2705         (lll_unlock): Likewise.
2707         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
2708         * tst-cancel18.c: New file.
2709         * tst-cancelx18.c: New file.
2711         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
2712         and tcdrain.
2714         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
2715         * tst-cancel17.c: New file.
2716         * tst-cancelx17.c: New file.
2718         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
2719         * sysdeps/unix/sysv/linux/sigwait.c: New file.
2720         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
2722         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
2724 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
2726         * sysdeps/pthread/createthread.c (create_thread): Set
2727         header.multiple_threads unconditionally.
2728         * allocatestack.c (allocate_stack): Likewise.
2729         * descr.h (struct pthread): Add header.multiple_threads
2730         unconditionally.
2731         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
2732         Define for librt.  #error if neither libpthread, libc nor librt.
2733         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
2734         Likewise.
2735         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
2736         CDISABLE): Likewise.
2737         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
2738         CDISABLE): Likewise.
2739         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
2740         CDISABLE): Likewise.
2741         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
2742         CDISABLE): Likewise.  Access header.multiple_threads outside of
2743         libc and libpthread.
2744         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
2745         Likewise.
2746         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
2747         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
2749 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2751         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
2752         Also test early cancellation before the thread reaches the cancellation
2753         point.
2755         * Makefile: Compile forward.c with exceptions.
2757         * sysdeps/unix/sysv/linux/sleep.c: New file.
2759 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
2761         * Makefile: Add CFLAGS definition to compile function wrappers
2762         duplicated from libc with exceptions.
2763         * tst-cancel4.c: Also check cancellation handlers.
2765         * Makefile: Add rules to build and run tst-cancel16 and
2766         tst-cancelx16.  Add missing CFLAGS definitions.
2767         * tst-cancel16.c: New file.
2768         * tst-cancelx16.c: New file.
2770 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
2772         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2773         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
2774         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
2775         (DL_SYSINFO_IMPLEMENTATION): Likewise.
2777         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
2778         (LIBC_CANCEL_RESET): Likewise.
2779         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
2780         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
2781         librt-cancellation.
2782         (CFLAGS-libcrt-cancellation.c): Define.
2783         * sysdeps/pthread/librt-cancellation.c: New file.
2784         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
2785         macros also when compiling librt.
2786         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2787         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2788         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2789         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2790         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2791         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2792         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2794         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
2795         compat_timer_create.
2797 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
2799         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
2801         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
2802         __register_atfork.
2803         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
2804         Add libc_hidden_def.
2806 2003-06-13  Roland McGrath  <roland@redhat.com>
2808         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
2809         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
2811 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
2813         * allocatestack.c (queue_stack): Always inline.
2814         * ptreadhP.h (__do_cancel): Likewise.
2816 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
2818         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
2819         a typo.
2821 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
2823         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2824         (__pthread_cond_signal): Remove incorrect second addition for
2825         cond_lock!=0.
2827 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
2829         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2830         (__pthread_cond_signal): Use correct futex pointer in
2831         __lll_mutex_lock_wait call.
2833         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2834         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
2836 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
2838         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
2839         cancelable.
2840         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2841         Likewise.
2843         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
2844         hand-written CFI generation code.  Since ENTRY/END also initiated
2845         CFI frames this caused two CFI sets to be generated.
2847 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
2849         * cleanup_routine.c: New file.
2850         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
2851         * sysdeps/pthread/pthread.h: Add support for fully exception-based
2852         cleanup handling.
2853         * Makefile (libpthread-routines): Add cleanup_routine.
2854         Add more CFLAGS variables to compile with exceptions.  Add comments
2855         why which file needs unwind tables.
2856         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
2857         tests.
2858         * tst-cancelx1.c: New file.
2859         * tst-cancelx2.c: New file.
2860         * tst-cancelx3.c: New file.
2861         * tst-cancelx4.c: New file.
2862         * tst-cancelx5.c: New file.
2863         * tst-cancelx6.c: New file.
2864         * tst-cancelx7.c: New file.
2865         * tst-cancelx8.c: New file.
2866         * tst-cancelx9.c: New file.
2867         * tst-cancelx10.c: New file.
2868         * tst-cancelx11.c: New file.
2869         * tst-cancelx12.c: New file.
2870         * tst-cancelx13.c: New file.
2871         * tst-cancelx14.c: New file.
2872         * tst-cancelx15.c: New file.
2873         * tst-cleanupx0.c: New file.
2874         * tst-cleanupx0.expect: New file.
2875         * tst-cleanupx1.c: New file.
2876         * tst-cleanupx2.c: New file.
2877         * tst-cleanupx3.c: New file.
2879         * tst-cleanup0.c: Make standard compliant.
2880         * tst-cleanup1.c: Likewise.
2882         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
2883         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2884         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2885         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2886         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2887         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2888         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
2889         CLEANUP_JMP_BUF.
2890         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2891         * tst-cancel12.c: New file.
2892         * tst-cancel13.c: New file.
2893         * tst-cancel14.c: New file.
2894         * tst-cancel15.c: New file.
2895         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
2896         and tst-cancel15.
2898         * tst-cancel1.c: Add some comments.
2900         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
2901         timeout correctly.
2903 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
2905         * Makefile (CFLAGS-pthread_cancel.c): Define.
2907 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
2909         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
2910         Change type of __writer element to int.
2911         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2912         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2913         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2914         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2915         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2916         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
2917         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2918         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
2919         Compare with TID to determine deadlocks.
2920         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2921         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2922         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
2923         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2924         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2925         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2926         Likewise.
2927         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2928         Likewise.
2929         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2930         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2931         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2932         Likewise.
2933         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2934         Likewise.
2935         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2936         * Makefile (tests): Add tst-rwlock12.
2937         * tst-rwlock12.c: New file.
2939 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
2941         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
2942         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
2943         Remove bogus hidden_proto.
2944         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2945         Likewise.
2946         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
2947         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
2948         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
2949         ___lll_mutex_timedlock): Likewise.
2951 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
2953         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2954         (__pthread_cond_signal): Add some code to eventually handle
2955         cond_lock!=0.
2957 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
2959         * Makefile (tests): Add tst-exec4.
2960         (tst-exec4-ARGS): Define.
2961         * tst-exec4.c: New file.
2963 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
2965         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2966         Also fail if tv_nsec < 0.
2967         (__lll_timedwait_tid): Likewise.
2968         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
2969         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
2970         Likewise.
2971         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
2972         Likewise.
2973         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
2974         Likewise.
2975         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2976         Likewise.
2977         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
2978         Likewise.
2979         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
2980         Likewise.
2982         * Makefile (tests): Add tst-sem8 and tst-sem9.
2983         * tst-sem8.c: New file.
2984         * tst-sem9.c: New file.
2985         * sem_open.c: Fix creation of in_use record if the file exists but
2986         no internal record.
2988         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
2989         definitions.
2991         * sysdeps/pthread/timer_create.c (timer_create): In case
2992         evp==NULL, assign timer ID to sival_ptr.
2994         * descr.h (struct pthread_unwind_buf): Change type of prev element to
2995         struct pthread_unwind_buf *.
2996         (struct pthread): Likewise for cleanup_jmp_buf element.
2998         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
2999         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
3000         * unwind.c (__pthread_unwind_next): Likewise.
3002 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
3004         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3005         (lll_futex_timed_wait): Use int for futex value parameter.
3006         (lll_futex_wake): Likewise.
3007         (lll_futex_requeue): Likewise.
3009         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3010         Replace one memory operation with one register operation.
3012         * tst-join4.c (do_test): Fix error message.
3014         * tst-rwlock6.c (do_test): Use correct format specifier.
3016         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
3017         (__lll_mutex_lock_wait): Replace one memory operation with one
3018         register operation.
3019         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
3020         (__lll_mutex_lock_wait): Likewise.
3022         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3023         (__lll_mutex_cond_lock): Add one to value parameter of
3024         __lll_lock_wait to reflect reality in the futex syscall.
3025         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3026         (lll_mutex_cond_lock): Likewise.
3028 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3030         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
3031         New function.
3032         (lll_mutex_cond_lock): Define.
3034 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
3036         * Makefile (tests): Add tst-signal6.
3037         * tst-signal6.c: New file.
3039         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
3040         (__lll_mutex_unlock_force): New function
3041         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3043         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3044         (__lll_mutex_unlock_force): New function.
3045         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3047         * tst-rwlock7.c (do_test): Use correct format specifier.
3049         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
3050         Find break parameter in correct asm argument.
3052 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
3054         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
3055         Remove out4.
3056         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
3057         error occured.
3058         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3059         Add __mutex.
3060         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
3061         lll_futex_requeue, lll_mutex_unlock_force): Define.
3063 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3065         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3066         (pthread_cond_t): Add __mutex.
3067         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
3068         lll_futex_requeue, lll_mutex_unlock_force): Define.
3070 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3072         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
3073         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3074         Add __mutex field.
3075         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
3076         Define.
3077         (lll_futex_wait, lll_futex_wake): Define.
3078         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
3079         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
3080         FUTEX_REQUEUE instead of FUTEX_WAIT.
3081         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
3082         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
3083         mutex which was used in condvar structure.  Call
3084         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
3085         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3087         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
3088         include tcb-offsets.h.  Read wakeup value in locked region.
3089         Use the value of gbr register as THREAD_ID.
3090         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3091         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3092         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3094         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
3095         macros.
3097 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
3099         * sysdeps/pthread/pthread_cond_broadcast.c
3100         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
3102 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
3104         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
3105         typo in register name.
3106         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
3107         correctly.  Actually use requeue.  Little optimization.
3108         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
3109         mutex address early.  Handle cancellation state as 32-bit value.
3110         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3111         Remove unnecessary label.
3113 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
3115         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
3116         instead of FUTEX_WAIT.
3117         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
3118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3119         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3120         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3121         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3122         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
3123         used in condvar structure.  Call __pthread_mutex_cond_lock instead
3124         of __pthread_mutex_lock_internal.
3125         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3126         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3127         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3128         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
3129         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3130         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3131         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
3132         Add pthread_mutex_cond_lock.
3133         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
3134         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
3135         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
3136         lll_mutex_cond_lock.
3137         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3138         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3139         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3140         Add __mutex field.
3141         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3142         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3144         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
3145         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3147         * pthreadP.h: Declare __pthread_mutex_cond_lock.
3148         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
3149         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
3150         macro don't define aliases.
3152         * cancellation.c: Remove __pthread_enable_asynccancel_2.
3153         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
3154         * sysdeps/pthread/pthread_cond_timedwait.c: Use
3155         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
3156         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3157         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3158         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3159         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3160         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3162 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
3164         * sem_open.c: Fix one endless loop.  Implement correct semantics
3165         wrt opening the same semaphore more then once.
3166         * sem_close.c: Adjust for sem_open change.
3167         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
3168         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
3169         * Makefile (tests): Add tst-sem7.
3170         * tst-sem7.c: New file.
3172 2003-05-16  Roland McGrath  <roland@redhat.com>
3174         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
3175         uninitialized variable braino.
3177 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
3179         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
3180         test for syscall availability.
3182         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
3183         __no_posix_timers to -1 if the syscalls don't exist.
3185         * pthread_join.c (pthread_join): Set tid field of the joined
3186         thread to -1.  This isn't necessary but helps to recognize some
3187         error conditions with almost no cost.
3189         * allocatestack.c (FREE_P): Also negative values indicate an
3190         unused stack.
3192         * unwind.c: Include <unistd.h>.
3194 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
3196         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
3198 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
3200         * Makefile (crti-objs, crtn-objs): New variables.
3201         (omit-deps, extra-objs): Add crtn.
3202         ($(objpfx)libpthread.so): Depend on both crti and crtn
3203         and links to them in multidir.
3204         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
3206 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
3208         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3209         (lll_mutex_unlock): Use atomic_exchange_rel.
3211 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
3213         * cond-perf.c (cons): Add missing locking around setting of alldone.
3215 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
3217         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
3218         related macros.
3219         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3221 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
3223         * tst-sem6.c: New file.
3224         * Makefile (tests): Add tst-sem6.
3226         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
3227         Use atomic_exchange_rel instead of atomic_exchange.
3228         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
3229         Likewise.
3231         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
3232         code for lll_futex_wait and lll_futex_wake in static apps.  Use
3233         vsyscall is possible.
3235         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
3236         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
3237         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
3238         pthread_setaffinity_np.
3239         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
3240         and pthread_setaffinity_np.
3241         * Makefile (libpthread-routines): Add pthread_getaffinity and
3242         pthread_setaffinity.
3244         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
3245         use it in case mmap to allocate the stack fails.
3246         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
3247         ARCH_MAP_FLAGS here.
3248         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
3249         ARCH_RETRY_MMAP.
3251 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
3253         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
3254         handler implementation.  It is now lockless in fork().
3255         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3256         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3257         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
3258         declare the __fork_*_lists.
3259         (struct fork_handler): Include pointers to all three functions.
3260         Add next, refcntr and need_signal elements.
3261         (__fork_handlers): New declaration.
3262         (__register_atfork_malloc): Remove declaration.
3263         (HAVE_register_atfork_malloc): Remove definition.
3264         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
3265         __pthread_child_handler variable.
3266         (__libc_pthread_init): Use __register_atfork instead of explicitly
3267         adding to the list.
3268         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
3269         and lll_futex_wake.
3270         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3272         * unwind.c (unwind_cleanup): Print error message and then abort.  This
3273         function must never be reached.
3275         * cond-perf.c: New file.
3277 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
3279         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
3281 2003-05-04  Roland McGrath  <roland@redhat.com>
3283         * Makefile ($(objpfx)../libc.so): New target.
3285 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
3287         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3288         (pthread_condattr_t): Size is only an int, don't use long for
3289         alignment.
3290         (pthread_mutexattr_t): Likewise.
3291         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3292         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3293         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3295 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
3297         * sysdeps/i386/tls.h: Define THREAD_ID.
3298         * sysdeps/ia64/tls.h: Likewise.
3299         * sysdeps/powerpc/tls.h: Likewise.
3300         * sysdeps/s390/tls.h: Likewise.
3301         * sysdeps/sh/tls.h: Likewise.
3302         * sysdeps/x86_64/tls.h: Likewise.
3303         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
3304         record ownership.
3305         * pthread_mutex_timedlock.c: Likewise.
3306         * pthread_mutex_trylock.c: Likewise.
3307         * pthread_mutex_unlock.c: Likewise.
3308         * pthread_rwlock_trywrlock.c: Likewise.
3309         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
3310         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3311         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3312         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3314         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
3315         flag.
3317 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
3319         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3320         (__SIZEOF_PTHREAD_COND_T): Define to 48.
3321         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
3322         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3323         Make __align long long instead of long.
3324         (pthread_rwlock_t): Formatting.
3325         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3326         (pthread_rwlock_t): Formatting.
3327         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3328         (pthread_cond_t): Make __align long long instead of long.
3329         (pthread_rwlock_t): Move __flags field to the same position as in
3330         linuxthreads.
3332 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
3334         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
3335         * tst-rwlock7.c (do_test): Likewise.
3337 2003-04-26  Roland McGrath  <roland@redhat.com>
3339         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
3341 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
3343         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
3344         sizeof (struct pthread).
3345         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
3346         1 struct pthread.
3347         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
3348         to 0.
3349         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
3350         struct pthread.
3351         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
3352         to 32-bit bytes.
3353         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
3354         tcbp.
3355         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
3356         unneccessarily.
3357         (NO_TLS_OFFSET): Define.
3358         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
3359         add TLS_TCB_SIZE unnecessarily.
3361 2003-04-22  Roland McGrath  <roland@redhat.com>
3363         * Makeconfig (shared-thread-library): Reverse link order to work
3364         around linker bug.
3366 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
3368         * semaphore.h: Fix typo in comment.
3370 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
3372         * sysdeps/pthread/sigfillset.c: New file.
3374         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
3375         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
3376         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
3377         * sysdeps/pthread/sigaction.c: Likewise.
3378         * sysdeps/pthread/sigprocmask.c: New file.
3379         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
3380         __SIGRTMIN+1.
3381         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3382         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
3383         in this case.
3385 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
3387         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3388         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
3390         * sysdeps/unix/sysv/linux/unregister-atfork.c
3391         (__unregister_atfork): Don't free memory not allocated dynamically.
3393         * semaphore.h: Remove __THROW marker from cancellation points.
3394         * nptl/sysdeps/pthread/pthread.h: Likewise.
3396 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
3398         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
3399         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
3400         __THROW.
3402 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
3404         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
3406 2003-04-15  Roland McGrath  <roland@redhat.com>
3408         * forward.c (__pthread_unwind): Tweak to avoid warning.
3410 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
3412         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
3414 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
3416         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
3417         overflow CFA advance instructions.
3418         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3420 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
3422         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
3423         * sysdeps/i386/pthread_spin_lock.c: Likewise.
3424         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
3425         defined.
3427         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
3428         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
3429         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
3430         DW_CFA_advance_loc for .Laddl-.Lsubl.
3432 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
3434         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
3435         position-independent unwind data for static libraries.
3436         Add missing unwind info.  Add comments.
3438         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
3439         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3440         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3441         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3443 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
3445         * Makefile: Make sure all cancellation points are compiled with
3446         exception and asynchronous unwind tables.
3448         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
3449         which mishandles loading of global object addresses in PIC.
3450         (THREAD_SETMEM_NC): Likewise.
3452 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3454         * pthread.h: Define new data structure for cleanup buffer.  Declare
3455         new cleanup handler interfaces.
3456         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
3457         (struct pthread): Add cleanup_jmp_buf pointer.  Define
3458         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
3459         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
3460         it.  Declare old cleanup handler installation functions.
3461         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
3462         handling.
3463         * cleanup_defer.c: Likewise.
3464         * cleanup_compat.c: New file.  Old cleanup code.
3465         * cleanup_def_compat.c: New file.  Old cleanup code.
3466         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
3467         if own thread descriptor.
3468         * unwind.c: New file.
3469         * forward.c: Add __pthread_unwind.
3470         * init.c (pthread_functions): Add __pthread_unwind.
3471         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
3472         Add ptr___pthread_unwind.
3473         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
3474         and unwind function.
3475         * Makefile (libpthread-routines): Add cleanup_compat,
3476         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
3477         table generation if necessary.
3478         * version.c: Record whether unwind support is compiled in.
3479         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
3480         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
3481         handler interfaces.
3482         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
3483         complication to generate unwind information for syscall wrappers.
3484         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3485         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3486         __cleanup_fct_attribute.
3488         * Makefile: Add rules to build and run tst-cleanup0.
3489         * tst-cleanup0.c: New file.
3490         * tst-cleanup0.expect: New file.
3492         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
3493         caller.  Optimize to avoid often unecessary local variable.
3495 2003-04-11  Roland McGrath  <roland@redhat.com>
3497         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
3498         sets variable `multidir'; include that.
3499         (generated): Add it.
3500         ($(objpfx)$(multidir)/crti.o): New target.
3501         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
3503 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3505         * tst-attr2.c (do_test): Add cast to avoid warning.
3506         * tst-mutex4.c (do_test): Likewise.
3508 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
3510         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
3511         in child.
3513 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
3515         * Makefile (tests): Add tst-detach1.
3516         * tst-detach1.c: New file.
3518 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
3520         * sysdeps/pthread/pthread.h: Remove duplicate
3521         pthread_cleanup_{push,pop} definitions.
3523         * tst-barrier2.c: Eliminate warnings.
3524         * tst-cancel4.c: Likewise.
3525         * tst-cond4.c: Likewise.
3526         * tst-cond6.c: Likewise.
3527         * tst-detach1.c: Likewise.
3528         * tst-rwlock4.c: Likewise.
3529         * tst-rwlock6.c: Likewise.
3530         * tst-rwlock7.c: Likewise.
3531         * tst-sem3.c: Likewise.
3532         * tst-spin2.c: Likewise.
3533         * tst-umask1.c: Likewise.
3535 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
3537         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
3539 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
3541         * descr.h (struct pthread): Move cancelhandling member to the front.
3543 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
3545         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
3546         malloc_parent, and malloc_child statically.
3547         (__register_atfork_malloc): New function.
3548         (free_mem): Don't free any of the malloc_* variables on the list.
3549         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
3550         Define HAVE_register_atfork_malloc.
3552 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
3554         * sysdeps/pthread/createthread.c (create_thread): Add some more
3555         comments explaining when to set multiple_threads and when not.
3557         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3558         THREAD_ATOMIC_BIT_SET if not already defined.
3559         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3560         THREAD_ATOMIC_BIT_SET:
3561         * sysdeps/x86_64/tls.h: Likewise.
3562         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
3563         THREAD_ATOMIC_CMPXCHG_VAL.
3564         (_pthread_cleanup_pop_restore): Likewise.
3565         * cancellation.c (__pthread_enable_asynccancel): Likewise.
3566         (__pthread_enable_asynccancel_2): Likewise.
3567         (__pthread_disable_asynccancel): Likewise.
3568         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3569         (__libc_disable_asynccancel): Likewise.
3570         * init.c (sigcancel_handler): Likewise.
3571         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
3572         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
3574 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
3576         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
3577         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3578         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
3579         * Makefile (tests): Add tst-cancel11.
3580         * tst-cancel11.c: New file.
3582 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
3584         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
3585         round, not the first.  Use specific_used flag instead of local
3586         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
3587         (__free_tcb): Don't call deallocate_tsd here.
3588         (start_thread): Call deallocate_tsd here.
3589         * pthread_setspecific.c: Set specific_used flag really only when
3590         needed.
3591         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
3592         * tst-tsd3.c: New file.
3593         * tst-tsd4.c: New file.
3595 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3597         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
3598         Use atomic_exchange_and_add instead of __lll_add.
3599         (__lll_mutex_timedlock): Likewise.
3600         Patch by Ian Wienand.
3602 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
3604         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3605         (SINGLE_THREAD_P): Fix typo.
3606         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
3608 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3610         * Makefile (tests): Add tst-align.
3611         * tst-align.c: New file.
3612         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
3614         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
3615         function correctly.
3617         * tst-tsd2.c: Add casts to avoid warnings.
3619 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
3621         * descr.h (struct pthread): Move most often used elements to the front.
3623 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
3625         * Makefile (libpthread-routines): Add pthread_atfork.
3626         (libpthread-static-only-routines): Add pthread_atfork.
3628 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3630         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
3631         of TLS_DTV_AT_TP.
3632         (INSTALL_DTV): Add parens.
3633         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
3634         Use passed descr instead of THREAD_SELF.
3635         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
3636         (__lll_mutex_timedlock_wait): Correct expected value after
3637         spurious wakeup.
3638         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
3639         Release lock before waking up the waiters.
3640         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
3641         criteria.  Reorderstruct passed to cleanup handler.  Fix
3642         handling of cancellation and failung pthread_mutex_unlock call.
3643         Use __pthread_enable_asynccancel_2 instead of
3644         __pthread_enable_asynccancel.
3645         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3646         Return result of lock re-get if it fails.
3647         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
3648         for __pthread_cleanup_push.
3649         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
3650         completely broken rwlock implementation.
3651         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3652         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3653         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3654         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3655         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3656         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
3657         versioned_symbol macro.
3658         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
3659         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
3661 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
3663         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
3664         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
3665         and __helper_tid.
3666         (struct timer): Remove th and bar field.
3667         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
3668         debugging code.  Create only one helper thread.
3669         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
3670         helper thread.
3671         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3672         Renamed.  Define statically.  Use thread info from siginfo.
3673         (__helper_once): New variable.
3674         (__helper_tid): New variable.
3675         (__reset_helper_control): New function.
3676         (__start_helper_thread): New function.
3678         * pthread_create.c (start_thread): Don't use setjmp inside
3679         __builtin_expect to work around gcc bug.
3681         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
3682         timer_delete syscall fails, but not with ENOSYS, set
3683         __no_posix_timers.
3685         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
3686         (timer_settime): Fix typo.
3687         * sysdeps/unix/sysv/linux/timer_getoverr.c
3688         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
3690 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
3692         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
3693         offset of cleanupbuf.__prev.
3695 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
3697         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
3698         of included file.
3700 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
3702         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
3703         NULL provide default definition to syscall.
3705 2003-03-25  Roland McGrath  <roland@redhat.com>
3707         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
3708         (timer_id2ptr): Fix typo.
3710 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
3712         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
3713         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
3714         * sysdeps/ia64/pthreaddef.h: Likewise.
3715         * sysdeps/powerpc/pthreaddef.h: Likewise.
3716         * sysdeps/s390/pthreaddef.h: Likewise.
3717         * sysdeps/sh/pthreaddef.h: Likewise.
3718         * sysdeps/x86_64/pthreaddef.h: Likewise.
3719         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
3720         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
3721         being changed.
3722         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3723         SIGTIMER is not unblocked.
3724         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
3725         RT signal taken.
3726         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
3727         be send.
3728         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
3729         pass pointer through as ID.
3730         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
3731         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
3732         * sysdeps/unix/sysv/linux/timer_create.c: New file.
3733         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
3734         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
3735         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
3736         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
3737         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
3738         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
3739         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
3740         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
3741         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
3742         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
3743         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
3744         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
3745         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
3746         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
3747         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
3748         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
3749         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
3750         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
3751         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
3752         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
3753         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
3754         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
3755         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
3756         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
3757         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
3758         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
3759         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
3760         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
3761         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
3762         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
3764         * pthreadP.h: Remove FRAME_LEFT definition.
3765         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
3766         already left frame.  Programs which have this problem are not POSIX
3767         compliant.
3768         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
3770 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
3772         * sysdeps/pthread/tst-timer.c: Check return values of the
3773         functions we test.
3775 2003-03-23  Roland McGrath  <roland@redhat.com>
3777         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
3778         * tst-tls3mod.c: Likewise.
3779         * tst-tls1.c: Likewise.
3780         * tst-tls2.c: Likewise.
3782         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
3783         undefined behavior.
3785         * tst-join5.c (tf1, tf2): Add a cast.
3787         * Makeconfig (includes): Append -I$(..)nptl to this variable.
3789         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
3790         Don't test anything.
3791         * tst-cond4.c: Likewise.
3792         * tst-cond6.c: Likewise.
3793         * tst-flock2.c: Likewise.
3794         * tst-mutex4.c: Likewise.
3795         * tst-rwlock4.c: Likewise.
3796         * tst-signal1.c: Likewise.
3797         * tst-spin2.c: Likewise.
3798         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
3800         * tst-mutex4.c: Use test-skeleton.c.
3801         * tst-spin2.c: Likewise.
3802         * tst-sysconf.c: Likewise.
3803         * tst-barrier2.c: Likewise.
3804         * tst-cond4.c: Likewise.
3805         * tst-cond6.c: Likewise.
3806         * tst-rwlock4.c: Likewise.
3807         * tst-unload.c: Likewise.
3808         * tst-flock2.c (do_test): Use return instead of exit.
3810 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
3812         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
3814 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
3816         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3817         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
3818         instead of __lll_compare_and_swap.
3819         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3820         Likewise.
3821         Removed definition if __lll_compare_and_swap.
3823         * cancellation.c: Adjust for new form of compare&exchange macros.
3824         * cleanup_defer.c: Likewise.
3825         * init.c: Likewise.
3826         * libc-cancellation.c: Likewise.
3827         * old_pthread_cond_broadcast.c: Likewise.
3828         * old_pthread_cond_signal.c: Likewise.
3829         * old_pthread_cond_timedwait.c: Likewise.
3830         * old_pthread_cond_wait.c: Likewise.
3831         * pthread_cancel.c: Likewise.
3832         * pthread_create.c: Likewise.
3833         * pthread_detach.c: Likewise.
3834         * pthread_join.c: Likewise.
3835         * pthread_key_delete.c: Likewise.
3836         * pthread_setcancelstate.c: Likewise.
3837         * pthread_setcanceltype.c: Likewise.
3838         * pthread_timedjoin.c: Likewise.
3839         * pthread_tryjoin.c: Likewise.
3840         * sysdeps/pthread/createthread.c: Likewise.
3842 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
3844         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
3845         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
3846         definitions.  Replace uses with calls to atomic_* functions.
3847         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3848         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
3849         __lll_test_and_set calls with atomic_exchange_and_add and
3850         atomic_exchange calls respectively.
3851         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
3852         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
3853         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
3854         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3855         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
3856         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
3857         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
3859         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
3860         returns the old value.
3862 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
3864         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
3865         int for variable OLDVAL and correct inline assembler contraint.
3866         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
3867         type int for variable OLD.
3869         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
3870         only for s390-32.
3871         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3872         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
3873         instead of multiple_threads field in the TCB.
3875 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
3877         * sysdeps/i386/i686/bits/atomic.h: Removed.
3878         * sysdeps/i386/i586/bits/atomic.h: Removed.
3879         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
3880         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
3881         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
3882         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
3883         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
3884         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
3885         * atomic.h: Removed.  Moved to glibc.
3887         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
3888         support for clock selection.
3890         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
3891         signalling waiters.
3893 2003-03-18  Roland McGrath  <roland@redhat.com>
3895         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3896         Add __lll_rel_instr first.  Add memory clobber.
3897         (lll_mutex_unlock): Use __lll_test_and_set.
3898         From Paul Mackerras <paulus@samba.org>.
3900         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
3901         unconditionally.
3902         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3903         (SINGLE_THREAD_P):  Add `header.' prefix.
3904         From Paul Mackerras <paulus@samba.org>.
3906         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
3907         pthread_timedjoin_np to ...
3908         (libpthread: GLIBC_2.3.3): ... here.
3909         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
3911         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3912         Avoid shadowing VAL variable.
3914         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3915         New macro.
3917 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
3919         * Makefile (tests): Add tst-cond11.
3920         * tst-cond11.c: New file.
3922         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
3923         struct passed to cleanup handler to eliminate one more
3924         instruction.
3925         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3927         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3928         (pthrad_cond_t): Replace __unused field with __clock.
3930         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
3931         waken all waiters in cleanup handler.
3932         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3933         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3935         * pthread_condattr_getclock.c: New file.
3936         * pthread_condattr_setclock.c: New file.
3937         * sysdeps/pthread/pthread.h: Declare these new functions.
3938         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
3939         * Makefile (libpthread-routines): Add the new functions.
3940         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
3941         Renamed field to value.  Document use of the bits.
3942         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
3943         change.
3944         * pthread_condattr_setpshared.c: Likewise.
3945         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
3946         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
3947         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3948         Add __clock field.
3949         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3950         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3951         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3952         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3953         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3954         Implement clock selection.
3955         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3956         * pthread-errnos.sym: Add ENOSYS.
3957         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3958         _POSIX_CLOCK_SELECTION.
3959         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3961         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
3962         invalid .size directive.
3964 2003-03-17  Roland McGrath  <roland@redhat.com>
3966         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3967         Formatting tweaks.
3969 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3971         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
3972         Use __lll_add instead of spelling it out.  Use protected symbol names.
3973         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
3974         Use __lll_add.
3975         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
3976         Renamed from lll_compare_and_swap.  Use new name where necessary.
3977         (__lll_add): Defined.
3978         (__lll_dec_if_positive): Defined.
3979         (__lll_test_and_set): Defined.
3980         * sysdeps/ia64/pthread_spin_init.c: Removed.
3981         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
3982         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
3983         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
3984         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
3985         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
3986         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
3987         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
3988         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
3989         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
3990         __sync_lock_release_si.
3991         Patch by Jakub Jelinek.
3993         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
3994         Fix timeout handling.
3995         (__lll_timedwait_tid): Likewise.
3996         (lll_unlock_wake_cb): Wake up other waiters if necessary.
3997         Patch by Jakub Jelinek.
3999         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
4001 2003-03-17  Roland McGrath  <roland@redhat.com>
4003         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
4004         * sysdeps/pthread/pthread_spin_init.c: New file.
4005         * sysdeps/pthread/pthread_spin_unlock.c: New file.
4006         * sysdeps/powerpc/Makefile: New file.
4007         * sysdeps/powerpc/pthread_spin_lock.c: New file.
4008         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
4009         * sysdeps/powerpc/pthreaddef.h: New file.
4010         * sysdeps/powerpc/tcb-offsets.sym: New file.
4011         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
4012         * sysdeps/powerpc/tls.h: New file.
4013         * sysdeps/powerpc/bits/atomic.h: New file.
4014         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
4015         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
4016         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
4018         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
4019         * sysdeps/unix/sysv/linux/sem_post.c: New file.
4020         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
4021         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
4022         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
4023         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
4024         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
4025         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
4026         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
4027         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
4028         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
4029         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
4030         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
4031         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
4032         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
4034         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
4035         not gettimeofday.
4036         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
4037         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4038         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
4039         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
4040         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4042 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
4044         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
4045         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4046         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4047         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4048         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
4050 2003-03-16  Roland McGrath  <roland@redhat.com>
4052         * tst-fork4.c: Include <string.h>.
4053         * tst-signal2.c: Likewise.
4054         * tst-mutex5.c (do_test): exit -> return.
4055         * tst-mutex2.c: Include <stdlib.h>.
4057 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
4059         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4060         (__lll_mutex_timedlock_wait): Correct expected value after
4061         spurious wakeup.  Otherwise we would never wait again.
4063         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
4064         zone versus inline asm stupidity.  Use correct instructions.
4066         * tst-rwlock6.c: Add some more status output.
4068 2003-03-15  Roland McGrath  <roland@redhat.com>
4070         * sysdeps/pthread/configure.in: New file.
4071         * sysdeps/pthread/configure: New file (generated).
4073 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
4075         * allocatestack.c (allocate_stack): Store the exact stack size of
4076         user allocated stacks.
4078 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
4080         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
4081         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
4082         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
4083         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
4084         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
4085         Use `header.' prefix.
4086         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
4088 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
4090         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
4091         __builtin_frame_address, use stack pointer.
4093         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
4094         instead of __builtin_frame_pointer.
4096 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
4098         * tst-basic1.c (do_test): Add cast to avoid warning.
4099         * tst-basic2.c (do_test): Likewise.
4101         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
4102         amount of stack correction.
4104         * tst-fork4.c: Use test-skeleton.c.
4106 2003-03-14  Roland McGrath  <roland@redhat.com>
4108         * init.c: Fix typo "#eli" for "#else".
4110 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
4112         * allocatestack.c (__stack_user): Use hidden_data_def.
4113         * pthread_create.c (__pthread_keys): Likewise.
4115         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
4117 2003-03-14  Roland McGrath  <roland@redhat.com>
4119         * tst-fork4.c: New file.
4120         * Makefile (tests): Add it.
4122         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
4123         we always define the padding space.
4124         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
4125         stopped supporting its own extensions fully.
4126         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
4127         struct also called `header', so `header.multiple_threads' is the field
4128         name to use on all machines.
4129         * allocatestack.c (allocate_stack): Use `header.' prefix.
4130         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4131         * pthread_create.c (__pthread_create_2_1): Likewise.
4132         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
4133         (THREAD_SELF): Likewise.
4134         * sysdeps/x86_64/tls.h: Likewise.
4135         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
4136         (SINGLE_THREAD_P): Likewise.
4137         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
4138         (SINGLE_THREAD_P): Likewise.
4139         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
4140         (SINGLE_THREAD_P): Likewise.
4142         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
4143         value directly.
4145 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
4147         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
4148         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
4150         * pthread_create.c (start_thread): setjmp is expected to return 0.
4152         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
4153         (THREAD_GETMEM_NC): Likewise.
4155 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
4157         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
4158         and the size of the stack which must be allocated is a multiple,
4159         allocate one more page.
4160         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
4161         MULTI_PAGE_ALIASING.
4163 2003-03-13  Roland McGrath  <roland@redhat.com>
4165         * pthread_create.c (start_thread): Set EXITING_BIT after the
4166         event-reporting (and destructors), not before.
4168 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
4170         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
4171         lll_futex_wake): Declare register variables as long int instead of
4172         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
4173         Make syscall arguments clobbered by the syscall.
4174         (lll_futex_wait): Define using lll_futex_timed_wait.
4176         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
4177         to void *.
4179         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
4180         PPID if [! NDEBUG].
4182         * allocatestack.c (nptl_ncreated): Only declare if
4183         COLORING_INCREMENT != 0.
4185         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
4186         (__libc_enable_asynccancel_2): Remove prototype.
4188         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
4189         ctid to match kernel.
4191 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4193         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
4194         libc_multiple_threads.
4195         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
4196         __libc_multiple_threads to...
4197         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
4199         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
4200         versioning.
4201         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4202         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4204         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
4205         (__pthread_once_internal): Define.
4207         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
4208         macros instead of .symver directly.
4209         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4210         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
4212         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
4213         * sysdeps/x86_64/tcb-offsets.sym: New file.
4214         * sysdeps/x86_64/Makefile: New file.
4216         * sysdeps/i386/tcb-offsets.sym: Add SELF.
4217         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
4218         to access own pthread_t in TCB.
4219         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4220         Likewise.
4221         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4222         Likewise.
4223         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4225 2003-03-12  Roland McGrath  <roland@redhat.com>
4227         * pthread-errnos.sym: New file.
4228         * Makefile (gen-as-const-headers): New variable, list that file.
4229         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
4230         header <pthread-errnos.h> instead of defining errno values here.
4231         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4232         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4233         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4234         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4235         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4236         Likewise.
4237         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4238         Likewise.
4239         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4240         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4241         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4242         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4243         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4244         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4245         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4246         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4247         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4248         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4249         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4250         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
4251         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
4252         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
4253         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4254         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4255         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4256         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4257         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4258         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
4259         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
4260         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
4261         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
4262         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
4263         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
4264         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4265         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4267         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
4268         CLONE_CHILD_SETTID worked.
4270 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4272         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
4273         file.
4274         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
4275         file.
4277         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4278         (pthread_cond_t): Add padding.
4280         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
4281         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
4282         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
4284         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
4285         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
4286         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
4287         (__pthread_rwlock_timedrdlock): Likewise.
4288         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
4289         (__pthread_rwlock_wrlock): Likewise.
4290         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
4291         (__pthread_rwlock_rdlock): Likewise.
4293         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
4295         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
4296         result of lock re-get if it fails.
4298 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4300         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
4301         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4302         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4303         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4304         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4305         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4306         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4307         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4308         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4309         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4311         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
4312         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
4314         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
4315         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
4316         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
4317         (create_thread): Likewise.
4318         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
4319         * init.c (__pthread_initialize_minimal_internal): Initialize
4320         __libc_multiple_threads_ptr if necessary.
4321         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
4322         __pthread_multiple_threads and __libc_multiple_threads_ptr.
4323         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
4324         __libc_multiple_threads.
4325         (__libc_pthread_init): Return pointer to __libc_pthread_init if
4326         necessary.
4328         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
4329         (THREAD_SETMEM_NC): Likewise.
4331         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
4332         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
4333         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
4334         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
4336         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
4337         Eliminate one entire instruction.
4339         * cancellation.c (__pthread_enable_asynccancel_2): New function.
4340         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
4341         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4342         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
4343         instead of __pthread_enable_asynccancel.
4344         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4345         (__pthread_cond_wait): Likewise.
4346         * sysdeps/pthread/pthread_cond_timedwait.c
4347         (__pthread_cond_timedwait): Likewise.
4348         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4350         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4351         (__condvar_cleanup): Wake up all waiters in case we got signaled
4352         after being woken up but before disabling asynchronous
4353         cancellation.
4354         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4355         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4356         (__condvar_cleanup): Likewise.
4358         * init.c (__NR_set_tid_address): If already defined, don't redefine.
4359         Make it an error if architecture has no #if case.  Add x86-64.
4361         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
4362         pt-initfini.s generation.
4364         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
4365         (TLS_INIT_TP): Fix typo.
4367 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4369         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
4370         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
4372         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
4373         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4374         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
4375         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
4376         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
4377         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4378         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4379         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4381 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4383         * sysdeps/pthread/pthread_cond_timedwait.c
4384         (__pthread_cond_timedwait): Return the result of the final
4385         locking.  If it succeeds, the regular function return value.
4387         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
4388         Return result of the final locking.
4389         * version.c (__nptl_main): Work around problems with the strange
4390         INTERNAL_SYSCALL macro on ppc32.
4391         * init.c (__pthread_initialize_minimal_internal): Unblock
4392         SIGCANCEL in case the parent blocked it.
4393         Reported by Paul Mackerras <paulus@samba.org>.
4395         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
4396         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
4397         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
4399 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4401         * sysdeps/pthread/pthread_cond_timedwait.c
4402         (__pthread_cond_timedwait): Unlock and fail if
4403         __pthread_mutex_unlock_internal failed.
4405         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
4406         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
4407         Use ARCH_CLONE.
4408         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
4409         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
4410         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
4411         ALLOCATE_STACK): New macros.
4412         (TLS_TPADJ): New macro.
4413         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
4414         (allocate_stack): Handle TLS_DTV_AT_TP and
4415         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
4416         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
4417         Don't set PD->self.
4418         * init.c [__ia64__] (__NR_set_tid_address): Define.
4420         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
4421         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
4422         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
4423         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
4424         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
4425         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
4426         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
4427         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
4428         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
4429         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
4430         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
4431         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
4432         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
4433         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
4434         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
4435         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
4436         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
4437         * sysdeps/ia64/bits/atomic.h: New file.
4438         * sysdeps/ia64/Makefile: New file.
4439         * sysdeps/ia64/pthread_spin_init.c: New file.
4440         * sysdeps/ia64/pthread_spin_lock.c: New file.
4441         * sysdeps/ia64/pthread_spin_trylock.c: New file.
4442         * sysdeps/ia64/pthread_spin_unlock.c: New file.
4443         * sysdeps/ia64/pthreaddef.h: New file.
4444         * sysdeps/ia64/tcb-offsets.sym: New file.
4445         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
4446         * sysdeps/ia64/tls.h: New file.
4448         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
4449         to syscall instead of no arguments.
4451 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
4453         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
4454         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
4455         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
4456         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
4458         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
4459         unused code.
4461         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
4463         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4464         lowlevelbarrier.sym.
4465         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
4466         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
4467         Include lowlevelbarrier.h and don't define offsets locally.
4468         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
4470         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
4471         (__lll_mutex_lock_wait): Reverse order of first two parameters.
4472         (__lll_mutex_timedlock_wait): Likewise.
4473         (lll_mutex_lock): Adjust asm for that.
4474         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
4475         (lll_lock): Adjust asm for operand order change.
4476         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
4477         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
4479         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
4480         Reverse order of parameters.
4481         (__lll_timedwait_tid): Remove regparms attribute.
4482         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
4483         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
4485         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4486         (__lll_timedwait_tid): Remove one unnecessary instruction.
4488         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
4489         __lll_mutex_timedlock_wait only for NOT_IN_libc.
4490         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
4491         lowlevelmutex.S.
4493         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
4494         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
4495         for NOT_IN_libc.
4496         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
4497         lowlevellock.S.
4499         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
4500         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
4501         for libc.so.
4502         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
4503         define LOCK here (if UP is not defined).  The actual code is in
4504         lowlevelmutex.S.
4506         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
4507         LOCK is already defined.  Don't define lll_unlock_wake_cb and
4508         __lll_timedwait_tid for libc.so.
4509         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
4510         define LOCK here (if UP is not defined).  The actual code is in
4511         lowlevellock.S.
4513         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
4514         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
4515         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
4516         instead of lowlevelsem.h.
4517         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4518         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4519         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4521         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4522         lowlevelrwlock.sym.
4523         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
4524         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
4525         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
4527         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
4528         register loading.
4529         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
4530         last changed.  D'oh.
4532         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
4534         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
4535         of __libc_locking_needed.
4536         (lll_trylock): Initialize %eax to zero.
4538         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
4539         pthread_cond_t definition.
4541 2003-03-10  Roland McGrath  <roland@redhat.com>
4543         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
4544         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
4545         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
4546         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
4547         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
4549         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
4550         Instead of setting PD->multiple_threads, set globals
4551         __pthread_multiple_threads and __libc_multiple_threads.
4552         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4553         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
4554         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
4556         * descr.h (struct pthread): Conditionalize first member on
4557         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
4558         containing an anonymous tcbhead_t.  Move `list' member out.
4559         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
4560         * allocatestack.c: Remove use of `header.data.' prefix.
4561         * pthread_create.c: Likewise.
4562         * init.c (__pthread_initialize_minimal_internal): Likewise.
4563         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4564         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
4565         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
4566         * sysdeps/x86_64/tls.h: Likewise.
4567         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
4568         (SINGLE_THREAD_P): Likewise.
4569         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
4570         (SINGLE_THREAD_P): Likewise.
4571         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
4572         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
4574 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
4576         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
4578         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
4579         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4581         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
4582         leftovers from the ia32 code.
4584         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
4585         memory load.
4586         (clear_once_control): Don't load %esi.
4588         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
4589         handling.
4591         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4593         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
4594         * sysdeps/unix/sysv/linux/createthread.c: ...here.
4596         * Makefile (tests): Add tst-cond10.
4597         * tst-cond10.c: New file.
4599 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
4601         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
4602         * tst-signal3.c (do_test): Likewise.
4603         * tst-sem5.c (do_test): Likewise.
4604         * tst-kill6.c (do_test): Likewise.
4605         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
4607         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
4608         of inc/dec.
4609         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
4610         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
4611         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4612         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4613         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4614         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4615         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4616         Likewise.
4617         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4618         Likewise.
4619         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4620         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4621         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4622         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4623         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4624         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
4625         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4626         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4628         * allocatestack.c (allocate_stack): If mprotect() fails free the
4629         TLS memory.
4631 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
4633         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
4635         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
4636         lll_wake_tid.  This was used only to work around kernel limits in
4637         the early days.
4638         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
4639         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
4640         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
4641         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
4643         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
4644         (__pthread_initialize_minimal_internal): Change initialization of
4645         __static_tls_align_m1 appropriately.
4646         * pthreadP.h (__static_tls_align_m1): Renamed from
4647         __static_tls_align.
4648         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
4649         instead of __static_tls_align-1.
4651 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
4653         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
4655         * pthread_create.c: Define __pthread_keys using nocommon
4656         attribute, not by placing it explicitly in bss.
4657         Remove DEFINE_DEALLOC definition.  Not needed anymore.
4659         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
4660         Use it in mmap call to allocate stacks.
4662         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
4664         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
4665         result of the thread function.
4667 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
4669         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
4670         version is just fine.
4672         * sysdeps/unix/sysv/linux/libc_pthread_init.c
4673         (__pthread_child_handler): Renamed from pthread_child_handler,
4674         exported, and marked hidden.  Change all users.
4675         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
4676         free __pthread_child_handler from child list.
4678 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4680         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
4682         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4683         Fix handling of cancellation and failing pthread_mutex_unlock call.
4684         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4685         (__pthread_cond_wait): Likewise.
4687         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4688         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
4689         lll_futex_timed_wait call.
4690         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4691         (pthread_rwlock_timedwrlock): Likewise.
4693         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
4694         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
4695         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
4697         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
4698         check of lll_futex_wake return value.
4700 2003-03-03  Roland McGrath  <roland@redhat.com>
4702         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
4704         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4705         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
4706         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
4708 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
4710         * sysdeps/pthread/timer_create.c (timer_create): Return correct
4711         error for CPU clocks.
4713         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4714         _POSIX_MONOTONIC_CLOCK.
4715         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4717         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
4718         recent kernels.
4720 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
4722         * descr.h (struct pthread): Move cleanup field to the front.
4724 2003-03-01  Roland McGrath  <roland@redhat.com>
4726         * sem_open.c (sem_open): Braino fix.
4728 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
4730         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
4731         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
4732         __pthread_cleanup_pop functionality.
4733         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4735         * descr.h (struct pthread): Move tid field to the front now that
4736         it is often used.
4738         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
4739         (__lll_mutex_timedlock_wait): Remove.
4740         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
4741         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4742         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
4743         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4744         (lll_unlock_wake_cb): Don't save and restore %esi.
4745         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
4746         %esi.
4747         (__lll_timedwait_tid): Add alignment.
4748         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
4749         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
4750         %esi.
4751         (__lll_timedwait_tid): Removed.
4752         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
4753         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
4754         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4755         (pthread_barrier_wait): Don't save, load, and restore %esi for
4756         last thread.
4757         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4758         (__pthread_cond_signal): Don't save, load, and restore %esi.
4759         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
4760         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
4761         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4762         Don't save, load, and restore %esi.
4764 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
4766         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
4767         Release lock before waking up the waiters.
4769         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
4771         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
4772         (reader_thread): Likewise.
4774         * sysdeps/pthread/pthread_rwlock_unlock.c
4775         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
4776         to wake up readers if there are none.
4778         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
4779         Release internal lock before wake threads.
4781 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
4783         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
4784         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
4785         predefined.
4786         * tst-rwlock9.c: Likewise.
4787         * tst-rwlock10.c: New file.
4788         * tst-rwlock11.c: New file.
4790         * Makefile (tests): Add tst-dlsym1.
4791         * tst-dlsym1.c: New file.
4793         * init.c (__pthread_initialize_minimal_internal): Set
4794         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
4795         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
4797 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
4799         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
4801         * tst-cond2.c: Fix sychronization with child.
4803         * tst-rwlock8.c (reader_thread): Remove unused variable.
4805         * Makefile: Add rules to build and run tst-tls3.
4806         * tst-tls3.c: New file.
4807         * tst-tls3mod.c: New file.
4809         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
4810         * tst-rwlock8.c: New file.
4811         * tst-rwlock9.c: New file.
4812         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
4813         complete broken rwlock implementation.
4814         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4815         Likewise.
4816         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4817         Likewise.
4818         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4819         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4820         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
4821         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4822         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4823         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
4824         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4826 2003-02-23  Roland McGrath  <roland@redhat.com>
4828         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
4830 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
4832         * Makefile (tests): Add tst-context1.
4833         * tst-context1.c: New file.
4835         * Makefile (tests): Add tst-tls1 and tst-tls2.
4836         * tst-tls1.c: New file.
4837         * tst-tls2.c: New file.
4839         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
4840         for failed cmpxchg.
4842         * pthread_create.c (start_thread): Set EXITING_BIT early.
4844         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
4845         (THREAD_GETMEM_NC): Likewise.
4847 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
4849         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
4850         off 3 more bytes by using offset-less instructions when possible.
4852         * Makefile: Add dependency for $(objpfx)version.d.
4854         * eintr.c (eintr_source): Add unnecessary return but the compiler
4855         insists.
4857         * tst-kill3.c: Include <unistd.h>.
4859 2003-02-21  Roland McGrath  <roland@redhat.com>
4861         * pthread_create.c (start_thread): Call __libc_thread_freeres.
4863 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
4865         * Makefile (tests): Add tst-eintr1.
4866         (distribute): Add eintr.c.
4867         * tst-eintr1.c: New file.
4868         * eintr.c: New file.
4870         * pthread_cancel.c (pthread_cancel): Use tkill directly.
4872         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
4873         Disallow sending SIGCANCEL.
4875         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
4876         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
4877         * tst-kill1.c: New file.
4878         * tst-kill2.c: New file.
4879         * tst-kill3.c: New file.
4880         * tst-kill5.c: New file.
4881         * tst-kill6.c: New file.
4882         * tst-basic7.c: Renamed to...
4883         * tst-kill4.c: ...this.
4885 2003-02-21  Roland McGrath  <roland@redhat.com>
4887         * Makefile (install-lib-ldscripts): New variable.
4889 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
4891         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
4892         * pthread_cancel.c: Use INVALID_TD_P.
4893         * pthread_detach.c: Likewise.
4894         * pthread_getschedparam.c: Likewise.
4895         * pthread_setschedparam.c: Likewise.
4896         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
4897         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
4898         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
4899         * pthread_timedjoin.c: Likewise.
4901         * tst-basic7.c: Include <signal.h>.
4903         * pthread_join.c (pthread_join): Limited checking for invalid
4904         descriptors.
4905         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
4907 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
4909         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
4910         beginning of the loop.  Clear the entire first block of TSD.
4911         * Makefile (tests): Add tst-key4.
4912         * tst-key4.c: New file.
4914 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
4916         * Makefile (tests): Add tst-basic7.
4917         * tst-basic7.c: New file.
4919         * pthread_create.c (deallocate_tsd): Mark as internal_function.
4920         Add some more __builtin_expect.
4922         * pthreadP.h: Define dummy version of DEBUGGING_P.
4924 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
4926         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
4927         _POSIX_THREAD_PRIORITY_SCHEDULING.
4928         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
4929         _XOPEN_REALTIME_THREADS.
4930         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4932         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
4933         kernel returns EINVAL for PID <= 0, work around it.
4935         * Makefile (tests): Add tst-signal5.
4936         * tst-signal5.c: New file.
4938         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
4939         and LOGIN_NAME_MAX.
4941         * tst-cancel1.c (tf): Block all signals.
4943         * Makefile (tests): Add tst-basic6.
4944         * tst-basic6.c: New file.
4946         * tst-basic1.c: Add test for process ID.
4948         * Makefile (tests): Add tst-cancel10.
4949         * tst-cancel10.c: New file.
4951         * Makefile (tests): Add tst-signal4.
4952         * tst-signal4.c: New file.
4954         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
4955         __sigismember instead of sigismember.  Add __builtin_expect.
4957 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
4959         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
4960         pthread_setcancelstate, and pthread_rwlock_setpshared.
4962         * tst-cancel7.c (do_test): Make sure the pid file exists before
4963         canceling the thread.
4965         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
4966         pthread_rwlock_timedrdlock tests.
4967         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
4968         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4969         Check for invalid tv_nsec field.
4970         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4971         Likewise.
4973         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
4974         recursive mutex of overflow.
4976         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
4978         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
4979         going into an endless loop.
4980         * Makefile (tests): Add tst-cancel9.
4981         * tst-cancel9.c: New file.
4983         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
4985 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
4987         * tst-mutex5.c (do_test): Add more timedlock tests.
4989         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
4990         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
4992         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4993         use INLINE_SYSCALL.  Error number is returned, not -1.
4995         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
4996         and __deallocate_stack with internal_function.
4997         * pthread_create.c: Adjust definitions appropriately.
4998         * allocatestack.c: Likewise.
5000         * pthread_join.c: Add one more __builtin_expect.
5001         * pthread_timedjoin.c: Likewise.
5003         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
5004         not data of sequence number does not match.
5005         Add one __builtin_expect.
5007         * Makefile (tests): Add tst-clock1.
5008         * tst-clock1.c: New file.
5010         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
5011         negative arguments.
5012         * Makefile (tests): Add tst-basic5.
5013         * tst-basic5.c: New file.
5015 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
5017         * Makefile (tests): Add tst-basic4.
5018         * tst-basic4.c: New file.
5020         * pthreadP.h: Add declaraction for __nptl_nthreads.
5021         * pthread_create.c: Define __nptl_nthreads
5022         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
5023         after thread is done.  If then zero, call exit(0).
5024         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5025         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
5026         * init.c (pthread_functions): Initialize ptr_nthreads.
5027         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
5028         (__reclaim_stacks): Decrement __nptl_nthreads.
5029         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
5030         Define.
5031         * Makefile (tests): Add tst-basic3.
5032         * tst-basic3.c: New file.
5034         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
5035         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
5036         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
5037         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
5038         if asynchronous canceling is enabled.
5039         * pthread_join.c (pthread_join): When recognizing circular joins,
5040         take into account the other thread might be already canceled.
5041         * Makefile (tests): Add tst-join5.
5042         * tst-join5.c: New file.
5044         * Makefile (tests): Add tst-join4.
5045         * tst-join4.c: New file.
5047 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
5049         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
5051 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5053         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
5054         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
5055         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
5056         warning.
5057         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
5058         to avoid warning.
5059         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
5060         error if lll_futex_wake failed.
5062 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
5064         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
5065         handling of cancellation and failung pthread_mutex_unlock call.
5066         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5067         * Makefile (tests): Add tst-cond8 and tst-cond9.
5068         * tst-cond8.c: New file.
5069         * tst-cond9.c: New file.
5071         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
5073         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
5074         non-standard initializers with __USE_GNU.
5076         * Makefile (tests): Add tst-cleanup3.
5077         * tst-cleanup3.c: New file.
5079 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
5081         * Makefile (tests): Add tst-attr1 and tst-attr2.
5082         * tst-attr1.c: New file.
5083         * tst-attr2.c: New file.
5085         * Makefile: Add rules to build and run tst-atfork2 test.
5086         * tst-atfork2.c: New file.
5087         * tst-atfork2mod.c: New file.
5089         * sysdeps/unix/sysv/linux/unregister-atfork.c
5090         (__unregister_atfork): Free the memory allocated for the handlers
5091         after removing them from the lists.
5093         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
5094         cleanup function.
5096         * tst-atfork1.c (do_test): Wait for the child we forked.
5097         Report error in child.
5099         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
5101         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
5103 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
5105         * Makefile (tests): Add tst-cancel8.
5106         * tst-cancel8.c: New file.
5108         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
5109         clearing of control variable.
5110         * Makefile (tests): Add tst-once3 and tst-once4.
5111         * tst-once3.c: New file.
5112         * tst-once4.c: New file.
5114 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
5116         * sysdeps/sh/Makefile: New file.
5117         * sysdeps/sh/bits/atomic.h: New file.
5118         * sysdeps/sh/pthread_spin_init.c: New file.
5119         * sysdeps/sh/pthread_spin_lock.c: New file.
5120         * sysdeps/sh/pthread_spin_trylock.S: New file.
5121         * sysdeps/sh/pthread_spin_unlock.S: New file.
5122         * sysdeps/sh/pthreaddef.h: New file.
5123         * sysdeps/sh/tcb-offsets.sym: New file.
5124         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
5125         * sysdeps/sh/tls.h: New file.
5126         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
5127         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
5128         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
5129         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
5130         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
5131         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
5132         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
5133         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
5134         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
5135         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
5136         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
5137         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
5138         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
5139         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
5140         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
5141         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
5142         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
5143         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
5144         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
5145         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
5146         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
5147         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
5148         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
5149         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
5150         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
5151         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
5152         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
5153         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
5154         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
5155         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
5157 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
5159         * tst-cond2.c: Rearrange code to not rely on behavior undefined
5160         according to POSIX.
5162         * tst-basic2.c (do_test): Lock mutex before creating the thread.
5164 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
5166         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
5167         (TLS_GET_FS): New #define.
5168         (TLS_SET_FS): New #define.
5169         Correct value of __NR_set_thread_area.
5171         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
5173 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
5175         * Makefile (tests): Add tst-popen1.
5176         * tst-popen1.c: New file.
5178         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
5179         but inactive generalization.
5180         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5181         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5182         Minor optimization, remove one instruction.
5183         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5185 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5187         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
5189 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5191         * init.c (__NR_set_tid_address): Add #ifdef for s390.
5192         * sysdeps/pthread/pthread_barrier_wait.c: New file.
5193         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
5194         * sysdeps/pthread/pthread_cond_signal.c: New file.
5195         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
5196         * sysdeps/pthread/pthread_cond_wait.c: New file.
5197         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
5198         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
5199         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
5200         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
5201         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
5202         * sysdeps/s390/Makefile: New file.
5203         * sysdeps/s390/bits/atomic.h: New file.
5204         * sysdeps/s390/pthread_spin_init.c: New file.
5205         * sysdeps/s390/pthread_spin_lock.c: New file.
5206         * sysdeps/s390/pthread_spin_trylock.c: New file.
5207         * sysdeps/s390/pthread_spin_unlock.c: New file.
5208         * sysdeps/s390/pthreaddef.h: New file.
5209         * sysdeps/s390/tcb-offsets.sym: New file.
5210         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
5211         * sysdeps/s390/tls.h: New file.
5212         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
5213         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
5214         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
5215         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
5216         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
5217         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
5218         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5219         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
5220         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
5221         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
5222         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
5223         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
5224         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
5225         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
5226         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
5227         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
5228         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
5229         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
5230         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
5231         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
5232         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
5233         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5234         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
5236 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
5238         * atomic.h: Add a couple more default implementations.
5239         (atomic_compare_and_exchange_acq): Use
5240         __arch_compare_and_exchange_32_acq in return value definition.  It
5241         always exists.
5242         (atomic_bit_set): Renamed from atomic_set_bit.
5243         Add missing atomic_ prefixes.
5245         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
5246         thread library is available, use correct value to mark initialized
5247         once variable.
5249 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
5251         * allocatestack.c (allocate_stack): Use __getpagesize instead of
5252         __sysconf to determine pagesize.
5254         * pthread_create.c: Include <atomic.h>.
5255         * allocatestack.c (allocate_stack): Implement coloring of the
5256         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
5257         size minus one.  Adjust users.
5258         * sysdeps/i386/i686/Makefile: New file.
5260 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
5262         * allocatestack.c: Improve comment throughout the file.
5264         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5265         (__lll_lock_wait): Add branch prediction.
5266         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
5267         (__lll_lock_wait): Likewise.
5268         (lll_unlock_wake_cb): Removed.
5270 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
5272         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
5273         _POSIX_THREAD_PRIORITY_SCHEDULING.
5275 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
5277         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5278         Fix return type of ptr___pthread_getspecific.
5280 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
5282         * Makefile (tests): Add tst-umask1.
5283         (tst-umask1-ARGS): Define.
5284         * tst-umask1.c: New file.
5286 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
5288         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
5289         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
5290         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
5291         pthread_rwlock_unlock.
5292         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
5293         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
5294         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
5295         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
5296         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5297         New file.
5298         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
5299         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5300         New file.
5301         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
5302         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
5303         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
5304         New file.
5305         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
5306         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
5307         New file.
5308         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
5309         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
5310         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
5311         New file.
5312         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
5313         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
5314         New file.
5315         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
5317         * Makefile (libpthread-routines): Remove lowlevelcond and
5318         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
5319         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
5320         and pthread_cond_broadcast.
5321         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
5322         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
5323         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
5324         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
5325         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
5326         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
5327         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
5328         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
5329         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
5330         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
5331         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
5332         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
5333         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
5334         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
5335         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
5336         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
5337         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
5338         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
5339         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
5340         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
5341         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
5342         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
5343         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
5344         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
5345         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
5346         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
5347         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
5348         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
5349         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
5350         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
5351         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
5353         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
5354         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
5355         of the code is moved to ...
5356         * sysdeps/pthread/createthread.c: ...here.  New file.
5358 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
5360         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
5361         (__new_sem_post): Clear %eax before returning.
5362         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
5364         * Makefile (tests): Add tst-cleanup2.
5365         * tst-cleanup2.c: New file.
5367         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
5368         Interpret first parameter correctly.
5370 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
5372         * Makefile (headers): Add bits/semaphore.h.
5374 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
5376         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
5377         if not SHARED.
5379 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
5381         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
5382         must be used and mapping failed.
5383         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
5385         * Makefile (CFLAGS-pthread_self.os): Define this, not
5386         CFLAGS-pthread_self.c.
5388 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5390         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
5391         lll_unlock_wake_cb.
5393         * Makefile (libpthread-routines): Add version.  Add rules to build
5394         version.os and banner.h.
5395         * version.c: New file.
5397 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
5399         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
5400         the alias unconditional.
5401         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
5403 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5405         * Makefile (CFLAGS-pthread_self.c): New definition.
5407 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5409         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
5410         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
5411         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
5412         * init.c (__pthread_initialize_minimal_internal): Likewise.
5414 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
5416         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
5418         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
5419         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5420         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5421         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
5422         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5423         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5425 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5427         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
5428         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
5429         * tst-cancel-wrappers.sh: Remove all exceptions.
5431 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
5433         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
5434         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
5436         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
5437         Use __libc_pthread_functions array if SHARED.
5439         * pthreadP.h: Move pthread_cond_2_0_t definition to...
5440         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
5442         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
5443         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
5444         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
5445         __libc_ptf_call instead of __libc_maybe_call.
5446         (PTF): New #define.
5447         (__libc_cleanup_region_start): Wrap function name with PTF call.
5448         (__libc_cleanup_region_end): Likewise.
5449         (__libc_cleanup_end): Likewise.
5451         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
5452         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
5453         * pthread_key_create.c: Add __pthread_key_create_internal alias.
5454         * pthreadP.h: Add prototypes.
5456         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
5457         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
5458         __pthread_rwlock_unlock aliases.
5459         * pthreadP.h: Add prototypes for new aliases.
5461         * pthreadP.h (struct pthead_functions): Moved to...
5462         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
5463         * init.c (pthread_functions): Add initializers for new elements.
5465         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
5466         __pthread_cleanup_pop_restore aliases.
5467         * pthreadP.h: Add prototypes.
5469         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
5470         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
5471         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
5472         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
5473         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5474         * pthreadP.h: Adjust prototypes and callers.
5476 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
5478         * Makefile (tests): Add tst-cancel7.
5479         (tst-cancel7-ARGS): New variable.
5480         * tst-cancel7.c: New file.
5482         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
5483         around gcc defficiencies.
5484         * old_pthread_cond_signal.c: Likewise.
5485         * old_pthread_cond_timedwait.c: Likewise.
5486         * old_pthread_cond_wait.c: Likewise.
5488         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
5490 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5492         * Makefile (tests): Add tst-cond7.
5493         * tst-cond7.c: New file.
5495         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5496         (condvar_cleanup): Get condvar address from the right place.
5498         * atomic.h: Correct definitions of atomic_full_barrier,
5499         atomic_read_barrier, atomic_write_barrier.
5501         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
5502         race-free.
5503         * old_pthread_cond_signal.c: Likewise.
5504         * old_pthread_cond_timedwait.c: Likewise.
5505         * old_pthread_cond_wait.c: Likewise.
5507 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
5509         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
5511 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5513         * pthreadP.h (pthread_cond_2_0_t): New type.
5514         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
5515         Use new type for the 2.0 condvar function prototypes.
5516         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
5517         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
5518         parameter.
5519         * old_pthread_cond_destroy.c: Likewise.
5520         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
5521         * old_pthread_cond_signal.c: Likewise.
5522         * old_pthread_cond_timedwait.c: Likewise.
5523         * old_pthread_cond_wait.c: Likewise.
5525         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5526         (__pthread_cond_wait): Don't save cancellation mode and seq value
5527         in same location.
5529         * herrno.c (__h_errno_location): Don't define as weak.
5531 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5533         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
5534         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
5535         and pthread_cond_wait.
5536         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
5537         Renamed to...
5538         (__pthread_cond_broadcast_2_0): ... this.
5539         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
5540         Renamed to...
5541         (__pthread_cond_destroy_2_0): ... this.
5542         * old_pthread_cond_init.c (__old_pthread_cond_init):
5543         Renamed to...
5544         (__pthread_cond_init_2_0): ... this.
5545         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
5546         Renamed to...
5547         (__pthread_cond_signal_2_0): ... this.
5548         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
5549         Renamed to...
5550         (__pthread_cond_wait_2_0): ... this.
5551         * pthread_cond_destroy.c: Include shlib-compat.h.
5552         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
5553         * pthread_cond_init.c: Include shlib-compat.h.
5554         (pthread_cond_init): Change strong_alias into versioned_symbol.
5555         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
5556         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
5557         fields.
5558         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
5559         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
5560         __pthread_cond_wait_2_0): New prototypes.
5561         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
5562         __old_pthread_cond_init, __old_pthread_cond_signal,
5563         __old_pthread_cond_wait): Removed.
5564         * init.c: Include shlib-compat.h.
5565         (pthread_functions): Guard ptr___pthread_attr_init_2_0
5566         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
5567         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
5568         ptr___pthread_cond_*_2_0 fields.
5569         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
5570         pthread_cond_*@GLIBC_2.0 compatibility symbols.
5572         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
5573         LIBC_SIGACTION was not yet defined.
5574         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
5575         [!defined LIBC_SIGACTION] (__sigaction): New function and
5576         libc_hidden_weak.
5577         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
5578         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
5580 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5582         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
5584 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
5586         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5587         New, larger type definition.
5588         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
5589         implementation.
5590         * Versions [libpthread]: Add definitions for new pthread_cond_*
5591         interfaces for version GLIBC_2.3.2.
5592         * pthread_cond_init.c: Update initialization for new type definition.
5593         * Makefile (libpthread-routines): Remove pthread_cond_wait,
5594         pthread_cond_timedwait, pthread_cond_signal, and
5595         pthread_cond_broadcast.  Add old_pthread_cond_init,
5596         old_pthread_cond_destroy, old_pthread_cond_wait,
5597         old_pthread_cond_timedwait, old_pthread_cond_signal, and
5598         old_pthread_cond_broadcast.
5599         * old_pthread_cond_broadcast.c: New file.
5600         * old_pthread_cond_destroy.c: New file.
5601         * old_pthread_cond_init.c: New file.
5602         * old_pthread_cond_signal.c: New file.
5603         * old_pthread_cond_timedwait.c: New file.
5604         * old_pthread_cond_wait.c: New file.
5605         * pthreadP.h: Add prototypes for the compatibility interfaces.
5607         * pthread_cond_destroy.c: Don't include <errno.h>.
5609 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
5611         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
5612         unnecessary zero offset when addressing MUTEX.
5614 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
5616         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
5617         __register_atfork.
5618         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
5619         for __register_atfork.
5621 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
5623         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
5624         instead of ASSEMBLER test macro.
5626         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
5627         __libc_current_sigrtmax): Add libc_hidden_def.
5629         * sysdeps/pthread/list.h: Remove assert.h include.
5631 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
5633         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
5634         __pthread_initialize_minimal_internal not
5635         __pthread_initialize_minimal.
5637 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
5639         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
5640         __pthread_initialize_minimal as hidden.
5642         * init.c (__pthread_initialize_minimal_internal): Don't mark as
5643         constructor.
5645 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
5647         * Makefile ($(inst_libdir)/libpthread.so): Depend on
5648         $(common-objpfx)format.lds, include that into the output script.
5649         Fix comment.
5650         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
5652 2002-12-28  Andreas Jaeger  <aj@suse.de>
5654         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
5655         nsec resolution changes.
5656         (xstat64_conv): Likewise.
5657         (xstat32_conv): Likewise.
5658         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
5659         struct kernel_stat.
5660         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
5661         structs stat and stat64.
5662         * time/time.h (__timespec_defined): Define for __USE_MISC.
5663         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
5665 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
5667         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
5668         argument.
5669         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
5670         (pthread_exit): Use strong_alias to avoid warnings.
5671         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
5672         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
5673         ptr___pthread_attr_init_2_*.
5674         * init.c (pthread_functions): Adjust.
5676 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
5678         * forward.c: Make all functions available by default again.  It
5679         caused too much trouble.
5681         * pt-siglongjmp.c: Removed.
5683 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
5685         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
5686         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
5687         * sysdeps/i386/Makefile: New file.
5688         * sysdeps/i386/tcb-offsets.sym: New file.
5689         * sysdeps/pthread/tcb-offsets.h: New file.
5690         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5691         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
5693         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
5694         __register_atfork...
5695         (GLIBC_2.3.2): ...here.
5697 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
5699         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
5700         pthread_attr_setstackaddr with __attribute_deprecated__.
5702 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
5704         * pt-system.c (system): Remove cancellation handling.
5705         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
5706         cancellation routines.
5708 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
5710         * descr.h: Include <dl-sysdep.h>.
5711         (struct pthread): Move header.data.list to the back of the struct.
5712         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
5713         (MULTIPLE_THREADS_OFFSET): Adjust offset.
5714         (SYSINFO_OFFSEET): Likewise.
5716 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
5718         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
5719         Define.
5720         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
5721         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
5722         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
5723         (USE_DL_SYSINFO): Undef.
5725 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
5727         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
5728         $(common-objpfx)libc.so.
5729         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
5730         it is bigger than pipe buffer size even on arches with bigger
5731         page size.
5732         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
5734 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
5736         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
5737         correct errno access for case that USE___THREAD is not defined.
5739 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
5741         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
5742         Patch by Marijn Ros <marijn@mad.scientist.com>.
5744 2002-12-22  Roland McGrath  <roland@redhat.com>
5746         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
5748 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
5750         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
5752 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
5754         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
5755         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
5756         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
5758         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
5759         of int $0x80.
5760         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
5761         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
5762         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
5763         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5764         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5765         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
5766         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
5767         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
5769         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
5770         sysenter.
5771         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
5773         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
5775         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
5776         in new TCB.
5777         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
5778         that sysinfo is properly initialized.
5779         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
5780         to 1 only for ld.so.
5782         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
5783         RTLD_CORRECT_DYNAMIC_WEAK.
5785 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
5787         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
5788         Use return 0 as 6th argument to FORWARD4.
5789         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
5791 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
5793         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
5794         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
5795         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
5796         (INIT_SYSINFO): New #define.
5797         (TLS_TP_INIT): Use INIT_SYSINFO.
5798         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5799         At test to make sure SYSINFO_OFFSET value is correct.
5800         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
5802 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
5804         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
5805         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
5806         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
5807         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
5808         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
5809         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
5810         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
5812 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
5814         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
5815         macro instead of using int $0x80 directly.
5817         * sysdeps/pthread/bits/stdio-lock.h: New file.
5818         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
5819         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
5820         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
5821         * Makefile (routines): Add libc-lowlevelmutex.
5823         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
5824         __i686.get_pc_thunk.dx.
5826 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
5828         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
5829         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
5830         ($(objpfx)tst-cancel-wrappers.out): New rule.
5831         * tst-cancel-wrappers.sh: New test.
5832         * tst-locale1.c: Include signal.h.
5833         (uselocale): Test static linking of __libc_current_sigrt*.
5835 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
5837         * Makefile (tests): Add tst-cancel6.
5838         * tst-cancel6.c: New file
5840 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
5842         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
5843         Define meaningfully for assembler as well.
5844         * pthreadP.h (struct pthread_functions): Remove
5845         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
5846         and ptr_pthread_attr_init_2_1 fields.
5847         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
5848         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
5849         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
5850         (FORWARD3): Define using FORWARD4.
5851         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
5852         versions.
5853         * pt-system.c: Remove duplicate stdlib.h include.
5855 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
5857         * sem_init.c: Define sem_init@GLIBC_2.0.
5858         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
5859         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
5861         * flockfile.c: Moved to...
5862         * sysdeps/pthread/flockfile.c: ...here.  New file.
5863         * funlockfile.c: Moved to...
5864         * sysdeps/pthread/funlockfile.c: ...here.  New file.
5865         * ftrylockfile.c: Moved to...
5866         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
5868 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
5870         * libc-cancellation.c: Guard both function with
5871         #if !defined NOT_IN_libc.
5872         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
5873         automatically provided pthread wrappers.
5874         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
5875         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
5876         nor in libpthread.
5877         * pt-open.c: Removed.
5878         * pt-fcntl.c: Removed.
5879         * pt-fsync.c: Removed.
5880         * pt-lseek.c: Removed.
5881         * pt-msgrcv.c: Removed.
5882         * pt-msgsnd.c: Removed.
5883         * pt-msync.c: Removed.
5884         * pt-nanosleep.c: Removed.
5885         * pt-open64.c: Removed.
5886         * pt-pause.c: Removed.
5887         * pt-pread.c: Removed.
5888         * pt-pread64.c: Removed.
5889         * pt-pwrite.c: Removed.
5890         * pt-pwrite64.c: Removed.
5891         * pt-read.c: Removed.
5892         * pt-recv.c: Removed.
5893         * pt-recvfrom.c: Removed.
5894         * pt-recvmsg.c: Removed.
5895         * pt-send.c: Removed.
5896         * pt-sendto.c: Removed.
5897         * pt-sigtimedwait.c: Removed.
5898         * pt-sigwait.c: Removed.
5899         * pt-wait.c: Removed.
5900         * pt-waitpid.c: Removed.
5901         * pt-write.c: Removed.
5902         * pt-accept.c: Removed.
5903         * pt-close.c: Removed.
5904         * pt-connect.c: Removed.
5905         * pt-lseek64.c: Removed.
5906         * pt-sendmsg.c: Removed.
5907         * pt-tcdrain.c: Removed.
5909 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
5911         * init.c (__pthread_initialize_minimal_internal): Renamed from
5912         __pthread_initialize_minimal.  Make old name an alias.  This
5913         converts a normal relocation into a relative relocation.
5915         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
5917         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
5918         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
5919         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
5920         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
5921         pt-sigwaitinfo, pt-waitid, and pt-writev.
5922         * pt-creat.c: Removed.
5923         * pt-poll.c: Removed.
5924         * pt-pselect.c: Removed.
5925         * pt-readv.c: Removed.
5926         * pt-select.c: Removed.
5927         * pt-sigpause.c: Removed.
5928         * pt-sigsuspend.c: Removed.
5929         * pt-sigwaitinfo.c: Removed.
5930         * pt-waitid.c: Removed.
5931         * pt-writev.c: Removed.
5933         * init.c (pthread_functions): New variable.
5934         (__pthread_initialize_minimal): Pass pointer to pthread_functions
5935         (or NULL) to __libc_pthread_init.
5936         * forward.c: Rewrite to use __libc:pthread_functions array to get
5937         function addresses.
5938         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
5939         prototype.
5940         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5941         Take new parameter.  Copy content of variable pointed to by it
5942         to __libc_pthread_init.
5944         * pthreadP.h (struct pthread_functions): New type.
5945         (__libc_pthread_init): Declare.
5947         * pthread_attr_destroy.c: Add namespace protected alias.
5948         * pthread_attr_getdetachstate.c: Likewise.
5949         * pthread_attr_getinheritsched.c: Likewise.
5950         * pthread_attr_getschedparam.c: Likewise.
5951         * pthread_attr_getschedpolicy.c: Likewise.
5952         * pthread_attr_getscope.c: Likewise.
5953         * pthread_attr_setdetachstate.c: Likewise.
5954         * pthread_attr_setinheritsched.c: Likewise.
5955         * pthread_attr_setschedparam.c: Likewise.
5956         * pthread_attr_setschedpolicy.c: Likewise.
5957         * pthread_attr_setscope.c: Likewise.
5958         * pthread_cond_broadcast.c: Likewise.
5959         * pthread_cond_destroy.c: Likewise.
5960         * pthread_cond_init.c: Likewise.
5961         * pthread_cond_signal.c: Likewise.
5962         * pthread_cond_wait.c: Likewise.
5963         * pthread_condattr_destroy.c: Likewise.
5964         * pthread_condattr_init.c: Likewise.
5965         * pthread_equal.c: Likewise.
5966         * pthread_exit.c: Likewise.
5967         * pthread_getschedparam.c: Likewise.
5968         * pthread_self.c: Likewise.
5969         * pthread_setcancelstate.c: Likewise.
5970         * pthread_setschedparam.c: Likewise.
5971         * pthread_mutex_destroy.c: Likewise.
5972         * pthread_mutex_init.c: Likewise.
5973         * pthreadP.h: Add prototypes for the aliases.
5975         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
5976         multiple_threads member in correct TCB to 1.
5978         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
5979         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
5980         member of thread decriptor, otherwise return unconditionally 1.
5982 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
5984         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
5985         regular Linux version.  Remove file.
5986         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
5987         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
5988         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
5989         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
5990         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
5991         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
5992         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
5993         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
5994         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
5995         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
5996         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
5997         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
5998         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
5999         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
6000         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
6001         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
6002         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
6003         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
6004         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
6005         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
6006         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
6007         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
6008         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
6009         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
6010         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
6011         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
6012         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
6013         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
6014         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
6015         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
6017 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
6019         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
6020         * sysdeps/unix/sysv/linux/open.c: Removed.
6021         * sysdeps/unix/sysv/linux/fsync.c: Removed.
6022         * sysdeps/unix/sysv/linux/lseek.c: Removed.
6023         * sysdeps/unix/sysv/linux/msync.c: Removed.
6024         * sysdeps/unix/sysv/linux/read.c: Removed.
6025         * sysdeps/unix/sysv/linux/close.c: Removed.
6026         * sysdeps/unix/sysv/linux/creat.c: Removed.
6027         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
6028         * sysdeps/unix/sysv/linux/pause.c: Removed.
6029         * sysdeps/unix/sysv/linux/select.c: Removed.
6030         * sysdeps/unix/sysv/linux/write.c: Removed.
6032 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
6034         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
6035         element in TCB to see whether locking is needed.
6037         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
6038         MULTIPLE_THREADS_OFFSET value is correct.
6040         * sysdeps/unix/sysv/linux/close.c: New file.
6041         * sysdeps/unix/sysv/linux/connect.S: New file.
6042         * sysdeps/unix/sysv/linux/creat.c: New file.
6043         * sysdeps/unix/sysv/linux/fsync.c: New file.
6044         * sysdeps/unix/sysv/linux/llseek.c: New file.
6045         * sysdeps/unix/sysv/linux/lseek.c: New file.
6046         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
6047         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
6048         * sysdeps/unix/sysv/linux/msync.c: New file.
6049         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
6050         * sysdeps/unix/sysv/linux/open.c: New file.
6051         * sysdeps/unix/sysv/linux/open64.c: New file.
6052         * sysdeps/unix/sysv/linux/pause.c: New file.
6053         * sysdeps/unix/sysv/linux/poll.c: New file.
6054         * sysdeps/unix/sysv/linux/pread.c: New file.
6055         * sysdeps/unix/sysv/linux/pread64.c: New file.
6056         * sysdeps/unix/sysv/linux/pselect.c: New file.
6057         * sysdeps/unix/sysv/linux/pwrite.c: New file.
6058         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
6059         * sysdeps/unix/sysv/linux/readv.c: New file.
6060         * sysdeps/unix/sysv/linux/recv.S: New file.
6061         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
6062         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
6063         * sysdeps/unix/sysv/linux/select.c: New file.
6064         * sysdeps/unix/sysv/linux/send.S: New file.
6065         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
6066         * sysdeps/unix/sysv/linux/sendto.S: New file.
6067         * sysdeps/unix/sysv/linux/sigpause.c: New file.
6068         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
6069         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6070         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6071         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6072         * sysdeps/unix/sysv/linux/system.c: New file.
6073         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
6074         * sysdeps/unix/sysv/linux/wait.c: New file.
6075         * sysdeps/unix/sysv/linux/waitid.c: New file.
6076         * sysdeps/unix/sysv/linux/waitpid.c: New file.
6077         * sysdeps/unix/sysv/linux/writev.c: New file.
6078         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
6080         * pt-readv.c: Fix comment.
6082 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
6084         * tst-cleanup1.c: Include stdlib.h.
6086         * tst-cancel5.c: New test.
6087         * Makefile (tests): Add tst-cancel5.
6088         (tst-cancel5): Link against libc.so libpthread.so in that order.
6090 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
6092         * forward.c (test_loaded): Prevent recursive calls.
6094         * Makefile (routines): Add libc-cancellation.
6095         * libc-cancellation.c: New file.
6096         * descr.h (struct pthread): Add multiple_threads field.
6097         * allocatestack.c (allocate_stack): Initialize multiple_header field of
6098         new thread descriptor to 1.
6099         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
6100         Initialize multiple_thread field after successful thread creation.
6101         * cancellation.c (__do_cancel): Move to pthreadP.h.
6102         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
6103         (__pthread_disable_asynccancel): Add internal_function attribute.
6104         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
6105         * pthread_setcancelstate.c: Likewise.
6106         * pthread_setcanceltype.c: Likewise.
6107         * pthread_exit.c: Likewise.
6108         * pthreadP.h (CANCELLATION_P): Likewise.
6109         (__do_cancel): Define as static inline.
6110         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
6111         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
6112         declarations.
6113         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
6114         fields.  Define MULTIPLE_THREADS_OFFSET.
6115         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
6116         declaration.
6117         * sysdeps/unix/sysv/linux/accept.S: New file.
6118         * sysdeps/unix/sysv/linux/read.c: New file.
6119         * sysdeps/unix/sysv/linux/write.c: New file.
6120         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
6121         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
6122         initialization of __libc_locking_needed.
6123         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
6124         __libc_locking_needed, use multiple_threads field in TCB.
6125         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6127 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
6129         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
6130         version.
6131         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
6133         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
6134         access to __libc_locking_needed for PIC.
6136 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
6138         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
6139         declare for libc.so.
6140         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
6141         expression.
6142         (__libc_lock_lock): Put into statement expression.
6143         (__libc_lock_unlock): Remove trailing semicolon.
6144         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
6146 2002-12-12  Roland McGrath  <roland@redhat.com>
6148         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
6149         "m" constraint to refer to __libc_locking_needed.  Declare it here.
6151 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
6153         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
6154         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
6155         Initialize __libc_locking_needed.
6156         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
6157         instead of __register_pthread_fork_handler.
6158         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
6159         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
6160         fork-gen with libc_pthread_init.
6161         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
6162         of __register_pthread_fork_handler.
6163         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
6164         of __register_pthread_fork_handler.
6165         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
6166         __libc_locking_needed to determine whether lock prefix can be avoided.
6167         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6169 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
6171         * Makefile (tests): Add tst-cleanup1.
6172         * tst-cleanup1.c: New file.
6173         * cancellation.c (__cleanup_thread): Removed.
6174         (__do_cancel): Remove call to __cleanup_thread.
6175         * pthreadP.h: Remove __cleanup_thread prorotype.
6177         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6178         Remember function and argument even if cancellation handler
6179         function is not available.
6180         (__libc_cleanup_region_end): Execute registered function directly if
6181         pthread functions are not available.
6182         (__libc_cleanup_end): Likewise.
6184         * init.c (__pthread_initialize_minimal): Fix initialization in
6185         static lib by preventing gcc from being too clever.
6187 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
6189         * init.c (__pthread_initialize_minimal): Remove unneccesary
6190         sigaddset call.
6192         * Makefile (tests): We can run tst-locale2 now.
6194 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
6196         * Versions: Remove duplicated sigwait entry.
6198 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
6200         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
6201         inside libpthread.
6203         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
6205         * pthreadP.h: Declare __pthread_enable_asynccancel and
6206         __pthread_disable_asynccancel.
6207         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
6208         (CANCEL_RESET): Use __pthread_disable_asynccancel.
6209         * cancellation.c (__pthread_enable_asynccancel): New function.
6210         (__pthread_disable_asynccancel): New function.
6211         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
6212         * pt-close.c: Likewise.
6213         * pt-connect.c: Likewise.
6214         * pt-creat.c: Likewise.
6215         * pt-fcntl.c: Likewise.
6216         * pt-fsync.c: Likewise.
6217         * pt-lseek.c: Likewise.
6218         * pt-lseek64.c: Likewise.
6219         * pt-msgrcv.c: Likewise.
6220         * pt-msgsnd.c: Likewise.
6221         * pt-msync.c: Likewise.
6222         * pt-nanosleep.c: Likewise.
6223         * pt-open.c: Likewise.
6224         * pt-open64.c: Likewise.
6225         * pt-pause.c: Likewise.
6226         * pt-poll.c: Likewise.
6227         * pt-pread.c: Likewise.
6228         * pt-pread64.c: Likewise.
6229         * pt-pselect.c: Likewise.
6230         * pt-pwrite.c: Likewise.
6231         * pt-pwrite64.c: Likewise.
6232         * pt-read.c: Likewise.
6233         * pt-readv.c: Likewise.
6234         * pt-recv.c: Likewise.
6235         * pt-recvfrom.c: Likewise.
6236         * pt-recvmsg.c: Likewise.
6237         * pt-select.c: Likewise.
6238         * pt-send.c: Likewise.
6239         * pt-sendmsg.c: Likewise.
6240         * pt-sendto.c: Likewise.
6241         * pt-sigpause.c: Likewise.
6242         * pt-sigsuspend.c: Likewise.
6243         * pt-sigtimedwait.c: Likewise.
6244         * pt-sigwait.c: Likewise.
6245         * pt-sigwaitinfo.c: Likewise.
6246         * pt-system.c: Likewise.
6247         * pt-tcdrain.c: Likewise.
6248         * pt-wait.c: Likewise.
6249         * pt-waitid.c: Likewise.
6250         * pt-waitpid.c: Likewise.
6251         * pt-write.c: Likewise.
6252         * pt-writev.c: Likewise.
6253         * pthread_join.c: Likewise.
6254         * pthread_timedjoin.c: Likewise.
6256         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
6257         (__xpg_sigpause): New function.
6258         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
6260 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
6262         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
6264         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
6265         _GI_pthread_cleanup_pop to pthreadP.h.
6267         * ftrylockfile.c: Use _IO_lock_trylock instead of
6268         pthread_mutex_trylock.
6270         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
6271         (CANCEL_RESET): Likewise.
6272         (__pthread_setcanceltype_): Declare.
6273         (__pthread_mutex_lock_internal): Declare.
6274         (__pthread_mutex_unlock_internal): Declare.
6275         (__pthread_once_internal): Declare.
6276         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
6277         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
6279         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
6280         and pthread_mutex_unlock.
6281         * pthread_cond_wait.c: Likewise.
6282         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
6283         * pthread_mutex_unlock.c: Likewise.
6285         * pthread_setcanceltype.c: Add additional alias
6286         __pthread_setcanceltype.
6288         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
6289         * sem_open.c (sem_open): Likewise.
6290         Use __libc_open, __libc_write, and __libc_close instead of
6291         open, write, and close respectively.
6293         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
6294         Rewrite as statement expression since it must return a value.
6296         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
6297         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
6298         __pthread_kill.
6300         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
6301         alias __pthread_once_internal.
6303         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
6305 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
6307         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
6308         * tst-stdio1.c: New file.
6309         * tst-stdio2.c: New file.
6311         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
6313         * Makefile (tests): Comment out tst-locale2 for now.
6314         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
6316         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
6317         -D_IO_MTSAFE_IO.
6318         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
6319         Use _IO_lock_init instead of explicit assignment.
6321         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
6322         Define __libc_lock_* and __libc_lock_recursive macros with
6323         lowlevellock macros, not pthread mutexes.
6325         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
6326         of pthread_mutex_lock.
6327         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
6328         instead of pthread_mutex_unlock.
6330 2002-12-06  Roland McGrath  <roland@redhat.com>
6332         * allocatestack.c (__stack_user): Use uninitialized defn.
6333         * init.c (__pthread_initialize_minimal): Initialize it here.
6335 2002-12-05  Roland McGrath  <roland@redhat.com>
6337         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
6338         string.
6339         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
6341         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
6342         missing & here too.
6344 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
6346         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6347         lowlevellock.
6348         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
6349         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
6350         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
6351         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
6352         for __libc_lock_* macros.
6353         * Makefile (routines): Add libc-lowlevellock.
6355 2002-10-09  Roland McGrath  <roland@redhat.com>
6357         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
6358         Under [__PIC__], call the function via the pointer fetched for
6359         comparison rather than a call by name that uses the PLT.
6360         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
6361         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
6362         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
6363         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
6364         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
6366 2002-12-04  Roland McGrath  <roland@redhat.com>
6368         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
6370         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
6371         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
6373         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
6375 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6377         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
6378         a completely opaque, non-integer type.
6379         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6381 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
6383         * sysdeps/i386/tls.h: Include stdlib.h.
6384         * sysdeps/x86_64/tls.h: Likewise.
6386 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6388         * Makefile (tests): Add tst-locale2.
6389         (tests-static): Likewise.
6390         * tst-locale2.c: New file.
6392         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
6393         volatile and add memory clobbers to lock operations.
6395 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
6397         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
6398         * sysdeps/i386/i486/bits/atomic.h: New file.
6399         * sysdeps/i386/i586/bits/atomic.h: New file.
6400         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
6401         include i486 version.
6402         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
6403         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
6404         Patch by Marijn Ros <marijn@mad.scientist.com>.
6406         * allocatestack.c (get_cached_stack): Don't crash if we first
6407         found a stack with a larger size then needed.
6408         Reported by Hui Huang <hui.huang@sun.com>.
6410         * Makefile (tests): Add tst-sysconf.
6411         * tst-sysconf.c: New file.
6413         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
6414         PTHREAD_THREADS_MAX.
6416 2002-12-02  Roland McGrath  <roland@redhat.com>
6418         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
6419         Declare using hidden_proto instead of attribute_hidden, so there are
6420         non-.hidden static symbols for gdb to find.
6421         (__pthread_keys): Likewise.
6422         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
6423         * allocatestack.c (__stack_user): Likewise.
6424         * pthread_create.c (__pthread_keys): Likewise.
6425         (__nptl_threads_events, __nptl_last_event): Make these static instead
6426         of hidden.
6427         * pthread_key_create.c (__pthread_pthread_keys_max,
6428         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
6430 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
6432         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
6433         statically.
6434         * tst-locale1.c: New file.
6436         * pthread_cond_timedwait.c: Include <stdlib.h>.
6438         * Makefile (tests): Add tst-fork2 and tst-fork3.
6439         * tst-fork2.c: New file.
6440         * tst-fork3.c: New file.
6442 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
6444         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
6446         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
6447         require it to 200112L.
6449         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
6450         instruction only if HAVE_CMOV is defined.
6451         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
6453         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
6455         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
6457         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
6459         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
6461 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
6463         * sysdeps/x86_64/bits/atomic.h: New file.
6465         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
6466         16-bit operations.
6468         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
6469         possible since gettid cannot fail.
6471         * sysdeps/x86_64/pthreaddef.h: New file.
6473         * sysdeps/i386/pthreaddef.h (gettid): Removed.
6475         * sysdeps/x86_64/pthread_spin_init.c: New file.
6476         * sysdeps/x86_64/pthread_spin_lock.c: New file.
6477         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
6478         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
6480         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
6481         Add missing lock prefix.  Minute optimization.
6483         * tst-spin2.c (main): Also check successful trylock call.
6485         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
6486         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
6488         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
6489         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
6491         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
6492         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
6493         value in case of an error.  Add support for INTERNAL_SYSCALL.
6495         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
6496         value in case of an error.
6498         * sysdeps/x86_64/tls.h: New file.
6500 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6502         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
6503         takes the array member name and the index as parameters.
6504         (THREAD_SETMEM_NC): Likewise.
6505         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
6506         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
6507         interfaces.
6509         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
6510         to decide which code to use.
6511         (THREAD_SETMEM_NC): Likewise.
6513         * allocatestack.c (queue_stack): Don't remove stack from list here.
6514         Do it in the caller.  Correct condition to prematurely terminate
6515         loop to free stacks.
6516         (__deallocate_stack): Remove stack from list here.
6518 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6520         * Makefile (tests): Add tst-stack1.
6521         * tst-stack1.c: New file.
6523         * allocatestack.c (allocate_stack): Initialize the TCB on a user
6524         provided stack.
6526         * pthread_attr_getstack.c: Return bottom of the thread area.
6528 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
6530         * Makefile (libpthread-routines): Add pt-allocrtsig and
6531         pthread_kill_other_threads.
6532         * pt-allocrtsig.c: New file.
6533         * pthread_kill_other_threads.c: New file.
6534         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
6535         all three functions.
6536         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6537         allocrtsig.
6538         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
6539         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
6540         and __libc_allocate_rtsig_private.
6541         * Versions (libpthread): Export pthread_kill_other_threads_np,
6542         __libc_current_sigrtmin, and __libc_current_sigrtmax.
6544 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
6546         * allocatestack.c (allocate_stack): stackaddr in attribute points to
6547         the end of the stack.  Adjust computations.
6548         When mprotect call fails dequeue stack and free it.
6549         * pthread_attr_setstack.c: Store top of the stack in stackaddr
6550         attribute.
6551         * pthread_getattr_np.c: Likewise.
6553         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
6554         surprises.
6556 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
6558         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
6559         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
6561 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
6563         * pthread_getspecific.c: Optimize access to first 2nd-level array.
6564         * pthread_setspecific.c: Likewise.
6566 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
6568         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
6569         definitions.  Get them from the official place.
6570         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
6572         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
6573         Use new CLONE_ flags in clone() calls.
6575         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
6576         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
6578         * Versions: Add pthread_* functions for libc.
6579         * forward.c: New file.
6581         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
6582         errno-loc.
6583         * herrno.c: New file.
6584         * res.c: New file.
6586         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
6587         sem_trywait, and sem_timedwait.  Add herrno and res.
6588         * sem_init.c: Don't initialize lock and waiters members.
6589         * sem_open.c: Likewise.
6590         * sem_post.c: Removed.
6591         * sem_wait.c: Removed.
6592         * sem_trywait.c: Removed.
6593         * sem_timedwait.c: Removed.
6594         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
6595         Includes full implementations of sem_post, sem_wait, sem_trywait,
6596         and sem_timedwait.
6597         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
6598         for new implementation.
6599         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
6600         and waiters fields.
6602         * tst-sem3.c: Improve error message.
6603         * tst-signal3.c: Likewise.
6605         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
6606         to tell the kernel about the termination futex and to initialize tid
6607         member.  Don't initialize main_thread.
6608         * descr.h (struct pthread): Remove main_thread member.
6609         * cancelllation.c (__do_cancel): Remove code handling main thread.
6610         The main thread is not special anymore.
6612         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
6613         size of the stacks to stack_cache_actsize.
6615         * pt-readv.c: Add missing "defined".
6616         * pt-sigwait.c: Likewise.
6617         * pt-writev.c: Likewise.
6619 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
6621         * Versions: Export __connect from libpthread.
6622         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6624         * Makefile (libpthread-routines): Add pt-raise.
6625         * sysdeps/unix/sysv/linux/raise.c: New file.
6626         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
6627         * sysdeps/generic/pt-raise.c: New file.
6629         * pthread_cond_init.c: Initialize all data elements of the condvar
6630         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
6632         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
6633         * pthread_create.c: Likewise.
6635         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
6636         * tst-key1.c: New file.
6637         * tst-key2.c: New file.
6638         * tst-key3.c: New file.
6640         * Versions: Export pthread_detach for version GLIBC_2.0.
6641         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
6643 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
6645         * pthread_key_create.c: Terminate search after an unused key was found.
6646         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6648         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
6649         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6651 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
6653         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
6654         dynamic lookup for errno in PIC.
6656         * allocatestack.c (get_cached_stack): Rearrange code slightly to
6657         release the stack lock as soon as possible.
6658         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
6659         the static TLS block.
6660         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
6662         * cancellation.c: Renamed from cancelation.c.
6663         * Makefile: Adjust accordingly.
6664         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
6665         * cleanup_defer.c: Use CANCELLATION_P.
6666         * pthread_testcancel.c: Likewise.
6667         * descr.h: Fix spelling in comments.
6668         * init.c: Likewise.
6669         * pthread_getattr_np.c: Likewise.
6670         * pthread_getschedparam.c: Likewise.
6671         * pthread_setschedparam.c: Likewise.
6672         * Versions: Likewise.
6674         * pt-pselect.c: New file.
6675         * Makefile (libpthread-routines): Add pt-pselect.
6676         * Versions: Add pselect.
6678         * tst-cancel4.c: New file.
6679         * Makefile (tests): Add tst-cancel4.
6681 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
6683         * pthread_mutex_lock.c: Always record lock ownership.
6684         * pthread_mutex_timedlock.c: Likewise.
6685         * pthread_mutex_trylock.c: Likewise.
6687         * pt-readv.c: New file.
6688         * pt-writev.c: New file.
6689         * pt-creat.c: New file.
6690         * pt-msgrcv.c: New file.
6691         * pt-msgsnd.c: New file.
6692         * pt-poll.c: New file.
6693         * pt-select.c: New file.
6694         * pt-sigpause.c: New file.
6695         * pt-sigsuspend.c: New file.
6696         * pt-sigwait.c: New file.
6697         * pt-sigwaitinfo.c: New file.
6698         * pt-waitid.c: New file.
6699         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
6700         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
6701         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
6702         * Versions: Add all the new functions.
6704         * tst-exit1.c: New file.
6705         * Makefile (tests): Add tst-exit1.
6707         * sem_timedwait.c: Minor optimization for more optimal fastpath.
6709 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
6711         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
6713         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
6714         call.  pthread_join is an official cancellation point.
6715         * pthread_timedjoin.c: Likewise.
6717         * pthread_cond_wait.c: Revert order in which internal lock are dropped
6718         and the condvar's mutex are retrieved.
6719         * pthread_cond_timedwait.c: Likewise.
6720         Reported by dice@saros.East.Sun.COM.
6722 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
6724         * pthreadP.h: Cut out all type definitions and move them...
6725         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
6726         * pthreadP.h: Include <internaltypes.h>.
6728         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
6729         performance tweaks.
6731         * sem_trywait.c: Shuffle #includes around to get right order.
6732         * sem_timedwait.c: Likewise.
6733         * sem_post.c: Likewise.
6734         * sem_wait.c: Likewise.
6736         * nptl 0.3 released.
6738         * Makefile (tests): Add tst-signal3.
6739         * tst-signal3.c: New file.
6741 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
6743         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
6744         the asms modify the sem object.
6745         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
6747         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
6748         the actual members.
6749         * pthreadP.h (struct sem): New type.  Actual semaphore type.
6750         * semaphoreP.h: Include pthreadP.h.
6751         * sem_getvalue.c: Adjust to sem_t change.
6752         * sem_init.c: Likewise.
6753         * sem_open.c: Likewise.
6754         * sem_post.c: Likewise.
6755         * sem_timedwait.c: Likewise.
6756         * sem_trywait.c: Likewise.
6757         * sem_wait.c: Likewise.
6759 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
6761         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
6762         * tst-basic2.c: New file.
6763         * tst-exec1.c: New file.
6764         * tst-exec2.c: New file.
6765         * tst-exec3.c: New file.
6767         * tst-fork1.c: Remove extra */.
6769         * nptl 0.2 released.  The API for IA-32 is complete.