1 2003-08-29 Jakub Jelinek <jakuB@redhat.com>
3 * tst-cancel.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
4 sigemptyset before sigaddset. Reported by jreiser@BitWagon.com.
6 2003-08-27 Ulrich Drepper <drepper@redhat.com>
8 * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
9 (__pthread_cleanup_class): Add missing return types of member
12 2003-08-26 Steven Munroe <sjmunroe@us.ibm.com>
14 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
15 (lll_mutex_unlock_force): Add memory barrier between store and futex
18 2003-08-25 Ulrich Drepper <drepper@redhat.com>
20 * tst-cancel4.c (do_test): Also unlink tempfname and remove
21 tempmsg in first loop.
23 2003-08-18 Ulrich Drepper <drepper@redhat.com>
25 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
26 _POSIX_THREAD_PRIORITY_SCHEDULING.
27 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
29 2003-08-07 Jakub Jelinek <jakub@redhat.com>
31 * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
32 (__rtld_lock_default_lock_recursive,
33 __rtld_lock_default_unlock_recursive): Define.
34 [_LIBC && SHARED] (__rtld_lock_lock_recursive,
35 __rtld_lock_unlock_recursive): Define using
36 GL(_dl_rtld_*lock_recursive).
37 * init.c (__pthread_initialize_minimal_internal): Initialize
38 _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
39 Lock GL(_dl_load_lock) the same number of times as
40 GL(_dl_load_lock) using non-mt implementation was nested.
42 * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
43 * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
45 2003-08-06 Jakub Jelinek <jakub@redhat.com>
47 * tst-cancel17.c (do_test): Make len2 maximum of page size and
50 2003-08-07 Jakub Jelinek <jakub@redhat.com>
52 * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
54 2003-08-03 Jakub Jelinek <jakub@redhat.com>
56 * sysdeps/pthread/createthread.c (do_clone): Move error handling
57 to first syscall error check. Move syscall error check for tkill
58 into __ASSUME_CLONE_STOPPED #ifdef.
60 2003-08-02 Ulrich Drepper <drepper@redhat.com>
62 * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
63 is not defined, do explicit synchronization.
64 (create_thread): Do not lock pd->lock here. If __ASSUME_CLONE_STOPPED
65 is not defined also unlock pd->lock for non-debugging case in case
67 * pthread_create.c (start_thread): Always get and release pd->lock
68 if __ASSUME_CLONE_STOPPED is not defined.
69 (start_thread_debug): Removed. Adjust users.
70 * allocatestack.c (allocate_stack): Always initialize lock if
71 __ASSUME_CLONE_STOPPED is not defined.
72 * Makefile (tests): Add tst-sched1.
73 * tst-sched1.c: New file.
75 * sysdeps/pthread/createthread.c (do_clone): Only use
76 sched_setschduler and pass correct parameters.
78 2003-07-31 Jakub Jelinek <jakub@redhat.com>
80 * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
81 pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
82 PTHREAD_STACK_MIN in comments.
84 2003-07-31 Jakub Jelinek <jakub@redhat.com>
86 * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
87 Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
89 * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
90 * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
91 * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
92 (__pthread_cleanup_upto): Fix prototype.
93 (_longjmp_unwind): Adjust caller.
94 * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
95 Change second argument to const struct pointer.
96 * tst-sem8.c (main): Remove unused s2 and s3 variables.
97 * tst-sem9.c (main): Likewise.
98 * unwind.c: Include string.h for strlen prototype.
100 2003-07-31 Ulrich Drepper <drepper@redhat.com>
102 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
103 (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
104 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
106 Patch by Nicholas Miell <nmiell@attbi.com>.
108 2003-07-30 Jakub Jelinek <jakub@redhat.com>
110 * init.c (__pthread_initialize_minimal_internal): Initialize
111 GL(dl_init_static_tls).
112 * pthreadP.h (__pthread_init_static_tls): New prototype.
113 * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
115 * Makefile (tests): Add tst-tls4.
116 (modules-names): Add tst-tls4moda and tst-tls4modb.
117 ($(objpfx)tst-tls4): Link against libdl and libpthread.
118 ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
120 * tst-tls4.c: New file.
121 * tst-tls4moda.c: New file.
122 * tst-tls4modb.c: New file.
124 2003-06-19 Daniel Jacobowitz <drow@mvista.com>
126 * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
127 before __timer_dealloc.
128 * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
129 Don't call list_unlink.
131 2003-07-29 Roland McGrath <roland@redhat.com>
133 * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
135 2003-07-25 Jakub Jelinek <jakub@redhat.com>
137 * tst-cancel17.c (do_test): Check if aio_cancel failed.
138 Don't reuse struct aiocb A if it failed.
139 Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
140 not just one byte, as that does not block.
142 2003-07-22 Jakub Jelinek <jakub@redhat.com>
144 * sysdeps/pthread/unwind-resume.c: New file.
145 * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
146 unwind-resume in csu subdir.
147 (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
149 (librt-sysdep_routines, librt-shared-only-routines): Add
151 * sysdeps/pthread/rt-unwind-resume.c: New file.
152 * unwind-forcedunwind.c: New file.
153 * Makefile (libpthread-routines): Add unwind-forcedunwind.
154 (libpthread-shared-only-routines): Likewise.
155 (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
156 * pthreadP.h (pthread_cancel_init): New prototype.
157 * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
159 * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
160 attr argument const struct pthread_attr *.
162 * res.c (__res_state): Return __resp.
163 * descr.h: Include resolv.h.
164 (struct pthread): Add res field.
165 * pthread_create.c: Include resolv.h.
166 (start_thread): Initialize __resp.
167 * Makefile (tests): Add tst-_res1.
168 (module-names): Add tst-_res1mod1, tst-_res1mod2.
169 ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
170 ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
172 * tst-_res1.c: New file.
173 * tst-_res1mod1.c: New file.
174 * tst-_res1mod2.c: New file.
176 2003-07-21 Ulrich Drepper <drepper@redhat.com>
178 * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
180 * Makefile: Define various *-no-z-defs variables for test DSOs
181 which has undefined symbols.
183 2003-07-21 Steven Munroe <sjmunroe@us.ibm.com>
185 * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
186 Retry if the stwcx fails to store once_control.
188 2003-07-20 Ulrich Drepper <drepper@redhat.com>
190 * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
191 pthread_attr_setaffinity.
192 * Versions [libpthread] (GLIBC_2.3.3): Likewise.
193 * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
194 * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
195 * pthread_attr_destroy.c: Free cpuset element if allocated.
196 * pthread_create.c: Pass iattr as additional parameter to
198 * sysdeps/pthread/createthread.c: If attribute is provided and
199 a new thread is created with affinity set or scheduling parameters,
200 start thread with CLONE_STOPPED.
201 * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
202 pthread_attr_setaffinity.
203 * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
206 2003-07-15 Ulrich Drepper <drepper@redhat.com>
208 * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
210 2003-07-14 Ulrich Drepper <drepper@redhat.com>
212 * sysdeps/pthread/configure.in: Require CFI directives also for
215 2003-07-15 Jakub Jelinek <jakub@redhat.com>
217 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
220 2003-07-12 Kaz Kojima <kkojima@rr.iij4u.or.jp>
222 * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
224 * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
225 registers as variables. Call __pthread_mutex_unlock_usercnt.
226 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
227 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
228 not self pointer in __writer. Compare with TID to determine
230 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
231 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
233 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
235 * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
236 * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
237 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
238 macros also when compiling librt.
240 2003-07-11 Jakub Jelinek <jakub@redhat.com>
242 * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
243 -fasynchronous-unwind-tables.
244 * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
245 (PSEUDO): Add cfi directives.
246 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
248 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
251 2003-07-08 Jakub Jelinek <jakub@redhat.com>
253 * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
254 __pthread_unregister_cancel): Add prototypes and hidden_proto.
255 * unwind.c (__pthread_unwind_next): Add hidden_def.
256 * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
258 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
259 Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
260 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
262 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
263 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
265 * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
266 HIDDEN_JUMPTARGET to call __pthread_register_cancel,
267 __pthread_unregister_cancel and __pthread_unwind_next.
269 2003-07-04 Jakub Jelinek <jakub@redhat.com>
271 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
272 different symbol for the cancellation syscall wrapper and
273 non-cancellation syscall wrapper.
274 (PSEUDO_END): Define.
276 2003-07-05 Richard Henderson <rth@redhat.com>
278 * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
279 * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
280 lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
281 return actual return value from the syscall, not 0.
283 2003-07-07 Ulrich Drepper <drepper@redhat.com>
285 * descr.h (struct pthread): Add pid field.
286 * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
287 (__reclaim_stacks): Likewise.
288 * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
289 also check for PID of the signal source.
290 (__pthread_initialize_minimal_internal): Also initialize pid field
291 of initial thread's descriptor.
292 * pthread_cancel.c: Use tgkill instead of tkill if possible.
293 * sysdeps/unix/sysv/linux/fork.c: Likewise.
294 * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
295 * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
296 * sysdeps/unix/sysv/linux/raise.c: Likewise.
298 2003-07-05 Ulrich Drepper <drepper@redhat.com>
300 * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
301 Fix use of parameter.
302 (__libc_cleanup_pop): Likewise.
304 2003-07-04 Ulrich Drepper <drepper@redhat.com>
306 * init.c (sigcancel_handler): Change parameters to match handler
307 for SA_SIGACTION. Check signal number and code to recognize
310 2003-07-03 Roland McGrath <roland@redhat.com>
312 * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
313 Apply sizeof (struct pthread) bias to r13 value.
315 2003-07-03 Ulrich Drepper <drepper@redhat.com>
317 * sysdeps/pthread/configure.in: Require CFI directives.
319 * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
321 * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
322 libpthread compilation.
323 * unwind.c (__pthread_unwind): Add hidden_def.
324 * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
326 2003-07-01 Ulrich Drepper <drepper@redhat.com>
328 * libc-cancellation.c (__libc_cleanup_routine): Define.
329 * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
330 (__pthread_cleanup_pop): Define.
332 2003-07-01 Richard Henderson <rth@redhat.com>
334 * sysdeps/alpha/elf/pt-initfini.c: New file.
335 * sysdeps/alpha/pthread_spin_lock.S: New file.
336 * sysdeps/alpha/pthread_spin_trylock.S: New file.
337 * sysdeps/alpha/pthreaddef.h: New file.
338 * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
339 * sysdeps/alpha/tls.h: New file.
340 * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
341 * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
342 * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
343 * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
344 * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
345 * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
346 * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
347 * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
348 * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
349 * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
351 2003-07-01 Ulrich Drepper <drepper@redhat.com>
353 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
354 cleanup support and unwind info.
356 2003-06-30 Ulrich Drepper <drepper@redhat.com>
358 * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
359 Use correct cleanup handler registration. Add unwind info.
360 * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
361 * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
362 * tst-once3.c: Add cleanup handler and check it is called.
363 * tst-once4.c: Likewise.
364 * tst-oncex3.c: New file.
365 * tst-oncex4.c: New file.
366 * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
368 2003-06-29 Ulrich Drepper <drepper@redhat.com>
370 * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
372 2003-06-27 Ulrich Drepper <drepper@redhat.com>
374 * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
375 (tf_msgsnd): Likewise.
377 * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
378 premature returns a bit more.
380 2003-06-26 Ulrich Drepper <drepper@redhat.com>
382 * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
383 definition to the front.
385 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
386 the cleanup functions to make the names unique. Fix dwarf opcode
388 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
389 functions to make the names unique. Fix CFA offset for two blocks.
391 2003-06-25 Ulrich Drepper <drepper@redhat.com>
393 * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
394 missing closing braces.
395 Patch by Christophe Saout <christophe@saout.de>.
397 2003-06-24 Roland McGrath <roland@redhat.com>
399 * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
401 2003-06-24 Ulrich Drepper <drepper@redhat.com>
403 * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
404 * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
406 * pthreadP.h: Declare __find_thread_by_id.
407 * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
408 * pthread_clock_gettime.c: Allow using other thread's clock.
409 * pthread_clock_settime.c: Likewise.
410 * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
411 * Makefile: Add rules to build and run tst-clock2.
412 * tst-clock2.c: New file.
414 2003-06-23 Ulrich Drepper <drepper@redhat.com>
416 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
417 to use exception-based cleanup handler.
418 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
420 * tst-cond8.c (ch): Announce that we are done.
422 * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
424 * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
425 Also test aio_suspend with timeout value.
427 2003-06-22 Ulrich Drepper <drepper@redhat.com>
429 * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
430 * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
433 * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
434 (__pthread_mutex_lock_internal): Likewise.
435 (__pthread_mutex_unlock_internal): Likewise.
436 (__pthread_mutex_unlock_usercnt): Declare.
437 * pthread_mutex_destroy.c: Always fail if used in any way.
438 * pthread_mutex_init.c: Update comment.
439 * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
440 * pthread_mutex_timedlock.c: Adjust __nusers.
441 * pthread_mutex_trylock.c: Adjust __nusers.
442 * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
443 and public interfaces are wrapper with pass additional parameter.
444 __pthread_mutex_unlock_usercnt does not adjust __nusers if second
446 * tst-mutex8.c: New file.
447 * Makefile (tests): Add tst-mutex8.
448 * sysdeps/pthread/pthread_cond_timedwait.c: Call
449 __pthread_mutex_unlock_usercnt.
450 * sysdeps/pthread/pthread_cond_wait.c: Likewise.
451 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
452 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
453 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
454 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
455 * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
456 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
458 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
459 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
460 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
461 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
462 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
464 * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
465 * pthread_mutex_timedlock.c: Likewise.
466 * pthread_mutex_trylock.c: Adjust __nusers.
467 * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
468 * tst-mutex9.c: New file.
469 * Makefile (tests): Add tst-mutex9.
470 * sysdeps/i386/tls.h: Remove THREAD_ID definition.
471 * sysdeps/ia64/tls.h: Likewise.
472 * sysdeps/powerpc/tls.h: Likewise.
473 * sysdeps/s390/tls.h: Likewise.
474 * sysdeps/sh/tls.h: Likewise.
475 * sysdeps/x86_64/tls.h: Likewise.
476 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
477 Change type of __owner.
478 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
479 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
480 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
481 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
482 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
484 2003-06-19 Jakub Jelinek <jakub@redhat.com>
486 * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
487 * sysdeps/unix/sysv/linux/sem_post.c: ...here.
489 * sysdeps/unix/sysv/linux/sem_post.c: Move to...
490 * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here. Pass nr + 1
491 instead of nr to lll_futex_wake. Only set errno and return -1
494 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
495 lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
496 return actual return value from the syscall, not 0.
498 2003-06-18 Ulrich Drepper <drepper@redhat.com>
500 * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
502 (tf_msgrcv): Likewise. Also don't report msgrcv returns if
505 * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
506 compat_timer_settime.
507 * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
508 compat_timer_gettime.
509 * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
510 compat_timer_getoverrun.
511 * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
514 * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
515 error-checking mutex detect busy mutexes.
517 2003-06-17 Ulrich Drepper <drepper@redhat.com>
519 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
520 Add ax to clobber list.
521 (lll_mutex_cond_lock): Likewise.
522 (lll_mutex_unlock): Likewise.
523 (lll_lock): Likewise.
524 (lll_unlock): Likewise.
526 * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
527 * tst-cancel18.c: New file.
528 * tst-cancelx18.c: New file.
530 * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
533 * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
534 * tst-cancel17.c: New file.
535 * tst-cancelx17.c: New file.
537 * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
538 * sysdeps/unix/sysv/linux/sigwait.c: New file.
539 * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
541 * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
543 2003-06-16 Jakub Jelinek <jakub@redhat.com>
545 * sysdeps/pthread/createthread.c (create_thread): Set
546 header.multiple_threads unconditionally.
547 * allocatestack.c (allocate_stack): Likewise.
548 * descr.h (struct pthread): Add header.multiple_threads
550 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
551 Define for librt. #error if neither libpthread, libc nor librt.
552 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
554 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
556 * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
558 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
560 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
561 CDISABLE): Likewise. Access header.multiple_threads outside of
563 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
565 * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
566 * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
568 2003-06-17 Ulrich Drepper <drepper@redhat.com>
570 * tst-cancel4.c: Add tests for the socket and signal functions, pause.
571 Also test early cancellation before the thread reaches the cancellation
574 * Makefile: Compile forward.c with exceptions.
576 * sysdeps/unix/sysv/linux/sleep.c: New file.
578 2003-06-16 Ulrich Drepper <drepper@redhat.com>
580 * Makefile: Add CFLAGS definition to compile function wrappers
581 duplicated from libc with exceptions.
582 * tst-cancel4.c: Also check cancellation handlers.
584 * Makefile: Add rules to build and run tst-cancel16 and
585 tst-cancelx16. Add missing CFLAGS definitions.
586 * tst-cancel16.c: New file.
587 * tst-cancelx16.c: New file.
589 2003-06-15 Ulrich Drepper <drepper@redhat.com>
591 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
592 (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
593 * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
594 (DL_SYSINFO_IMPLEMENTATION): Likewise.
596 * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
597 (LIBC_CANCEL_RESET): Likewise.
598 Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
599 * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
601 (CFLAGS-libcrt-cancellation.c): Define.
602 * sysdeps/pthread/librt-cancellation.c: New file.
603 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
604 macros also when compiling librt.
605 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
606 * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
607 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
608 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
609 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
610 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
611 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
613 * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
616 2003-06-14 Ulrich Drepper <drepper@redhat.com>
618 * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
620 * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
622 * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
625 2003-06-13 Roland McGrath <roland@redhat.com>
627 * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
628 constant from <sys/reg.h> to ps_get_thread_area, not register contents.
630 2003-06-11 Ulrich Drepper <drepper@redhat.com>
632 * allocatestack.c (queue_stack): Always inline.
633 * ptreadhP.h (__do_cancel): Likewise.
635 2003-06-10 Jakub Jelinek <jakub@redhat.com>
637 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
640 2003-06-10 Ulrich Drepper <drepper@redhat.com>
642 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
643 (__pthread_cond_signal): Remove incorrect second addition for
646 2003-06-09 Ulrich Drepper <drepper@redhat.com>
648 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
649 (__pthread_cond_signal): Use correct futex pointer in
650 __lll_mutex_lock_wait call.
652 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
653 (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
655 2003-06-08 Ulrich Drepper <drepper@redhat.com>
657 * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
659 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
662 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
663 hand-written CFI generation code. Since ENTRY/END also initiated
664 CFI frames this caused two CFI sets to be generated.
666 2003-06-07 Ulrich Drepper <drepper@redhat.com>
668 * cleanup_routine.c: New file.
669 * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
670 * sysdeps/pthread/pthread.h: Add support for fully exception-based
672 * Makefile (libpthread-routines): Add cleanup_routine.
673 Add more CFLAGS variables to compile with exceptions. Add comments
674 why which file needs unwind tables.
675 (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
677 * tst-cancelx1.c: New file.
678 * tst-cancelx2.c: New file.
679 * tst-cancelx3.c: New file.
680 * tst-cancelx4.c: New file.
681 * tst-cancelx5.c: New file.
682 * tst-cancelx6.c: New file.
683 * tst-cancelx7.c: New file.
684 * tst-cancelx8.c: New file.
685 * tst-cancelx9.c: New file.
686 * tst-cancelx10.c: New file.
687 * tst-cancelx11.c: New file.
688 * tst-cancelx12.c: New file.
689 * tst-cancelx13.c: New file.
690 * tst-cancelx14.c: New file.
691 * tst-cancelx15.c: New file.
692 * tst-cleanupx0.c: New file.
693 * tst-cleanupx0.expect: New file.
694 * tst-cleanupx1.c: New file.
695 * tst-cleanupx2.c: New file.
696 * tst-cleanupx3.c: New file.
698 * tst-cleanup0.c: Make standard compliant.
699 * tst-cleanup1.c: Likewise.
701 * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
702 * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
703 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
704 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
705 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
706 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
707 * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
709 * sysdeps/x86_64/tcb-offsets.sym: Likewise.
710 * tst-cancel12.c: New file.
711 * tst-cancel13.c: New file.
712 * tst-cancel14.c: New file.
713 * tst-cancel15.c: New file.
714 * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
717 * tst-cancel1.c: Add some comments.
719 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
722 2003-06-06 Ulrich Drepper <drepper@redhat.com>
724 * Makefile (CFLAGS-pthread_cancel.c): Define.
726 2003-06-05 Ulrich Drepper <drepper@redhat.com>
728 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
729 Change type of __writer element to int.
730 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
731 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
732 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
733 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
734 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
735 * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
736 * sysdeps/x86_64/tcb-offsets.sym: Likewise.
737 * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
738 Compare with TID to determine deadlocks.
739 * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
740 * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
741 * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
742 * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
743 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
744 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
746 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
748 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
749 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
750 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
752 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
754 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
755 * Makefile (tests): Add tst-rwlock12.
756 * tst-rwlock12.c: New file.
758 2003-06-05 Jakub Jelinek <jakub@redhat.com>
760 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
761 __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
762 Remove bogus hidden_proto.
763 * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
765 * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
766 lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
767 * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
768 ___lll_mutex_timedlock): Likewise.
770 2003-06-04 Ulrich Drepper <drepper@redhat.com>
772 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
773 (__pthread_cond_signal): Add some code to eventually handle
776 2003-06-01 Ulrich Drepper <drepper@redhat.com>
778 * Makefile (tests): Add tst-exec4.
779 (tst-exec4-ARGS): Define.
780 * tst-exec4.c: New file.
782 2003-05-31 Ulrich Drepper <drepper@redhat.com>
784 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
785 Also fail if tv_nsec < 0.
786 (__lll_timedwait_tid): Likewise.
787 * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
788 * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
790 * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
792 * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
794 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
796 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
798 * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
801 * Makefile (tests): Add tst-sem8 and tst-sem9.
802 * tst-sem8.c: New file.
803 * tst-sem9.c: New file.
804 * sem_open.c: Fix creation of in_use record if the file exists but
807 * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
810 * sysdeps/pthread/timer_create.c (timer_create): In case
811 evp==NULL, assign timer ID to sival_ptr.
813 * descr.h (struct pthread_unwind_buf): Change type of prev element to
814 struct pthread_unwind_buf *.
815 (struct pthread): Likewise for cleanup_jmp_buf element.
817 * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
818 * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
819 * unwind.c (__pthread_unwind_next): Likewise.
821 2003-05-30 Ulrich Drepper <drepper@redhat.com>
823 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
824 (lll_futex_timed_wait): Use int for futex value parameter.
825 (lll_futex_wake): Likewise.
826 (lll_futex_requeue): Likewise.
828 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
829 Replace one memory operation with one register operation.
831 * tst-join4.c (do_test): Fix error message.
833 * tst-rwlock6.c (do_test): Use correct format specifier.
835 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
836 (__lll_mutex_lock_wait): Replace one memory operation with one
838 * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
839 (__lll_mutex_lock_wait): Likewise.
841 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
842 (__lll_mutex_cond_lock): Add one to value parameter of
843 __lll_lock_wait to reflect reality in the futex syscall.
844 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
845 (lll_mutex_cond_lock): Likewise.
847 2003-05-30 Jakub Jelinek <jakub@redhat.com>
849 * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
851 (lll_mutex_cond_lock): Define.
853 2003-05-29 Ulrich Drepper <drepper@redhat.com>
855 * Makefile (tests): Add tst-signal6.
856 * tst-signal6.c: New file.
858 * sysdeps/unix/sysv/linux/s390/lowlevellock.h
859 (__lll_mutex_unlock_force): New function
860 (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
862 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
863 (__lll_mutex_unlock_force): New function.
864 (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
866 * tst-rwlock7.c (do_test): Use correct format specifier.
868 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
869 Find break parameter in correct asm argument.
871 2003-05-27 Jakub Jelinek <jakub@redhat.com>
873 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
875 (lll_futex_requeue): Fix __o3 constraint, return negative errno if
877 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
879 * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
880 lll_futex_requeue, lll_mutex_unlock_force): Define.
882 2003-05-30 Jakub Jelinek <jakub@redhat.com>
884 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
885 (pthread_cond_t): Add __mutex.
886 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
887 lll_futex_requeue, lll_mutex_unlock_force): Define.
889 2003-05-28 Kaz Kojima <kkojima@rr.iij4u.or.jp>
891 * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
892 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
894 * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
896 (lll_futex_wait, lll_futex_wake): Define.
897 * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
898 * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
899 FUTEX_REQUEUE instead of FUTEX_WAIT.
900 * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
901 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
902 mutex which was used in condvar structure. Call
903 __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
904 * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
906 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
907 include tcb-offsets.h. Read wakeup value in locked region.
908 Use the value of gbr register as THREAD_ID.
909 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
910 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
911 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
913 * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
916 2003-05-28 Ulrich Drepper <drepper@redhat.com>
918 * sysdeps/pthread/pthread_cond_broadcast.c
919 (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
921 2003-05-26 Ulrich Drepper <drepper@redhat.com>
923 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
924 typo in register name.
925 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
926 correctly. Actually use requeue. Little optimization.
927 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
928 mutex address early. Handle cancellation state as 32-bit value.
929 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
930 Remove unnecessary label.
932 2003-05-25 Ulrich Drepper <drepper@redhat.com>
934 * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
935 instead of FUTEX_WAIT.
936 * sysdeps/pthread/pthread_cond_signal.c: Likewise.
937 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
938 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
939 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
940 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
941 * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
942 used in condvar structure. Call __pthread_mutex_cond_lock instead
943 of __pthread_mutex_lock_internal.
944 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
945 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
946 * sysdeps/pthread/pthread_cond_wait.c: Likewise.
947 (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
948 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
949 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
950 * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
951 Add pthread_mutex_cond_lock.
952 * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
953 * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
954 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
956 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
957 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
958 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
960 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
961 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
963 * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
964 * sysdeps/x86_64/tcb-offsets.sym: Likewise.
966 * pthreadP.h: Declare __pthread_mutex_cond_lock.
967 * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
968 Use it instead of lll_mutex_lock. If __pthread_mutex_lock is a
969 macro don't define aliases.
971 * cancellation.c: Remove __pthread_enable_asynccancel_2.
972 * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
973 * sysdeps/pthread/pthread_cond_timedwait.c: Use
974 __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
975 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
976 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
977 * sysdeps/pthread/pthread_cond_wait.c: Likewise.
978 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
979 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
981 2003-05-17 Ulrich Drepper <drepper@redhat.com>
983 * sem_open.c: Fix one endless loop. Implement correct semantics
984 wrt opening the same semaphore more then once.
985 * sem_close.c: Adjust for sem_open change.
986 * semaphoreP.h: Include <semaphore.h>. Define struct inuse_sem.
987 Declare __sem_mappings, __sem_mappings_lock, __sem_search.
988 * Makefile (tests): Add tst-sem7.
989 * tst-sem7.c: New file.
991 2003-05-16 Roland McGrath <roland@redhat.com>
993 * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
994 uninitialized variable braino.
996 2003-05-16 Ulrich Drepper <drepper@redhat.com>
998 * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
999 test for syscall availability.
1001 * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
1002 __no_posix_timers to -1 if the syscalls don't exist.
1004 * pthread_join.c (pthread_join): Set tid field of the joined
1005 thread to -1. This isn't necessary but helps to recognize some
1006 error conditions with almost no cost.
1008 * allocatestack.c (FREE_P): Also negative values indicate an
1011 * unwind.c: Include <unistd.h>.
1013 2003-05-14 Ulrich Drepper <drepper@redhat.com>
1015 * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
1017 2003-05-14 Jakub Jelinek <jakub@redhat.com>
1019 * Makefile (crti-objs, crtn-objs): New variables.
1020 (omit-deps, extra-objs): Add crtn.
1021 ($(objpfx)libpthread.so): Depend on both crti and crtn
1022 and links to them in multidir.
1023 ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
1025 2003-05-12 Steven Munroe <sjmunroe@us.ibm.com>
1027 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1028 (lll_mutex_unlock): Use atomic_exchange_rel.
1030 2003-05-11 Ulrich Drepper <drepper@redhat.com>
1032 * cond-perf.c (cons): Add missing locking around setting of alldone.
1034 2003-05-10 Ulrich Drepper <drepper@redhat.com>
1036 * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
1038 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
1040 2003-05-09 Ulrich Drepper <drepper@redhat.com>
1042 * tst-sem6.c: New file.
1043 * Makefile (tests): Add tst-sem6.
1045 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
1046 Use atomic_exchange_rel instead of atomic_exchange.
1047 * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
1050 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
1051 code for lll_futex_wait and lll_futex_wake in static apps. Use
1052 vsyscall is possible.
1054 * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
1055 * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
1056 * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
1057 pthread_setaffinity_np.
1058 * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
1059 and pthread_setaffinity_np.
1060 * Makefile (libpthread-routines): Add pthread_getaffinity and
1061 pthread_setaffinity.
1063 * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
1064 use it in case mmap to allocate the stack fails.
1065 * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
1066 ARCH_MAP_FLAGS here.
1067 * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
1070 2003-05-08 Ulrich Drepper <drepper@redhat.com>
1072 * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
1073 handler implementation. It is now lockless in fork().
1074 * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
1075 * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1076 * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>. Don't
1077 declare the __fork_*_lists.
1078 (struct fork_handler): Include pointers to all three functions.
1079 Add next, refcntr and need_signal elements.
1080 (__fork_handlers): New declaration.
1081 (__register_atfork_malloc): Remove declaration.
1082 (HAVE_register_atfork_malloc): Remove definition.
1083 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
1084 __pthread_child_handler variable.
1085 (__libc_pthread_init): Use __register_atfork instead of explicitly
1087 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
1089 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1091 * unwind.c (unwind_cleanup): Print error message and then abort. This
1092 function must never be reached.
1094 * cond-perf.c: New file.
1096 2003-05-05 Ulrich Drepper <drepper@redhat.com>
1098 * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
1100 2003-05-04 Roland McGrath <roland@redhat.com>
1102 * Makefile ($(objpfx)../libc.so): New target.
1104 2003-05-02 Ulrich Drepper <drepper@redhat.com>
1106 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1107 (pthread_condattr_t): Size is only an int, don't use long for
1109 (pthread_mutexattr_t): Likewise.
1110 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1111 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1112 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1114 2003-05-01 Ulrich Drepper <drepper@redhat.com>
1116 * sysdeps/i386/tls.h: Define THREAD_ID.
1117 * sysdeps/ia64/tls.h: Likewise.
1118 * sysdeps/powerpc/tls.h: Likewise.
1119 * sysdeps/s390/tls.h: Likewise.
1120 * sysdeps/sh/tls.h: Likewise.
1121 * sysdeps/x86_64/tls.h: Likewise.
1122 * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
1124 * pthread_mutex_timedlock.c: Likewise.
1125 * pthread_mutex_trylock.c: Likewise.
1126 * pthread_mutex_unlock.c: Likewise.
1127 * pthread_rwlock_trywrlock.c: Likewise.
1128 * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
1129 * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
1130 * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1131 * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
1133 * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
1136 2003-04-29 Jakub Jelinek <jakub@redhat.com>
1138 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1139 (__SIZEOF_PTHREAD_COND_T): Define to 48.
1140 (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
1141 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1142 Make __align long long instead of long.
1143 (pthread_rwlock_t): Formatting.
1144 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
1145 (pthread_rwlock_t): Formatting.
1146 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1147 (pthread_cond_t): Make __align long long instead of long.
1148 (pthread_rwlock_t): Move __flags field to the same position as in
1151 2003-04-30 Ulrich Drepper <drepper@redhat.com>
1153 * tst-rwlock6.c (do_test): Use correct printf format specifiers.
1154 * tst-rwlock7.c (do_test): Likewise.
1156 2003-04-26 Roland McGrath <roland@redhat.com>
1158 * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
1160 2003-04-22 Jakub Jelinek <jakub@redhat.com>
1162 * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
1163 sizeof (struct pthread).
1164 (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
1166 * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
1168 (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
1170 (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
1172 (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
1174 (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
1176 (NO_TLS_OFFSET): Define.
1177 * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
1178 add TLS_TCB_SIZE unnecessarily.
1180 2003-04-22 Roland McGrath <roland@redhat.com>
1182 * Makeconfig (shared-thread-library): Reverse link order to work
1185 2003-04-22 Ulrich Drepper <drepper@redhat.com>
1187 * semaphore.h: Fix typo in comment.
1189 2003-04-21 Ulrich Drepper <drepper@redhat.com>
1191 * sysdeps/pthread/sigfillset.c: New file.
1193 * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
1194 * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
1195 * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
1196 * sysdeps/pthread/sigaction.c: Likewise.
1197 * sysdeps/pthread/sigprocmask.c: New file.
1198 * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
1200 * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1201 Block SIGTIMER. Also handle SI_TKILL events and terminate thread
1204 2003-04-19 Ulrich Drepper <drepper@redhat.com>
1206 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
1207 (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
1209 * sysdeps/unix/sysv/linux/unregister-atfork.c
1210 (__unregister_atfork): Don't free memory not allocated dynamically.
1212 * semaphore.h: Remove __THROW marker from cancellation points.
1213 * nptl/sysdeps/pthread/pthread.h: Likewise.
1215 2003-04-18 Ulrich Drepper <drepper@redhat.com>
1217 * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
1218 pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
1221 2003-04-16 Jakub Jelinek <jakub@redhat.com>
1223 * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
1225 2003-04-15 Roland McGrath <roland@redhat.com>
1227 * forward.c (__pthread_unwind): Tweak to avoid warning.
1229 2003-04-15 Ulrich Drepper <drepper@redhat.com>
1231 * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
1233 2003-04-14 Ulrich Drepper <drepper@redhat.com>
1235 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
1236 overflow CFA advance instructions.
1237 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1239 2003-04-14 Jakub Jelinek <jakub@redhat.com>
1241 * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
1242 * sysdeps/i386/pthread_spin_lock.c: Likewise.
1243 * sysdeps/x86_64/tls.h: Likewise. Define LOCK_PREFIX if not already
1246 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
1247 DW_CFA_advance_loc2 for .Laddl-.Lsubl.
1248 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
1249 DW_CFA_advance_loc for .Laddl-.Lsubl.
1251 2003-04-13 Ulrich Drepper <drepper@redhat.com>
1253 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
1254 position-independent unwind data for static libraries.
1255 Add missing unwind info. Add comments.
1257 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
1258 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1259 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1260 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1262 2003-04-12 Ulrich Drepper <drepper@redhat.com>
1264 * Makefile: Make sure all cancellation points are compiled with
1265 exception and asynchronous unwind tables.
1267 * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
1268 which mishandles loading of global object addresses in PIC.
1269 (THREAD_SETMEM_NC): Likewise.
1271 2003-04-11 Ulrich Drepper <drepper@redhat.com>
1273 * pthread.h: Define new data structure for cleanup buffer. Declare
1274 new cleanup handler interfaces.
1275 * descr.h: Include <unwind.h> if necessary. Define pthread_unwind_buf.
1276 (struct pthread): Add cleanup_jmp_buf pointer. Define
1277 HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
1278 * pthreadP.h: Declare __pthread_unwind. Define __do_cancel to use
1279 it. Declare old cleanup handler installation functions.
1280 * cleanup.c: Rewrite. Install handler for unwind-based cleanup
1282 * cleanup_defer.c: Likewise.
1283 * cleanup_compat.c: New file. Old cleanup code.
1284 * cleanup_def_compat.c: New file. Old cleanup code.
1285 * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
1286 if own thread descriptor.
1287 * unwind.c: New file.
1288 * forward.c: Add __pthread_unwind.
1289 * init.c (pthread_functions): Add __pthread_unwind.
1290 * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
1291 Add ptr___pthread_unwind.
1292 * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
1293 and unwind function.
1294 * Makefile (libpthread-routines): Add cleanup_compat,
1295 cleanup_def_compat, and unwind. Define CFLAGS to enable unwind
1296 table generation if necessary.
1297 * version.c: Record whether unwind support is compiled in.
1298 * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
1299 * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
1301 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
1302 complication to generate unwind information for syscall wrappers.
1303 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1304 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
1305 __cleanup_fct_attribute.
1307 * Makefile: Add rules to build and run tst-cleanup0.
1308 * tst-cleanup0.c: New file.
1309 * tst-cleanup0.expect: New file.
1311 * pthread_create.c (deallocate_tsd): Don't take parameter. Adjust
1312 caller. Optimize to avoid often unecessary local variable.
1314 2003-04-11 Roland McGrath <roland@redhat.com>
1316 * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
1317 sets variable `multidir'; include that.
1318 (generated): Add it.
1319 ($(objpfx)$(multidir)/crti.o): New target.
1320 [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
1322 2003-04-11 Ulrich Drepper <drepper@redhat.com>
1324 * tst-attr2.c (do_test): Add cast to avoid warning.
1325 * tst-mutex4.c (do_test): Likewise.
1327 2003-04-10 Ulrich Drepper <drepper@redhat.com>
1329 * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
1332 2003-04-09 Ulrich Drepper <drepper@redhat.com>
1334 * Makefile (tests): Add tst-detach1.
1335 * tst-detach1.c: New file.
1337 2003-04-08 Ulrich Drepper <drepper@redhat.com>
1339 * sysdeps/pthread/pthread.h: Remove duplicate
1340 pthread_cleanup_{push,pop} definitions.
1342 * tst-barrier2.c: Eliminate warnings.
1343 * tst-cancel4.c: Likewise.
1344 * tst-cond4.c: Likewise.
1345 * tst-cond6.c: Likewise.
1346 * tst-detach1.c: Likewise.
1347 * tst-rwlock4.c: Likewise.
1348 * tst-rwlock6.c: Likewise.
1349 * tst-rwlock7.c: Likewise.
1350 * tst-sem3.c: Likewise.
1351 * tst-spin2.c: Likewise.
1352 * tst-umask1.c: Likewise.
1354 2003-04-07 Ulrich Drepper <drepper@redhat.com>
1356 * pthread_detach.c (pthread_detach): Fix test for invalid TID.
1358 2003-04-06 Ulrich Drepper <drepper@redhat.com>
1360 * descr.h (struct pthread): Move cancelhandling member to the front.
1362 2003-04-05 Ulrich Drepper <drepper@redhat.com>
1364 * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
1365 malloc_parent, and malloc_child statically.
1366 (__register_atfork_malloc): New function.
1367 (free_mem): Don't free any of the malloc_* variables on the list.
1368 * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
1369 Define HAVE_register_atfork_malloc.
1371 2003-04-04 Ulrich Drepper <drepper@redhat.com>
1373 * sysdeps/pthread/createthread.c (create_thread): Add some more
1374 comments explaining when to set multiple_threads and when not.
1376 * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
1377 THREAD_ATOMIC_BIT_SET if not already defined.
1378 * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
1379 THREAD_ATOMIC_BIT_SET:
1380 * sysdeps/x86_64/tls.h: Likewise.
1381 * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
1382 THREAD_ATOMIC_CMPXCHG_VAL.
1383 (_pthread_cleanup_pop_restore): Likewise.
1384 * cancellation.c (__pthread_enable_asynccancel): Likewise.
1385 (__pthread_enable_asynccancel_2): Likewise.
1386 (__pthread_disable_asynccancel): Likewise.
1387 * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
1388 (__libc_disable_asynccancel): Likewise.
1389 * init.c (sigcancel_handler): Likewise.
1390 * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
1391 * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
1393 2003-04-03 Ulrich Drepper <drepper@redhat.com>
1395 * init.c (sigcancel_handler): Don't set EXITING_BIT here.
1396 * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
1397 * pthreadP.h (__do_cancel): Set EXITING_BIT here.
1398 * Makefile (tests): Add tst-cancel11.
1399 * tst-cancel11.c: New file.
1401 2003-04-01 Ulrich Drepper <drepper@redhat.com>
1403 * pthread_create.c (deallocate_tsd): Clear/free memory after the last
1404 round, not the first. Use specific_used flag instead of local
1405 found_nonzero variable. Use THREAD_[SG]ETMEM where possible.
1406 (__free_tcb): Don't call deallocate_tsd here.
1407 (start_thread): Call deallocate_tsd here.
1408 * pthread_setspecific.c: Set specific_used flag really only when
1410 * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
1411 * tst-tsd3.c: New file.
1412 * tst-tsd4.c: New file.
1414 2003-03-31 Ulrich Drepper <drepper@redhat.com>
1416 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
1417 Use atomic_exchange_and_add instead of __lll_add.
1418 (__lll_mutex_timedlock): Likewise.
1419 Patch by Ian Wienand.
1421 2003-03-24 Steven Munroe <sjmunroe@us.ibm.com>
1423 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1424 (SINGLE_THREAD_P): Fix typo.
1425 * tst-cancel-wrappers.sh: Handle '.'ed symbols.
1427 2003-03-31 Ulrich Drepper <drepper@redhat.com>
1429 * Makefile (tests): Add tst-align.
1430 * tst-align.c: New file.
1431 * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
1433 * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
1436 * tst-tsd2.c: Add casts to avoid warnings.
1438 2003-03-30 Ulrich Drepper <drepper@redhat.com>
1440 * descr.h (struct pthread): Move most often used elements to the front.
1442 2003-03-29 Ulrich Drepper <drepper@redhat.com>
1444 * Makefile (libpthread-routines): Add pthread_atfork.
1445 (libpthread-static-only-routines): Add pthread_atfork.
1447 2003-03-28 Kaz Kojima <kkojima@rr.iij4u.or.jp>
1449 * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
1451 (INSTALL_DTV): Add parens.
1452 (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
1453 Use passed descr instead of THREAD_SELF.
1454 * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
1455 (__lll_mutex_timedlock_wait): Correct expected value after
1457 * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
1458 Release lock before waking up the waiters.
1459 * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
1460 criteria. Reorderstruct passed to cleanup handler. Fix
1461 handling of cancellation and failung pthread_mutex_unlock call.
1462 Use __pthread_enable_asynccancel_2 instead of
1463 __pthread_enable_asynccancel.
1464 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1465 Return result of lock re-get if it fails.
1466 * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
1467 for __pthread_cleanup_push.
1468 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
1469 completely broken rwlock implementation.
1470 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1471 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1472 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1473 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1474 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1475 * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value. Use
1476 versioned_symbol macro.
1477 * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
1478 * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
1480 2003-03-27 Ulrich Drepper <drepper@redhat.com>
1482 * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
1483 __timer_helper_thread. Declare __start_helper_thread, __helper_once,
1485 (struct timer): Remove th and bar field.
1486 * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
1487 debugging code. Create only one helper thread.
1488 * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
1490 * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1491 Renamed. Define statically. Use thread info from siginfo.
1492 (__helper_once): New variable.
1493 (__helper_tid): New variable.
1494 (__reset_helper_control): New function.
1495 (__start_helper_thread): New function.
1497 * pthread_create.c (start_thread): Don't use setjmp inside
1498 __builtin_expect to work around gcc bug.
1500 * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
1501 timer_delete syscall fails, but not with ENOSYS, set
1504 * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
1505 (timer_settime): Fix typo.
1506 * sysdeps/unix/sysv/linux/timer_getoverr.c
1507 [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
1509 2003-03-27 Jakub Jelinek <jakub@redhat.com>
1511 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
1512 offset of cleanupbuf.__prev.
1514 2003-03-26 Jakub Jelinek <jakub@redhat.com>
1516 * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
1519 2003-03-26 Ulrich Drepper <drepper@redhat.com>
1521 * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
1522 NULL provide default definition to syscall.
1524 2003-03-25 Roland McGrath <roland@redhat.com>
1526 * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
1527 (timer_id2ptr): Fix typo.
1529 2003-03-25 Ulrich Drepper <drepper@redhat.com>
1531 * pthreadP.h: Define SIGCANCEL and SIGTIMER.
1532 * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
1533 * sysdeps/ia64/pthreaddef.h: Likewise.
1534 * sysdeps/powerpc/pthreaddef.h: Likewise.
1535 * sysdeps/s390/pthreaddef.h: Likewise.
1536 * sysdeps/sh/pthreaddef.h: Likewise.
1537 * sysdeps/x86_64/pthreaddef.h: Likewise.
1538 * init.c (__pthread_initialize_minimal): Block SIGTIMER.
1539 * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
1541 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
1542 SIGTIMER is not unblocked.
1543 * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
1545 * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
1547 * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
1548 pass pointer through as ID.
1549 * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
1550 * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
1551 * sysdeps/unix/sysv/linux/timer_create.c: New file.
1552 * sysdeps/unix/sysv/linux/timer_delete.c: New file.
1553 * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
1554 * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
1555 * sysdeps/unix/sysv/linux/timer_routines.c: New file.
1556 * sysdeps/unix/sysv/linux/timer_settime.c: New file.
1557 * sysdeps/unix/sysv/linux/ia64/Versions: New file.
1558 * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
1559 * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
1560 * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
1561 * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
1562 * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
1563 * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
1564 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
1565 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
1566 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
1567 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
1568 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
1569 * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
1570 * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
1571 * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
1572 * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
1573 * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
1574 * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
1575 * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
1576 * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
1577 * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
1578 * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
1579 * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
1580 * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
1581 * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
1583 * pthreadP.h: Remove FRAME_LEFT definition.
1584 * cleanup.c (_pthread_cleanup_push): Don't check for reference to
1585 already left frame. Programs which have this problem are not POSIX
1587 * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
1589 2003-03-24 Ulrich Drepper <drepper@redhat.com>
1591 * sysdeps/pthread/tst-timer.c: Check return values of the
1594 2003-03-23 Roland McGrath <roland@redhat.com>
1596 * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
1597 * tst-tls3mod.c: Likewise.
1598 * tst-tls1.c: Likewise.
1599 * tst-tls2.c: Likewise.
1601 * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
1604 * tst-join5.c (tf1, tf2): Add a cast.
1606 * Makeconfig (includes): Append -I$(..)nptl to this variable.
1608 * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
1609 Don't test anything.
1610 * tst-cond4.c: Likewise.
1611 * tst-cond6.c: Likewise.
1612 * tst-flock2.c: Likewise.
1613 * tst-mutex4.c: Likewise.
1614 * tst-rwlock4.c: Likewise.
1615 * tst-signal1.c: Likewise.
1616 * tst-spin2.c: Likewise.
1617 * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
1619 * tst-mutex4.c: Use test-skeleton.c.
1620 * tst-spin2.c: Likewise.
1621 * tst-sysconf.c: Likewise.
1622 * tst-barrier2.c: Likewise.
1623 * tst-cond4.c: Likewise.
1624 * tst-cond6.c: Likewise.
1625 * tst-rwlock4.c: Likewise.
1626 * tst-unload.c: Likewise.
1627 * tst-flock2.c (do_test): Use return instead of exit.
1629 2003-03-22 Jakub Jelinek <jakub@redhat.com>
1631 * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
1633 2003-03-21 Ulrich Drepper <drepper@redhat.com>
1635 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
1636 (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
1637 instead of __lll_compare_and_swap.
1638 * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
1640 Removed definition if __lll_compare_and_swap.
1642 * cancellation.c: Adjust for new form of compare&exchange macros.
1643 * cleanup_defer.c: Likewise.
1645 * libc-cancellation.c: Likewise.
1646 * old_pthread_cond_broadcast.c: Likewise.
1647 * old_pthread_cond_signal.c: Likewise.
1648 * old_pthread_cond_timedwait.c: Likewise.
1649 * old_pthread_cond_wait.c: Likewise.
1650 * pthread_cancel.c: Likewise.
1651 * pthread_create.c: Likewise.
1652 * pthread_detach.c: Likewise.
1653 * pthread_join.c: Likewise.
1654 * pthread_key_delete.c: Likewise.
1655 * pthread_setcancelstate.c: Likewise.
1656 * pthread_setcanceltype.c: Likewise.
1657 * pthread_timedjoin.c: Likewise.
1658 * pthread_tryjoin.c: Likewise.
1659 * sysdeps/pthread/createthread.c: Likewise.
1661 2003-03-20 Ulrich Drepper <drepper@redhat.com>
1663 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
1664 Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
1665 definitions. Replace uses with calls to atomic_* functions.
1666 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1667 * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
1668 __lll_test_and_set calls with atomic_exchange_and_add and
1669 atomic_exchange calls respectively.
1670 * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1671 * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1672 * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
1673 * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1674 * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
1675 * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
1676 * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
1678 * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
1679 returns the old value.
1681 2003-03-20 Martin Schwidefsky <sky@mschwid3.boeblingen.de.ibm.com>
1683 * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
1684 int for variable OLDVAL and correct inline assembler contraint.
1685 * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
1686 type int for variable OLD.
1688 * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
1690 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1691 (SINGLE_THREAD_P): Use global variable __local_multiple_threads
1692 instead of multiple_threads field in the TCB.
1694 2003-03-19 Ulrich Drepper <drepper@redhat.com>
1696 * sysdeps/i386/i686/bits/atomic.h: Removed.
1697 * sysdeps/i386/i586/bits/atomic.h: Removed.
1698 * sysdeps/i386/i486/bits/atomic.h: Removed. Moved to glibc.
1699 * sysdeps/x86_64/bits/atomic.h: Removed. Moved to glibc.
1700 * sysdeps/s390/bits/atomic.h: Removed. Moved to glibc.
1701 * sysdeps/sh/bits/atomic.h: Removed. Moved to glibc.
1702 * sysdeps/ia64/bits/atomic.h: Removed. Moved to glibc.
1703 * sysdeps/powerpc/bits/atomic.h: Removed. Moved to glibc.
1704 * atomic.h: Removed. Moved to glibc.
1706 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
1707 support for clock selection.
1709 * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
1712 2003-03-18 Roland McGrath <roland@redhat.com>
1714 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
1715 Add __lll_rel_instr first. Add memory clobber.
1716 (lll_mutex_unlock): Use __lll_test_and_set.
1717 From Paul Mackerras <paulus@samba.org>.
1719 * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
1721 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1722 (SINGLE_THREAD_P): Add `header.' prefix.
1723 From Paul Mackerras <paulus@samba.org>.
1725 * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
1726 pthread_timedjoin_np to ...
1727 (libpthread: GLIBC_2.3.3): ... here.
1728 (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
1730 * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1731 Avoid shadowing VAL variable.
1733 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
1736 2003-03-18 Ulrich Drepper <drepper@redhat.com>
1738 * Makefile (tests): Add tst-cond11.
1739 * tst-cond11.c: New file.
1741 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
1742 struct passed to cleanup handler to eliminate one more
1744 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1746 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1747 (pthrad_cond_t): Replace __unused field with __clock.
1749 * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
1750 waken all waiters in cleanup handler.
1751 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1752 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1754 * pthread_condattr_getclock.c: New file.
1755 * pthread_condattr_setclock.c: New file.
1756 * sysdeps/pthread/pthread.h: Declare these new functions.
1757 * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
1758 * Makefile (libpthread-routines): Add the new functions.
1759 * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
1760 Renamed field to value. Document use of the bits.
1761 * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
1763 * pthread_condattr_setpshared.c: Likewise.
1764 * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
1765 * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
1766 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1768 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1769 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1770 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1771 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1772 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1773 Implement clock selection.
1774 * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1775 * pthread-errnos.sym: Add ENOSYS.
1776 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1777 _POSIX_CLOCK_SELECTION.
1778 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1780 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
1781 invalid .size directive.
1783 2003-03-17 Roland McGrath <roland@redhat.com>
1785 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
1788 2003-03-17 Ulrich Drepper <drepper@redhat.com>
1790 * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
1791 Use __lll_add instead of spelling it out. Use protected symbol names.
1792 * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
1794 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
1795 Renamed from lll_compare_and_swap. Use new name where necessary.
1796 (__lll_add): Defined.
1797 (__lll_dec_if_positive): Defined.
1798 (__lll_test_and_set): Defined.
1799 * sysdeps/ia64/pthread_spin_init.c: Removed.
1800 * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
1801 * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
1802 * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
1803 * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
1804 * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
1805 * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
1806 * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
1807 * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
1808 * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1809 __sync_lock_release_si.
1810 Patch by Jakub Jelinek.
1812 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
1813 Fix timeout handling.
1814 (__lll_timedwait_tid): Likewise.
1815 (lll_unlock_wake_cb): Wake up other waiters if necessary.
1816 Patch by Jakub Jelinek.
1818 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
1820 2003-03-17 Roland McGrath <roland@redhat.com>
1822 PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
1823 * sysdeps/pthread/pthread_spin_init.c: New file.
1824 * sysdeps/pthread/pthread_spin_unlock.c: New file.
1825 * sysdeps/powerpc/Makefile: New file.
1826 * sysdeps/powerpc/pthread_spin_lock.c: New file.
1827 * sysdeps/powerpc/pthread_spin_trylock.c: New file.
1828 * sysdeps/powerpc/pthreaddef.h: New file.
1829 * sysdeps/powerpc/tcb-offsets.sym: New file.
1830 * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
1831 * sysdeps/powerpc/tls.h: New file.
1832 * sysdeps/powerpc/bits/atomic.h: New file.
1833 * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
1834 * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
1835 * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
1837 * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
1838 * sysdeps/unix/sysv/linux/sem_post.c: New file.
1839 * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
1840 * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
1841 * sysdeps/unix/sysv/linux/sem_wait.c: New file.
1842 * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
1843 * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
1844 * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
1845 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
1846 * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
1847 * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
1848 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
1849 * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
1850 * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
1851 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
1853 * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
1855 * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
1856 * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
1857 * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
1858 * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
1859 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
1861 2003-03-17 Ulrich Drepper <drepper@redhat.com>
1863 * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
1864 * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1865 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1866 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1867 Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
1869 2003-03-16 Roland McGrath <roland@redhat.com>
1871 * tst-fork4.c: Include <string.h>.
1872 * tst-signal2.c: Likewise.
1873 * tst-mutex5.c (do_test): exit -> return.
1874 * tst-mutex2.c: Include <stdlib.h>.
1876 2003-03-16 Ulrich Drepper <drepper@redhat.com>
1878 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
1879 (__lll_mutex_timedlock_wait): Correct expected value after
1880 spurious wakeup. Otherwise we would never wait again.
1882 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
1883 zone versus inline asm stupidity. Use correct instructions.
1885 * tst-rwlock6.c: Add some more status output.
1887 2003-03-15 Roland McGrath <roland@redhat.com>
1889 * sysdeps/pthread/configure.in: New file.
1890 * sysdeps/pthread/configure: New file (generated).
1892 2003-03-15 Ulrich Drepper <drepper@redhat.com>
1894 * allocatestack.c (allocate_stack): Store the exact stack size of
1895 user allocated stacks.
1897 2003-03-15 Jakub Jelinek <jakub@redhat.com>
1899 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1900 (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
1901 * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
1902 * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
1903 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1904 Use `header.' prefix.
1905 * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
1907 2003-03-15 Ulrich Drepper <drepper@redhat.com>
1909 * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
1910 __builtin_frame_address, use stack pointer.
1912 * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
1913 instead of __builtin_frame_pointer.
1915 2003-03-14 Ulrich Drepper <drepper@redhat.com>
1917 * tst-basic1.c (do_test): Add cast to avoid warning.
1918 * tst-basic2.c (do_test): Likewise.
1920 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
1921 amount of stack correction.
1923 * tst-fork4.c: Use test-skeleton.c.
1925 2003-03-14 Roland McGrath <roland@redhat.com>
1927 * init.c: Fix typo "#eli" for "#else".
1929 2003-03-14 Steven Munroe <sjmunroe@us.ibm.com>
1931 * allocatestack.c (__stack_user): Use hidden_data_def.
1932 * pthread_create.c (__pthread_keys): Likewise.
1934 * init.c [__powerpc__] (__NR_set_tid_address): Define it.
1936 2003-03-14 Roland McGrath <roland@redhat.com>
1938 * tst-fork4.c: New file.
1939 * Makefile (tests): Add it.
1941 * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
1942 we always define the padding space.
1943 [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
1944 stopped supporting its own extensions fully.
1945 [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
1946 struct also called `header', so `header.multiple_threads' is the field
1947 name to use on all machines.
1948 * allocatestack.c (allocate_stack): Use `header.' prefix.
1949 * sysdeps/pthread/createthread.c (create_thread): Likewise.
1950 * pthread_create.c (__pthread_create_2_1): Likewise.
1951 * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
1952 (THREAD_SELF): Likewise.
1953 * sysdeps/x86_64/tls.h: Likewise.
1954 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
1955 (SINGLE_THREAD_P): Likewise.
1956 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
1957 (SINGLE_THREAD_P): Likewise.
1958 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1959 (SINGLE_THREAD_P): Likewise.
1961 * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
1964 2003-03-14 Ulrich Drepper <drepper@redhat.com>
1966 * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
1967 * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
1969 * pthread_create.c (start_thread): setjmp is expected to return 0.
1971 * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
1972 (THREAD_GETMEM_NC): Likewise.
1974 2003-03-13 Ulrich Drepper <drepper@redhat.com>
1976 * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
1977 and the size of the stack which must be allocated is a multiple,
1978 allocate one more page.
1979 * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
1980 MULTI_PAGE_ALIASING.
1982 2003-03-13 Roland McGrath <roland@redhat.com>
1984 * pthread_create.c (start_thread): Set EXITING_BIT after the
1985 event-reporting (and destructors), not before.
1987 2003-03-13 Jakub Jelinek <jakub@redhat.com>
1989 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
1990 lll_futex_wake): Declare register variables as long int instead of
1991 unsigned long int. Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
1992 Make syscall arguments clobbered by the syscall.
1993 (lll_futex_wait): Define using lll_futex_timed_wait.
1995 * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
1998 * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
2001 * allocatestack.c (nptl_ncreated): Only declare if
2002 COLORING_INCREMENT != 0.
2004 * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
2005 (__libc_enable_asynccancel_2): Remove prototype.
2007 * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
2008 ctid to match kernel.
2010 2003-03-12 Ulrich Drepper <drepper@redhat.com>
2012 * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
2013 libc_multiple_threads.
2014 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
2015 __libc_multiple_threads to...
2016 * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here. New file.
2018 * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
2020 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2021 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2023 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
2024 (__pthread_once_internal): Define.
2026 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
2027 macros instead of .symver directly.
2028 * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2029 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2031 * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
2032 * sysdeps/x86_64/tcb-offsets.sym: New file.
2033 * sysdeps/x86_64/Makefile: New file.
2035 * sysdeps/i386/tcb-offsets.sym: Add SELF.
2036 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
2037 to access own pthread_t in TCB.
2038 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2040 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2042 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2044 2003-03-12 Roland McGrath <roland@redhat.com>
2046 * pthread-errnos.sym: New file.
2047 * Makefile (gen-as-const-headers): New variable, list that file.
2048 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
2049 header <pthread-errnos.h> instead of defining errno values here.
2050 * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2051 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2052 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2053 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2054 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2056 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2058 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2059 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2060 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
2061 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2062 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2063 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2064 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2065 * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2066 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2067 * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
2068 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2069 * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
2070 * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2071 * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
2072 * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
2073 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2074 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2075 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2076 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2077 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
2078 * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2079 * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
2080 * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
2081 * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
2082 * sysdeps/sh/pthread_spin_trylock.S: Likewise.
2083 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2084 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2086 * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
2087 CLONE_CHILD_SETTID worked.
2089 2003-03-12 Ulrich Drepper <drepper@redhat.com>
2091 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
2093 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
2096 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
2097 (pthread_cond_t): Add padding.
2099 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
2100 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
2101 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
2103 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
2104 (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
2105 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
2106 (__pthread_rwlock_timedrdlock): Likewise.
2107 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
2108 (__pthread_rwlock_wrlock): Likewise.
2109 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
2110 (__pthread_rwlock_rdlock): Likewise.
2112 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
2114 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
2115 result of lock re-get if it fails.
2117 2003-03-11 Ulrich Drepper <drepper@redhat.com>
2119 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
2120 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2121 * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
2122 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2123 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2124 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
2125 * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2126 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2127 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2128 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2130 * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
2131 THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
2133 * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
2134 Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
2135 * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
2136 (create_thread): Likewise.
2137 Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
2138 * init.c (__pthread_initialize_minimal_internal): Initialize
2139 __libc_multiple_threads_ptr if necessary.
2140 * pthreadP.h: Adjust prototype for __libc_pthread_init. Declare
2141 __pthread_multiple_threads and __libc_multiple_threads_ptr.
2142 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
2143 __libc_multiple_threads.
2144 (__libc_pthread_init): Return pointer to __libc_pthread_init if
2147 * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
2148 (THREAD_SETMEM_NC): Likewise.
2150 * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
2151 * sysdeps/x86_64/pthread_spin_trylock.S: New file.
2152 * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
2153 * sysdeps/x86_64/pthread_spin_unlock.S: New file.
2155 * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
2156 Eliminate one entire instruction.
2158 * cancellation.c (__pthread_enable_asynccancel_2): New function.
2159 * pthreadP.h: Declare __pthread_enable_asynccancel_2.
2160 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2161 (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
2162 instead of __pthread_enable_asynccancel.
2163 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2164 (__pthread_cond_wait): Likewise.
2165 * sysdeps/pthread/pthread_cond_timedwait.c
2166 (__pthread_cond_timedwait): Likewise.
2167 * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2169 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2170 (__condvar_cleanup): Wake up all waiters in case we got signaled
2171 after being woken up but before disabling asynchronous
2173 * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
2174 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2175 (__condvar_cleanup): Likewise.
2177 * init.c (__NR_set_tid_address): If already defined, don't redefine.
2178 Make it an error if architecture has no #if case. Add x86-64.
2180 * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
2181 pt-initfini.s generation.
2183 * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
2184 (TLS_INIT_TP): Fix typo.
2186 2003-03-11 Jakub Jelinek <jakub@redhat.com>
2188 * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
2189 3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
2191 * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
2192 * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
2193 * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
2194 * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
2195 * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
2196 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
2197 * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
2198 * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
2200 2003-03-11 Ulrich Drepper <drepper@redhat.com>
2202 * sysdeps/pthread/pthread_cond_timedwait.c
2203 (__pthread_cond_timedwait): Return the result of the final
2204 locking. If it succeeds, the regular function return value.
2206 * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
2207 Return result of the final locking.
2208 * version.c (__nptl_main): Work around problems with the strange
2209 INTERNAL_SYSCALL macro on ppc32.
2210 * init.c (__pthread_initialize_minimal_internal): Unblock
2211 SIGCANCEL in case the parent blocked it.
2212 Reported by Paul Mackerras <paulus@samba.org>.
2214 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
2215 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
2216 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
2218 2003-03-11 Jakub Jelinek <jakub@redhat.com>
2220 * sysdeps/pthread/pthread_cond_timedwait.c
2221 (__pthread_cond_timedwait): Unlock and fail if
2222 __pthread_mutex_unlock_internal failed.
2224 * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
2225 (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
2227 * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
2228 [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
2229 STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
2230 ALLOCATE_STACK): New macros.
2231 (TLS_TPADJ): New macro.
2232 (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
2233 (allocate_stack): Handle TLS_DTV_AT_TP and
2234 NEED_SEPARATE_REGISTER_STACK. Use TLS_TPADJ.
2235 * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
2237 * init.c [__ia64__] (__NR_set_tid_address): Define.
2239 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
2240 * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
2241 * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
2242 * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
2243 * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
2244 * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
2245 * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
2246 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
2247 * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
2248 * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
2249 * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
2250 * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
2251 * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
2252 * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
2253 * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
2254 * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
2255 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
2256 * sysdeps/ia64/bits/atomic.h: New file.
2257 * sysdeps/ia64/Makefile: New file.
2258 * sysdeps/ia64/pthread_spin_init.c: New file.
2259 * sysdeps/ia64/pthread_spin_lock.c: New file.
2260 * sysdeps/ia64/pthread_spin_trylock.c: New file.
2261 * sysdeps/ia64/pthread_spin_unlock.c: New file.
2262 * sysdeps/ia64/pthreaddef.h: New file.
2263 * sysdeps/ia64/tcb-offsets.sym: New file.
2264 * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
2265 * sysdeps/ia64/tls.h: New file.
2267 * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
2268 to syscall instead of no arguments.
2270 2003-03-10 Ulrich Drepper <drepper@redhat.com>
2272 * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
2273 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
2274 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
2275 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
2277 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
2280 * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
2282 * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2283 lowlevelbarrier.sym.
2284 * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
2285 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
2286 Include lowlevelbarrier.h and don't define offsets locally.
2287 * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
2289 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2290 (__lll_mutex_lock_wait): Reverse order of first two parameters.
2291 (__lll_mutex_timedlock_wait): Likewise.
2292 (lll_mutex_lock): Adjust asm for that.
2293 (lll_mutex_timedlock): Likewise. Mark cx, cc, r10 as clobbered.
2294 (lll_lock): Adjust asm for operand order change.
2295 * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
2296 * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
2298 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
2299 Reverse order of parameters.
2300 (__lll_timedwait_tid): Remove regparms attribute.
2301 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
2302 * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
2304 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2305 (__lll_timedwait_tid): Remove one unnecessary instruction.
2307 * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
2308 __lll_mutex_timedlock_wait only for NOT_IN_libc.
2309 * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
2312 * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
2313 lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
2315 * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
2318 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
2319 LOCK is already defined. Don't define __lll_mutex_timedlock_wait
2321 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
2322 define LOCK here (if UP is not defined). The actual code is in
2325 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
2326 LOCK is already defined. Don't define lll_unlock_wake_cb and
2327 __lll_timedwait_tid for libc.so.
2328 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
2329 define LOCK here (if UP is not defined). The actual code is in
2332 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
2333 * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
2334 * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
2335 instead of lowlevelsem.h.
2336 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
2337 * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
2338 * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
2340 * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2342 * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
2343 * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
2344 * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
2346 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
2348 * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
2351 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
2353 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
2354 of __libc_locking_needed.
2355 (lll_trylock): Initialize %eax to zero.
2357 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
2358 pthread_cond_t definition.
2360 2003-03-10 Roland McGrath <roland@redhat.com>
2362 * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
2363 * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
2364 * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
2365 * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
2366 * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
2368 * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
2369 Instead of setting PD->multiple_threads, set globals
2370 __pthread_multiple_threads and __libc_multiple_threads.
2371 * sysdeps/pthread/createthread.c (create_thread): Likewise.
2372 * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
2373 * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
2375 * descr.h (struct pthread): Conditionalize first member on
2376 [!TLS_DTV_AT_TP]. Replace the `header' member with an anonymous union
2377 containing an anonymous tcbhead_t. Move `list' member out.
2378 [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
2379 * allocatestack.c: Remove use of `header.data.' prefix.
2380 * pthread_create.c: Likewise.
2381 * init.c (__pthread_initialize_minimal_internal): Likewise.
2382 * sysdeps/pthread/createthread.c (create_thread): Likewise.
2383 * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
2384 (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
2385 * sysdeps/x86_64/tls.h: Likewise.
2386 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
2387 (SINGLE_THREAD_P): Likewise.
2388 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
2389 (SINGLE_THREAD_P): Likewise.
2390 * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
2391 * sysdeps/s390/tls.h (tcbhead_t): Likewise.
2393 2003-03-09 Ulrich Drepper <drepper@redhat.com>
2395 * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
2397 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
2398 * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
2400 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
2401 leftovers from the ia32 code.
2403 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
2405 (clear_once_control): Don't load %esi.
2407 * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
2410 * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
2412 * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
2413 * sysdeps/unix/sysv/linux/createthread.c: ...here.
2415 * Makefile (tests): Add tst-cond10.
2416 * tst-cond10.c: New file.
2418 2003-03-08 Ulrich Drepper <drepper@redhat.com>
2420 * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
2421 * tst-signal3.c (do_test): Likewise.
2422 * tst-sem5.c (do_test): Likewise.
2423 * tst-kill6.c (do_test): Likewise.
2424 * tst-tls3.c (do_test): Likewise. Include <errno.h>.
2426 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
2428 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
2429 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
2430 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2431 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2432 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2433 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2434 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2436 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2438 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2439 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2440 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2441 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2442 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2443 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2444 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
2445 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2447 * allocatestack.c (allocate_stack): If mprotect() fails free the
2450 2003-03-07 Ulrich Drepper <drepper@redhat.com>
2452 * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
2454 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
2455 lll_wake_tid. This was used only to work around kernel limits in
2457 * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2458 * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
2459 * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2460 * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2462 * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
2463 (__pthread_initialize_minimal_internal): Change initialization of
2464 __static_tls_align_m1 appropriately.
2465 * pthreadP.h (__static_tls_align_m1): Renamed from
2467 * allocatestack.c (allocate_stack): Use __static_tls_align_m1
2468 instead of __static_tls_align-1.
2470 2003-03-04 Ulrich Drepper <drepper@redhat.com>
2472 * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
2474 * pthread_create.c: Define __pthread_keys using nocommon
2475 attribute, not by placing it explicitly in bss.
2476 Remove DEFINE_DEALLOC definition. Not needed anymore.
2478 * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
2479 Use it in mmap call to allocate stacks.
2481 * sysdeps/pthread/createthread.c (create_thread): Fix comment.
2483 * pthread_create.c (start_thread): Use THREAD_SETMEM to store
2484 result of the thread function.
2486 2003-03-03 Ulrich Drepper <drepper@redhat.com>
2488 * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed. The generic
2489 version is just fine.
2491 * sysdeps/unix/sysv/linux/libc_pthread_init.c
2492 (__pthread_child_handler): Renamed from pthread_child_handler,
2493 exported, and marked hidden. Change all users.
2494 * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
2495 free __pthread_child_handler from child list.
2497 2003-03-03 Martin Schwidefsky <schwidefsky@de.ibm.com>
2499 * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
2501 * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2502 Fix handling of cancellation and failing pthread_mutex_unlock call.
2503 * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
2504 (__pthread_cond_wait): Likewise.
2506 * sysdeps/pthread/pthread_rwlock_timedrdlock.c
2507 (pthread_rwlock_timedrdlock): Fix clobber of result variable by
2508 lll_futex_timed_wait call.
2509 * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2510 (pthread_rwlock_timedwrlock): Likewise.
2512 * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2513 Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
2514 * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
2516 * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
2517 check of lll_futex_wake return value.
2519 2003-03-03 Roland McGrath <roland@redhat.com>
2521 * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
2523 * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2524 Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
2525 * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2527 2003-03-02 Ulrich Drepper <drepper@redhat.com>
2529 * sysdeps/pthread/timer_create.c (timer_create): Return correct
2530 error for CPU clocks.
2532 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2533 _POSIX_MONOTONIC_CLOCK.
2534 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2536 * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
2539 2003-03-01 Ulrich Drepper <drepper@redhat.com>
2541 * descr.h (struct pthread): Move cleanup field to the front.
2543 2003-03-01 Roland McGrath <roland@redhat.com>
2545 * sem_open.c (sem_open): Braino fix.
2547 2003-03-01 Ulrich Drepper <drepper@redhat.com>
2549 * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
2550 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
2551 __pthread_cleanup_pop functionality.
2552 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2554 * descr.h (struct pthread): Move tid field to the front now that
2557 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
2558 (__lll_mutex_timedlock_wait): Remove.
2559 (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
2560 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2561 (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
2562 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2563 (lll_unlock_wake_cb): Don't save and restore %esi.
2564 (__lll_unlock_wake): Add alignment. Don't save, load, and restore
2566 (__lll_timedwait_tid): Add alignment.
2567 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
2568 (__lll_unlock_wake): Add alignment. Don't save, load, and restore
2570 (__lll_timedwait_tid): Removed.
2571 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2572 (__pthread_cond_broadcast): Don't save, load, and restore %esi.
2573 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
2574 (pthread_barrier_wait): Don't save, load, and restore %esi for
2576 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2577 (__pthread_cond_signal): Don't save, load, and restore %esi.
2578 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
2579 (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
2580 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
2581 Don't save, load, and restore %esi.
2583 2003-02-27 Ulrich Drepper <drepper@redhat.com>
2585 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
2586 Release lock before waking up the waiters.
2588 * tst-exit1.c (do_test): Don't start more than one thread in parallel.
2590 * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
2591 (reader_thread): Likewise.
2593 * sysdeps/pthread/pthread_rwlock_unlock.c
2594 (__pthread_rwlock_unlock): Release internal lock early. Don't try
2595 to wake up readers if there are none.
2597 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
2598 Release internal lock before wake threads.
2600 2003-02-26 Ulrich Drepper <drepper@redhat.com>
2602 * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
2603 * tst-rwlock8.c: Initialize lock with INIT. Allow INIT to be
2605 * tst-rwlock9.c: Likewise.
2606 * tst-rwlock10.c: New file.
2607 * tst-rwlock11.c: New file.
2609 * Makefile (tests): Add tst-dlsym1.
2610 * tst-dlsym1.c: New file.
2612 * init.c (__pthread_initialize_minimal_internal): Set
2613 GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
2614 * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
2616 2003-02-24 Ulrich Drepper <drepper@redhat.com>
2618 * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
2620 * tst-cond2.c: Fix sychronization with child.
2622 * tst-rwlock8.c (reader_thread): Remove unused variable.
2624 * Makefile: Add rules to build and run tst-tls3.
2625 * tst-tls3.c: New file.
2626 * tst-tls3mod.c: New file.
2628 * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
2629 * tst-rwlock8.c: New file.
2630 * tst-rwlock9.c: New file.
2631 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
2632 complete broken rwlock implementation.
2633 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2635 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2637 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2638 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2639 * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2640 * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2641 * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
2642 * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
2643 * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2645 2003-02-23 Roland McGrath <roland@redhat.com>
2647 * Makefile (nptl-version): Change regexp so case sensitivity is ok.
2649 2003-02-23 Ulrich Drepper <drepper@redhat.com>
2651 * Makefile (tests): Add tst-context1.
2652 * tst-context1.c: New file.
2654 * Makefile (tests): Add tst-tls1 and tst-tls2.
2655 * tst-tls1.c: New file.
2656 * tst-tls2.c: New file.
2658 * libc-cancellation.c (__libc_enable_asynccancel): Correct test
2661 * pthread_create.c (start_thread): Set EXITING_BIT early.
2663 * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
2664 (THREAD_GETMEM_NC): Likewise.
2666 2003-02-22 Ulrich Drepper <drepper@redhat.com>
2668 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
2669 off 3 more bytes by using offset-less instructions when possible.
2671 * Makefile: Add dependency for $(objpfx)version.d.
2673 * eintr.c (eintr_source): Add unnecessary return but the compiler
2676 * tst-kill3.c: Include <unistd.h>.
2678 2003-02-21 Roland McGrath <roland@redhat.com>
2680 * pthread_create.c (start_thread): Call __libc_thread_freeres.
2682 2003-02-21 Ulrich Drepper <drepper@redhat.com>
2684 * Makefile (tests): Add tst-eintr1.
2685 (distribute): Add eintr.c.
2686 * tst-eintr1.c: New file.
2687 * eintr.c: New file.
2689 * pthread_cancel.c (pthread_cancel): Use tkill directly.
2691 * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
2692 Disallow sending SIGCANCEL.
2694 * Makefile (tests): Remove tst-basic7. Add tst-kill1, tst-kill2,
2695 tst-kill3, tst-kill4, tst-kill5, tst-kill6.
2696 * tst-kill1.c: New file.
2697 * tst-kill2.c: New file.
2698 * tst-kill3.c: New file.
2699 * tst-kill5.c: New file.
2700 * tst-kill6.c: New file.
2701 * tst-basic7.c: Renamed to...
2702 * tst-kill4.c: ...this.
2704 2003-02-21 Roland McGrath <roland@redhat.com>
2706 * Makefile (install-lib-ldscripts): New variable.
2708 2003-02-21 Ulrich Drepper <drepper@redhat.com>
2710 * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
2711 * pthread_cancel.c: Use INVALID_TD_P.
2712 * pthread_detach.c: Likewise.
2713 * pthread_getschedparam.c: Likewise.
2714 * pthread_setschedparam.c: Likewise.
2715 * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2716 * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2717 * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
2718 * pthread_timedjoin.c: Likewise.
2720 * tst-basic7.c: Include <signal.h>.
2722 * pthread_join.c (pthread_join): Limited checking for invalid
2724 * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
2726 2003-02-20 Ulrich Drepper <drepper@redhat.com>
2728 * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
2729 beginning of the loop. Clear the entire first block of TSD.
2730 * Makefile (tests): Add tst-key4.
2731 * tst-key4.c: New file.
2733 2003-02-18 Ulrich Drepper <drepper@redhat.com>
2735 * Makefile (tests): Add tst-basic7.
2736 * tst-basic7.c: New file.
2738 * pthread_create.c (deallocate_tsd): Mark as internal_function.
2739 Add some more __builtin_expect.
2741 * pthreadP.h: Define dummy version of DEBUGGING_P.
2743 2003-02-17 Ulrich Drepper <drepper@redhat.com>
2745 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
2746 _POSIX_THREAD_PRIORITY_SCHEDULING.
2747 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
2748 _XOPEN_REALTIME_THREADS.
2749 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
2751 * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
2752 kernel returns EINVAL for PID <= 0, work around it.
2754 * Makefile (tests): Add tst-signal5.
2755 * tst-signal5.c: New file.
2757 * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
2760 * tst-cancel1.c (tf): Block all signals.
2762 * Makefile (tests): Add tst-basic6.
2763 * tst-basic6.c: New file.
2765 * tst-basic1.c: Add test for process ID.
2767 * Makefile (tests): Add tst-cancel10.
2768 * tst-cancel10.c: New file.
2770 * Makefile (tests): Add tst-signal4.
2771 * tst-signal4.c: New file.
2773 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
2774 __sigismember instead of sigismember. Add __builtin_expect.
2776 2003-02-16 Ulrich Drepper <drepper@redhat.com>
2778 * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
2779 pthread_setcancelstate, and pthread_rwlock_setpshared.
2781 * tst-cancel7.c (do_test): Make sure the pid file exists before
2782 canceling the thread.
2784 * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
2785 pthread_rwlock_timedrdlock tests.
2786 * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
2787 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2788 Check for invalid tv_nsec field.
2789 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2792 * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
2793 recursive mutex of overflow.
2795 * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
2797 * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
2798 going into an endless loop.
2799 * Makefile (tests): Add tst-cancel9.
2800 * tst-cancel9.c: New file.
2802 * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
2804 2003-02-15 Ulrich Drepper <drepper@redhat.com>
2806 * tst-mutex5.c (do_test): Add more timedlock tests.
2808 * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
2809 * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
2811 * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
2812 use INLINE_SYSCALL. Error number is returned, not -1.
2814 * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
2815 and __deallocate_stack with internal_function.
2816 * pthread_create.c: Adjust definitions appropriately.
2817 * allocatestack.c: Likewise.
2819 * pthread_join.c: Add one more __builtin_expect.
2820 * pthread_timedjoin.c: Likewise.
2822 * pthread_getspecific.c (__pthread_getspecific): Clear data->data
2823 not data of sequence number does not match.
2824 Add one __builtin_expect.
2826 * Makefile (tests): Add tst-clock1.
2827 * tst-clock1.c: New file.
2829 * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
2831 * Makefile (tests): Add tst-basic5.
2832 * tst-basic5.c: New file.
2834 2003-02-14 Ulrich Drepper <drepper@redhat.com>
2836 * Makefile (tests): Add tst-basic4.
2837 * tst-basic4.c: New file.
2839 * pthreadP.h: Add declaraction for __nptl_nthreads.
2840 * pthread_create.c: Define __nptl_nthreads
2841 (start_thread): Increment __nptl_nthreads at beginning. Decrement
2842 after thread is done. If then zero, call exit(0).
2843 * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2844 Add ptr_nthreads. Define HAVE_PTR_NTHREADS.
2845 * init.c (pthread_functions): Initialize ptr_nthreads.
2846 * allocatestack.c (nptl_nthreads): Remove definition and all uses.
2847 (__reclaim_stacks): Decrement __nptl_nthreads.
2848 * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
2850 * Makefile (tests): Add tst-basic3.
2851 * tst-basic3.c: New file.
2853 * descr.h: Define CANCELING_BIT and CANCELING_BITMASK. Introduce
2854 after CANCELTYPE_BIT, move the other bits up. Update CANCEL_RESTMASK.
2855 * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
2856 * pthread_cancel.c (pthread_cancel): Likewise. Also set CANCELING_BIT
2857 if asynchronous canceling is enabled.
2858 * pthread_join.c (pthread_join): When recognizing circular joins,
2859 take into account the other thread might be already canceled.
2860 * Makefile (tests): Add tst-join5.
2861 * tst-join5.c: New file.
2863 * Makefile (tests): Add tst-join4.
2864 * tst-join4.c: New file.
2866 2003-02-13 Ulrich Drepper <drepper@redhat.com>
2868 * tst-cond4.c (main): Add test of pthread_attr_getpshared.
2870 2003-02-13 Martin Schwidefsky <schwidefsky@de.ibm.com>
2872 * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
2873 THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
2874 * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
2876 * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
2878 * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
2879 error if lll_futex_wake failed.
2881 2003-02-13 Ulrich Drepper <drepper@redhat.com>
2883 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
2884 handling of cancellation and failung pthread_mutex_unlock call.
2885 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2886 * Makefile (tests): Add tst-cond8 and tst-cond9.
2887 * tst-cond8.c: New file.
2888 * tst-cond9.c: New file.
2890 * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
2892 * sysdeps/pthread/pthread.h: Add missing initializers. Protect
2893 non-standard initializers with __USE_GNU.
2895 * Makefile (tests): Add tst-cleanup3.
2896 * tst-cleanup3.c: New file.
2898 2003-02-12 Ulrich Drepper <drepper@redhat.com>
2900 * Makefile (tests): Add tst-attr1 and tst-attr2.
2901 * tst-attr1.c: New file.
2902 * tst-attr2.c: New file.
2904 * Makefile: Add rules to build and run tst-atfork2 test.
2905 * tst-atfork2.c: New file.
2906 * tst-atfork2mod.c: New file.
2908 * sysdeps/unix/sysv/linux/unregister-atfork.c
2909 (__unregister_atfork): Free the memory allocated for the handlers
2910 after removing them from the lists.
2912 * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
2915 * tst-atfork1.c (do_test): Wait for the child we forked.
2916 Report error in child.
2918 * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
2920 * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
2922 2003-02-10 Ulrich Drepper <drepper@redhat.com>
2924 * Makefile (tests): Add tst-cancel8.
2925 * tst-cancel8.c: New file.
2927 * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
2928 clearing of control variable.
2929 * Makefile (tests): Add tst-once3 and tst-once4.
2930 * tst-once3.c: New file.
2931 * tst-once4.c: New file.
2933 2003-02-08 kaz Kojima <kkojima@rr.iij4u.or.jp>
2935 * sysdeps/sh/Makefile: New file.
2936 * sysdeps/sh/bits/atomic.h: New file.
2937 * sysdeps/sh/pthread_spin_init.c: New file.
2938 * sysdeps/sh/pthread_spin_lock.c: New file.
2939 * sysdeps/sh/pthread_spin_trylock.S: New file.
2940 * sysdeps/sh/pthread_spin_unlock.S: New file.
2941 * sysdeps/sh/pthreaddef.h: New file.
2942 * sysdeps/sh/tcb-offsets.sym: New file.
2943 * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
2944 * sysdeps/sh/tls.h: New file.
2945 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
2946 * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
2947 * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
2948 * sysdeps/unix/sysv/linux/sh/fork.c: New file.
2949 * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
2950 * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
2951 * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
2952 * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
2953 * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
2954 * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
2955 * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
2956 * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
2957 * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
2958 * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
2959 * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
2960 * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
2961 * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
2962 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
2963 * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
2964 * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
2965 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
2966 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
2967 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
2968 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
2969 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
2970 * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
2971 * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
2972 * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
2973 * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
2974 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
2976 2003-02-08 Ulrich Drepper <drepper@redhat.com>
2978 * tst-cond2.c: Rearrange code to not rely on behavior undefined
2981 * tst-basic2.c (do_test): Lock mutex before creating the thread.
2983 2003-02-07 Ulrich Drepper <drepper@redhat.com>
2985 * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
2986 (TLS_GET_FS): New #define.
2987 (TLS_SET_FS): New #define.
2988 Correct value of __NR_set_thread_area.
2990 * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
2992 2003-02-06 Ulrich Drepper <drepper@redhat.com>
2994 * Makefile (tests): Add tst-popen1.
2995 * tst-popen1.c: New file.
2997 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
2998 but inactive generalization.
2999 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3000 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3001 Minor optimization, remove one instruction.
3002 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3004 2003-02-04 Martin Schwidefsky <schwidefsky@de.ibm.com>
3006 * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
3008 2003-01-31 Martin Schwidefsky <schwidefsky@de.ibm.com>
3010 * init.c (__NR_set_tid_address): Add #ifdef for s390.
3011 * sysdeps/pthread/pthread_barrier_wait.c: New file.
3012 * sysdeps/pthread/pthread_cond_broadcast.c: New file.
3013 * sysdeps/pthread/pthread_cond_signal.c: New file.
3014 * sysdeps/pthread/pthread_cond_timedwait.c: New file.
3015 * sysdeps/pthread/pthread_cond_wait.c: New file.
3016 * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
3017 * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
3018 * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
3019 * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
3020 * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
3021 * sysdeps/s390/Makefile: New file.
3022 * sysdeps/s390/bits/atomic.h: New file.
3023 * sysdeps/s390/pthread_spin_init.c: New file.
3024 * sysdeps/s390/pthread_spin_lock.c: New file.
3025 * sysdeps/s390/pthread_spin_trylock.c: New file.
3026 * sysdeps/s390/pthread_spin_unlock.c: New file.
3027 * sysdeps/s390/pthreaddef.h: New file.
3028 * sysdeps/s390/tcb-offsets.sym: New file.
3029 * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
3030 * sysdeps/s390/tls.h: New file.
3031 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
3032 * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
3033 * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
3034 * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
3035 * sysdeps/unix/sysv/linux/s390/fork.c: New file.
3036 * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
3037 * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
3038 * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
3039 * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
3040 * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
3041 * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
3042 * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
3043 * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
3044 * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
3045 * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
3046 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
3047 * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
3048 * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
3049 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
3050 * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
3051 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
3052 * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
3053 * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
3055 2003-02-04 Ulrich Drepper <drepper@redhat.com>
3057 * atomic.h: Add a couple more default implementations.
3058 (atomic_compare_and_exchange_acq): Use
3059 __arch_compare_and_exchange_32_acq in return value definition. It
3061 (atomic_bit_set): Renamed from atomic_set_bit.
3062 Add missing atomic_ prefixes.
3064 * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
3065 thread library is available, use correct value to mark initialized
3068 2003-02-03 Ulrich Drepper <drepper@redhat.com>
3070 * allocatestack.c (allocate_stack): Use __getpagesize instead of
3071 __sysconf to determine pagesize.
3073 * pthread_create.c: Include <atomic.h>.
3074 * allocatestack.c (allocate_stack): Implement coloring of the
3075 allocated stack memory. Rename pagesize to pagesize_m1. It's the
3076 size minus one. Adjust users.
3077 * sysdeps/i386/i686/Makefile: New file.
3079 2003-02-02 Ulrich Drepper <drepper@redhat.com>
3081 * allocatestack.c: Improve comment throughout the file.
3083 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3084 (__lll_lock_wait): Add branch prediction.
3085 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
3086 (__lll_lock_wait): Likewise.
3087 (lll_unlock_wake_cb): Removed.
3089 2003-01-31 Ulrich Drepper <drepper@redhat.com>
3091 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
3092 _POSIX_THREAD_PRIORITY_SCHEDULING.
3094 2003-01-30 Jakub Jelinek <jakub@redhat.com>
3096 * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3097 Fix return type of ptr___pthread_getspecific.
3099 2003-01-29 Ulrich Drepper <drepper@redhat.com>
3101 * Makefile (tests): Add tst-umask1.
3102 (tst-umask1-ARGS): Define.
3103 * tst-umask1.c: New file.
3105 2003-01-28 Ulrich Drepper <drepper@redhat.com>
3107 * Makefile (libpthread-routines): Remove lowlevelrwlock. Add
3108 pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
3109 pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
3110 pthread_rwlock_unlock.
3111 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
3112 * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
3113 * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
3114 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
3115 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3117 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
3118 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3120 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
3121 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
3122 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
3124 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
3125 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
3127 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
3128 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
3129 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
3131 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
3132 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
3134 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
3136 * Makefile (libpthread-routines): Remove lowlevelcond and
3137 lowlevelsem. Add sem_wait, sem_trywait, sem_timedwait, sem_post,
3138 pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
3139 and pthread_cond_broadcast.
3140 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
3141 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
3142 * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
3143 * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
3144 * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
3145 * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
3146 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
3147 * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
3148 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
3149 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
3150 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
3151 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
3152 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
3153 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
3154 * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
3155 * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
3156 * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
3157 * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
3158 * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
3159 * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
3160 * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
3161 * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
3162 * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
3163 * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
3164 * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
3165 * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
3166 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
3167 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
3168 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
3169 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
3170 * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
3172 * sysdeps/unix/sysv/linux/i386/createthread.c: Define
3173 PREPARE_CREATE and TLS_VALUE with x86-specific bits. All the rest
3174 of the code is moved to ...
3175 * sysdeps/pthread/createthread.c: ...here. New file.
3177 2003-01-27 Ulrich Drepper <drepper@redhat.com>
3179 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
3180 (__new_sem_post): Clear %eax before returning.
3181 Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
3183 * Makefile (tests): Add tst-cleanup2.
3184 * tst-cleanup2.c: New file.
3186 * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
3187 Interpret first parameter correctly.
3189 2003-01-17 Ulrich Drepper <drepper@redhat.com>
3191 * Makefile (headers): Add bits/semaphore.h.
3193 2003-01-16 Jakub Jelinek <jakub@redhat.com>
3195 * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
3198 2003-01-14 Ulrich Drepper <drepper@redhat.com>
3200 * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
3201 must be used and mapping failed.
3202 Reported by Luke Elliott <luke.elliott@activfinancial.com>.
3204 * Makefile (CFLAGS-pthread_self.os): Define this, not
3205 CFLAGS-pthread_self.c.
3207 2003-01-13 Ulrich Drepper <drepper@redhat.com>
3209 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
3212 * Makefile (libpthread-routines): Add version. Add rules to build
3213 version.os and banner.h.
3214 * version.c: New file.
3216 2003-01-13 Jakub Jelinek <jakub@redhat.com>
3218 * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
3219 the alias unconditional.
3220 * pthread_mutex_unlock.c (__pthread_mutex_unlock_internal): Likewise.
3222 2003-01-13 Ulrich Drepper <drepper@redhat.com>
3224 * Makefile (CFLAGS-pthread_self.c): New definition.
3226 2003-01-06 Jakub Jelinek <jakub@redhat.com>
3228 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
3229 INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
3230 * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
3231 * init.c (__pthread_initialize_minimal_internal): Likewise.
3233 2003-01-07 Jakub Jelinek <jakub@redhat.com>
3235 * pthreadP.h (__pthread_cond_timedwait): Add prototype.
3237 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3238 (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
3239 (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
3240 * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
3241 (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
3242 (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
3244 2003-01-06 Jakub Jelinek <jakub@redhat.com>
3246 * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
3247 * pt-system.c (LIBC_CANCEL_HANDLED): Add.
3248 * tst-cancel-wrappers.sh: Remove all exceptions.
3250 2003-01-05 Ulrich Drepper <drepper@redhat.com>
3252 * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
3253 features. Reported by Marijn Ros <marijn@mad.scientist.com>.
3255 * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
3256 Use __libc_pthread_functions array if SHARED.
3258 * pthreadP.h: Move pthread_cond_2_0_t definition to...
3259 * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
3261 * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
3262 (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
3263 __libc_key_create, __libc_getspecific, __libc_setspecific): Use
3264 __libc_ptf_call instead of __libc_maybe_call.
3266 (__libc_cleanup_region_start): Wrap function name with PTF call.
3267 (__libc_cleanup_region_end): Likewise.
3268 (__libc_cleanup_end): Likewise.
3270 * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
3271 * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
3272 * pthread_key_create.c: Add __pthread_key_create_internal alias.
3273 * pthreadP.h: Add prototypes.
3275 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
3276 __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
3277 __pthread_rwlock_unlock aliases.
3278 * pthreadP.h: Add prototypes for new aliases.
3280 * pthreadP.h (struct pthead_functions): Moved to...
3281 * sysdeps/pthread/pthread-functions.h: ...here. New file.
3282 * init.c (pthread_functions): Add initializers for new elements.
3284 * cleanup_defer.c: Add __pthread_cleanup_push_defer and
3285 __pthread_cleanup_pop_restore aliases.
3286 * pthreadP.h: Add prototypes.
3288 * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
3289 and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
3290 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
3291 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
3292 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3293 * pthreadP.h: Adjust prototypes and callers.
3295 2003-01-04 Ulrich Drepper <drepper@redhat.com>
3297 * Makefile (tests): Add tst-cancel7.
3298 (tst-cancel7-ARGS): New variable.
3299 * tst-cancel7.c: New file.
3301 * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
3302 around gcc defficiencies.
3303 * old_pthread_cond_signal.c: Likewise.
3304 * old_pthread_cond_timedwait.c: Likewise.
3305 * old_pthread_cond_wait.c: Likewise.
3307 * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
3309 2003-01-03 Ulrich Drepper <drepper@redhat.com>
3311 * Makefile (tests): Add tst-cond7.
3312 * tst-cond7.c: New file.
3314 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
3315 (condvar_cleanup): Get condvar address from the right place.
3317 * atomic.h: Correct definitions of atomic_full_barrier,
3318 atomic_read_barrier, atomic_write_barrier.
3320 * old_pthread_cond_broadcast.c: Make memory allocate and initialization
3322 * old_pthread_cond_signal.c: Likewise.
3323 * old_pthread_cond_timedwait.c: Likewise.
3324 * old_pthread_cond_wait.c: Likewise.
3326 2003-01-03 Jakub Jelinek <jakub@redhat.com>
3328 * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
3330 2003-01-03 Ulrich Drepper <drepper@redhat.com>
3332 * pthreadP.h (pthread_cond_2_0_t): New type.
3333 (struct pthread_functions): Use new type for 2.0 condvar callbacks.
3334 Use new type for the 2.0 condvar function prototypes.
3335 * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
3336 * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
3338 * old_pthread_cond_destroy.c: Likewise.
3339 * old_pthread_cond_broadcast.c: Likewise. Lock appropriately.
3340 * old_pthread_cond_signal.c: Likewise.
3341 * old_pthread_cond_timedwait.c: Likewise.
3342 * old_pthread_cond_wait.c: Likewise.
3344 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
3345 (__pthread_cond_wait): Don't save cancellation mode and seq value
3348 * herrno.c (__h_errno_location): Don't define as weak.
3350 2003-01-02 Jakub Jelinek <jakub@redhat.com>
3352 * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
3353 pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
3354 and pthread_cond_wait.
3355 * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
3357 (__pthread_cond_broadcast_2_0): ... this.
3358 * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
3360 (__pthread_cond_destroy_2_0): ... this.
3361 * old_pthread_cond_init.c (__old_pthread_cond_init):
3363 (__pthread_cond_init_2_0): ... this.
3364 * old_pthread_cond_signal.c (__old_pthread_cond_signal):
3366 (__pthread_cond_signal_2_0): ... this.
3367 * old_pthread_cond_wait.c (__old_pthread_cond_wait):
3369 (__pthread_cond_wait_2_0): ... this.
3370 * pthread_cond_destroy.c: Include shlib-compat.h.
3371 (pthread_cond_destroy): Change strong_alias into versioned_symbol.
3372 * pthread_cond_init.c: Include shlib-compat.h.
3373 (pthread_cond_init): Change strong_alias into versioned_symbol.
3374 * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
3375 fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
3377 (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
3378 __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
3379 __pthread_cond_wait_2_0): New prototypes.
3380 (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
3381 __old_pthread_cond_init, __old_pthread_cond_signal,
3382 __old_pthread_cond_wait): Removed.
3383 * init.c: Include shlib-compat.h.
3384 (pthread_functions): Guard ptr___pthread_attr_init_2_0
3385 initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
3386 Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
3387 ptr___pthread_cond_*_2_0 fields.
3388 * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
3389 pthread_cond_*@GLIBC_2.0 compatibility symbols.
3391 * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
3392 LIBC_SIGACTION was not yet defined.
3393 [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
3394 [!defined LIBC_SIGACTION] (__sigaction): New function and
3396 [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
3397 [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
3399 2003-01-02 Jakub Jelinek <jakub@redhat.com>
3401 * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
3403 2003-01-02 Ulrich Drepper <drepper@redhat.com>
3405 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3406 New, larger type definition.
3407 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
3409 * Versions [libpthread]: Add definitions for new pthread_cond_*
3410 interfaces for version GLIBC_2.3.2.
3411 * pthread_cond_init.c: Update initialization for new type definition.
3412 * Makefile (libpthread-routines): Remove pthread_cond_wait,
3413 pthread_cond_timedwait, pthread_cond_signal, and
3414 pthread_cond_broadcast. Add old_pthread_cond_init,
3415 old_pthread_cond_destroy, old_pthread_cond_wait,
3416 old_pthread_cond_timedwait, old_pthread_cond_signal, and
3417 old_pthread_cond_broadcast.
3418 * old_pthread_cond_broadcast.c: New file.
3419 * old_pthread_cond_destroy.c: New file.
3420 * old_pthread_cond_init.c: New file.
3421 * old_pthread_cond_signal.c: New file.
3422 * old_pthread_cond_timedwait.c: New file.
3423 * old_pthread_cond_wait.c: New file.
3424 * pthreadP.h: Add prototypes for the compatibility interfaces.
3426 * pthread_cond_destroy.c: Don't include <errno.h>.
3428 2003-01-01 Ulrich Drepper <drepper@redhat.com>
3430 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
3431 unnecessary zero offset when addressing MUTEX.
3433 2002-12-31 Ulrich Drepper <drepper@redhat.com>
3435 * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
3437 * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
3438 for __register_atfork.
3440 2002-12-31 Jakub Jelinek <jakub@redhat.com>
3442 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
3443 instead of ASSEMBLER test macro.
3445 * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
3446 __libc_current_sigrtmax): Add libc_hidden_def.
3448 * sysdeps/pthread/list.h: Remove assert.h include.
3450 2002-12-31 Ulrich Drepper <drepper@redhat.com>
3452 * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
3453 __pthread_initialize_minimal_internal not
3454 __pthread_initialize_minimal.
3456 2002-12-30 Ulrich Drepper <drepper@redhat.com>
3458 * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
3459 __pthread_initialize_minimal as hidden.
3461 * init.c (__pthread_initialize_minimal_internal): Don't mark as
3464 2002-12-31 Jakub Jelinek <jakub@redhat.com>
3466 * Makefile ($(inst_libdir)/libpthread.so): Depend on
3467 $(common-objpfx)format.lds, include that into the output script.
3469 (extra-B-pthread.so): Change linuxthreads/ into nptl/.
3471 2002-12-28 Andreas Jaeger <aj@suse.de>
3473 * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
3474 nsec resolution changes.
3475 (xstat64_conv): Likewise.
3476 (xstat32_conv): Likewise.
3477 * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
3479 * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
3480 structs stat and stat64.
3481 * time/time.h (__timespec_defined): Define for __USE_MISC.
3482 * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
3484 2002-12-30 Jakub Jelinek <jakub@redhat.com>
3486 * forward.c (FORWARD2): Renamed from FORWARD3. Remove unused export
3488 (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
3489 (pthread_exit): Use strong_alias to avoid warnings.
3490 * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
3491 and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
3492 ptr___pthread_attr_init_2_*.
3493 * init.c (pthread_functions): Adjust.
3495 2002-12-29 Ulrich Drepper <drepper@redhat.com>
3497 * forward.c: Make all functions available by default again. It
3498 caused too much trouble.
3500 * pt-siglongjmp.c: Removed.
3502 2002-12-28 Jakub Jelinek <jakub@redhat.com>
3504 * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
3505 (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
3506 * sysdeps/i386/Makefile: New file.
3507 * sysdeps/i386/tcb-offsets.sym: New file.
3508 * sysdeps/pthread/tcb-offsets.h: New file.
3509 * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3510 Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
3512 * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
3513 __register_atfork...
3514 (GLIBC_2.3.2): ...here.
3516 2002-12-28 Ulrich Drepper <drepper@redhat.com>
3518 * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
3519 pthread_attr_setstackaddr with __attribute_deprecated__.
3521 2002-12-27 Jakub Jelinek <jakub@redhat.com>
3523 * pt-system.c (system): Remove cancellation handling.
3524 * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
3525 cancellation routines.
3527 2002-12-28 Ulrich Drepper <drepper@redhat.com>
3529 * descr.h: Include <dl-sysdep.h>.
3530 (struct pthread): Move header.data.list to the back of the struct.
3531 * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
3532 (MULTIPLE_THREADS_OFFSET): Adjust offset.
3533 (SYSINFO_OFFSEET): Likewise.
3535 2002-12-27 Jakub Jelinek <jakub@redhat.com>
3537 * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
3539 (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
3540 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
3541 DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
3542 (USE_DL_SYSINFO): Undef.
3544 2002-12-22 Jakub Jelinek <jakub@redhat.com>
3546 * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
3547 $(common-objpfx)libc.so.
3548 * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
3549 it is bigger than pipe buffer size even on arches with bigger
3551 (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
3553 2002-12-25 Ulrich Drepper <drepper@redhat.com>
3555 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
3556 correct errno access for case that USE___THREAD is not defined.
3558 2002-12-24 Ulrich Drepper <drepper@redhat.com>
3560 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
3561 Patch by Marijn Ros <marijn@mad.scientist.com>.
3563 2002-12-22 Roland McGrath <roland@redhat.com>
3565 * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
3567 2002-12-20 Ulrich Drepper <drepper@redhat.com>
3569 * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
3571 2002-12-19 Ulrich Drepper <drepper@redhat.com>
3573 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
3574 NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
3575 * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
3577 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
3579 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3580 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
3581 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
3582 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3583 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
3584 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
3585 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
3586 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3588 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
3590 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
3592 * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
3594 * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
3596 * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
3597 that sysinfo is properly initialized.
3598 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
3599 to 1 only for ld.so.
3601 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
3602 RTLD_CORRECT_DYNAMIC_WEAK.
3604 2002-12-19 Jakub Jelinek <jakub@redhat.com>
3606 * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
3607 Use return 0 as 6th argument to FORWARD4.
3608 * pthread_equal.c: Include pthreadP.h instead of pthread.h.
3610 2002-12-18 Ulrich Drepper <drepper@redhat.com>
3612 * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
3613 * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
3614 Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
3615 (INIT_SYSINFO): New #define.
3616 (TLS_TP_INIT): Use INIT_SYSINFO.
3617 * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3618 At test to make sure SYSINFO_OFFSET value is correct.
3619 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
3621 2002-12-18 Jakub Jelinek <jakub@redhat.com>
3623 * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
3624 * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
3625 * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
3626 [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
3627 __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
3628 __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
3629 __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
3631 2002-12-18 Ulrich Drepper <drepper@redhat.com>
3633 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
3634 macro instead of using int $0x80 directly.
3636 * sysdeps/pthread/bits/stdio-lock.h: New file.
3637 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
3638 * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
3639 * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
3640 * Makefile (routines): Add libc-lowlevelmutex.
3642 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
3643 __i686.get_pc_thunk.dx.
3645 2002-12-17 Jakub Jelinek <jakub@redhat.com>
3647 * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
3648 (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
3649 ($(objpfx)tst-cancel-wrappers.out): New rule.
3650 * tst-cancel-wrappers.sh: New test.
3651 * tst-locale1.c: Include signal.h.
3652 (uselocale): Test static linking of __libc_current_sigrt*.
3654 2002-12-17 Ulrich Drepper <drepper@redhat.com>
3656 * Makefile (tests): Add tst-cancel6.
3657 * tst-cancel6.c: New file
3659 2002-12-17 Jakub Jelinek <jakub@redhat.com>
3661 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
3662 Define meaningfully for assembler as well.
3663 * pthreadP.h (struct pthread_functions): Remove
3664 ptr_pthread_attr_init field. Add ptr_pthread_attr_init_2_0
3665 and ptr_pthread_attr_init_2_1 fields.
3666 * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
3667 and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
3668 * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
3669 (FORWARD3): Define using FORWARD4.
3670 (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
3672 * pt-system.c: Remove duplicate stdlib.h include.
3674 2002-12-16 Ulrich Drepper <drepper@redhat.com>
3676 * sem_init.c: Define sem_init@GLIBC_2.0.
3677 * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
3678 * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
3680 * flockfile.c: Moved to...
3681 * sysdeps/pthread/flockfile.c: ...here. New file.
3682 * funlockfile.c: Moved to...
3683 * sysdeps/pthread/funlockfile.c: ...here. New file.
3684 * ftrylockfile.c: Moved to...
3685 * sysdeps/pthread/ftrylockfile.c: ...here. New file.
3687 2002-12-16 Jakub Jelinek <jakub@redhat.com>
3689 * libc-cancellation.c: Guard both function with
3690 #if !defined NOT_IN_libc.
3691 * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
3692 automatically provided pthread wrappers.
3693 * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
3694 CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
3696 * pt-open.c: Removed.
3697 * pt-fcntl.c: Removed.
3698 * pt-fsync.c: Removed.
3699 * pt-lseek.c: Removed.
3700 * pt-msgrcv.c: Removed.
3701 * pt-msgsnd.c: Removed.
3702 * pt-msync.c: Removed.
3703 * pt-nanosleep.c: Removed.
3704 * pt-open64.c: Removed.
3705 * pt-pause.c: Removed.
3706 * pt-pread.c: Removed.
3707 * pt-pread64.c: Removed.
3708 * pt-pwrite.c: Removed.
3709 * pt-pwrite64.c: Removed.
3710 * pt-read.c: Removed.
3711 * pt-recv.c: Removed.
3712 * pt-recvfrom.c: Removed.
3713 * pt-recvmsg.c: Removed.
3714 * pt-send.c: Removed.
3715 * pt-sendto.c: Removed.
3716 * pt-sigtimedwait.c: Removed.
3717 * pt-sigwait.c: Removed.
3718 * pt-wait.c: Removed.
3719 * pt-waitpid.c: Removed.
3720 * pt-write.c: Removed.
3721 * pt-accept.c: Removed.
3722 * pt-close.c: Removed.
3723 * pt-connect.c: Removed.
3724 * pt-lseek64.c: Removed.
3725 * pt-sendmsg.c: Removed.
3726 * pt-tcdrain.c: Removed.
3728 2002-12-15 Ulrich Drepper <drepper@redhat.com>
3730 * init.c (__pthread_initialize_minimal_internal): Renamed from
3731 __pthread_initialize_minimal. Make old name an alias. This
3732 converts a normal relocation into a relative relocation.
3734 * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
3736 * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
3737 readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
3738 * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
3739 pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
3740 pt-sigwaitinfo, pt-waitid, and pt-writev.
3741 * pt-creat.c: Removed.
3742 * pt-poll.c: Removed.
3743 * pt-pselect.c: Removed.
3744 * pt-readv.c: Removed.
3745 * pt-select.c: Removed.
3746 * pt-sigpause.c: Removed.
3747 * pt-sigsuspend.c: Removed.
3748 * pt-sigwaitinfo.c: Removed.
3749 * pt-waitid.c: Removed.
3750 * pt-writev.c: Removed.
3752 * init.c (pthread_functions): New variable.
3753 (__pthread_initialize_minimal): Pass pointer to pthread_functions
3754 (or NULL) to __libc_pthread_init.
3755 * forward.c: Rewrite to use __libc:pthread_functions array to get
3757 * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
3759 * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3760 Take new parameter. Copy content of variable pointed to by it
3761 to __libc_pthread_init.
3763 * pthreadP.h (struct pthread_functions): New type.
3764 (__libc_pthread_init): Declare.
3766 * pthread_attr_destroy.c: Add namespace protected alias.
3767 * pthread_attr_getdetachstate.c: Likewise.
3768 * pthread_attr_getinheritsched.c: Likewise.
3769 * pthread_attr_getschedparam.c: Likewise.
3770 * pthread_attr_getschedpolicy.c: Likewise.
3771 * pthread_attr_getscope.c: Likewise.
3772 * pthread_attr_setdetachstate.c: Likewise.
3773 * pthread_attr_setinheritsched.c: Likewise.
3774 * pthread_attr_setschedparam.c: Likewise.
3775 * pthread_attr_setschedpolicy.c: Likewise.
3776 * pthread_attr_setscope.c: Likewise.
3777 * pthread_cond_broadcast.c: Likewise.
3778 * pthread_cond_destroy.c: Likewise.
3779 * pthread_cond_init.c: Likewise.
3780 * pthread_cond_signal.c: Likewise.
3781 * pthread_cond_wait.c: Likewise.
3782 * pthread_condattr_destroy.c: Likewise.
3783 * pthread_condattr_init.c: Likewise.
3784 * pthread_equal.c: Likewise.
3785 * pthread_exit.c: Likewise.
3786 * pthread_getschedparam.c: Likewise.
3787 * pthread_self.c: Likewise.
3788 * pthread_setcancelstate.c: Likewise.
3789 * pthread_setschedparam.c: Likewise.
3790 * pthread_mutex_destroy.c: Likewise.
3791 * pthread_mutex_init.c: Likewise.
3792 * pthreadP.h: Add prototypes for the aliases.
3794 * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
3795 multiple_threads member in correct TCB to 1.
3797 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
3798 SINGLE_THREAD_P. If in libc or libpthread examine multiple_thread
3799 member of thread decriptor, otherwise return unconditionally 1.
3801 2002-12-14 Ulrich Drepper <drepper@redhat.com>
3803 * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
3804 regular Linux version. Remove file.
3805 * sysdeps/unix/sysv/linux/connect.S: Likewise. Remove file.
3806 * sysdeps/unix/sysv/linux/llseek.c: Likewise. Remove file.
3807 * sysdeps/unix/sysv/linux/msgrcv.c: Likewise. Remove file.
3808 * sysdeps/unix/sysv/linux/msgsnd.c: Likewise. Remove file.
3809 * sysdeps/unix/sysv/linux/open64.c: Likewise. Remove file.
3810 * sysdeps/unix/sysv/linux/poll.c: Likewise. Remove file.
3811 * sysdeps/unix/sysv/linux/pread.c: Likewise. Remove file.
3812 * sysdeps/unix/sysv/linux/pread64.c: Likewise. Remove file.
3813 * sysdeps/unix/sysv/linux/pselect.c: Likewise. Remove file.
3814 * sysdeps/unix/sysv/linux/pwrite.c: Likewise. Remove file.
3815 * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. Remove file.
3816 * sysdeps/unix/sysv/linux/readv.c: Likewise. Remove file.
3817 * sysdeps/unix/sysv/linux/recv.S: Likewise. Remove file.
3818 * sysdeps/unix/sysv/linux/recvfrom.S: Likewise. Remove file.
3819 * sysdeps/unix/sysv/linux/recvmsg.S: Likewise. Remove file.
3820 * sysdeps/unix/sysv/linux/send.S: Likewise. Remove file.
3821 * sysdeps/unix/sysv/linux/sendmsg.S: Likewise. Remove file.
3822 * sysdeps/unix/sysv/linux/sendto.S: Likewise. Remove file.
3823 * sysdeps/unix/sysv/linux/sigpause.c: Likewise. Remove file.
3824 * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise. Remove file.
3825 * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise. Remove file.
3826 * sysdeps/unix/sysv/linux/sigwait.c: Likewise. Remove file.
3827 * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. Remove file.
3828 * sysdeps/unix/sysv/linux/system.c: Likewise. Remove file.
3829 * sysdeps/unix/sysv/linux/tcdrain.c: Likewise. Remove file.
3830 * sysdeps/unix/sysv/linux/wait.c: Likewise. Remove file.
3831 * sysdeps/unix/sysv/linux/waitid.c: Likewise. Remove file.
3832 * sysdeps/unix/sysv/linux/waitpid.c: Likewise. Remove file.
3833 * sysdeps/unix/sysv/linux/writev.c: Likewise. Remove file.
3834 * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise. Remove file.
3836 2002-12-14 Jakub Jelinek <jakub@redhat.com>
3838 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
3839 * sysdeps/unix/sysv/linux/open.c: Removed.
3840 * sysdeps/unix/sysv/linux/fsync.c: Removed.
3841 * sysdeps/unix/sysv/linux/lseek.c: Removed.
3842 * sysdeps/unix/sysv/linux/msync.c: Removed.
3843 * sysdeps/unix/sysv/linux/read.c: Removed.
3844 * sysdeps/unix/sysv/linux/close.c: Removed.
3845 * sysdeps/unix/sysv/linux/creat.c: Removed.
3846 * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
3847 * sysdeps/unix/sysv/linux/pause.c: Removed.
3848 * sysdeps/unix/sysv/linux/select.c: Removed.
3849 * sysdeps/unix/sysv/linux/write.c: Removed.
3851 2002-12-14 Ulrich Drepper <drepper@redhat.com>
3853 * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
3854 element in TCB to see whether locking is needed.
3856 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
3857 MULTIPLE_THREADS_OFFSET value is correct.
3859 * sysdeps/unix/sysv/linux/close.c: New file.
3860 * sysdeps/unix/sysv/linux/connect.S: New file.
3861 * sysdeps/unix/sysv/linux/creat.c: New file.
3862 * sysdeps/unix/sysv/linux/fsync.c: New file.
3863 * sysdeps/unix/sysv/linux/llseek.c: New file.
3864 * sysdeps/unix/sysv/linux/lseek.c: New file.
3865 * sysdeps/unix/sysv/linux/msgrcv.c: New file.
3866 * sysdeps/unix/sysv/linux/msgsnd.c: New file.
3867 * sysdeps/unix/sysv/linux/msync.c: New file.
3868 * sysdeps/unix/sysv/linux/nanosleep.c: New file.
3869 * sysdeps/unix/sysv/linux/open.c: New file.
3870 * sysdeps/unix/sysv/linux/open64.c: New file.
3871 * sysdeps/unix/sysv/linux/pause.c: New file.
3872 * sysdeps/unix/sysv/linux/poll.c: New file.
3873 * sysdeps/unix/sysv/linux/pread.c: New file.
3874 * sysdeps/unix/sysv/linux/pread64.c: New file.
3875 * sysdeps/unix/sysv/linux/pselect.c: New file.
3876 * sysdeps/unix/sysv/linux/pwrite.c: New file.
3877 * sysdeps/unix/sysv/linux/pwrite64.c: New file.
3878 * sysdeps/unix/sysv/linux/readv.c: New file.
3879 * sysdeps/unix/sysv/linux/recv.S: New file.
3880 * sysdeps/unix/sysv/linux/recvfrom.S: New file.
3881 * sysdeps/unix/sysv/linux/recvmsg.S: New file.
3882 * sysdeps/unix/sysv/linux/select.c: New file.
3883 * sysdeps/unix/sysv/linux/send.S: New file.
3884 * sysdeps/unix/sysv/linux/sendmsg.S: New file.
3885 * sysdeps/unix/sysv/linux/sendto.S: New file.
3886 * sysdeps/unix/sysv/linux/sigpause.c: New file.
3887 * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
3888 * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
3889 * sysdeps/unix/sysv/linux/sigwait.c: New file.
3890 * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
3891 * sysdeps/unix/sysv/linux/system.c: New file.
3892 * sysdeps/unix/sysv/linux/tcdrain.c: New file.
3893 * sysdeps/unix/sysv/linux/wait.c: New file.
3894 * sysdeps/unix/sysv/linux/waitid.c: New file.
3895 * sysdeps/unix/sysv/linux/waitpid.c: New file.
3896 * sysdeps/unix/sysv/linux/writev.c: New file.
3897 * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
3899 * pt-readv.c: Fix comment.
3901 2002-12-14 Jakub Jelinek <jakub@redhat.com>
3903 * tst-cleanup1.c: Include stdlib.h.
3905 * tst-cancel5.c: New test.
3906 * Makefile (tests): Add tst-cancel5.
3907 (tst-cancel5): Link against libc.so libpthread.so in that order.
3909 2002-12-13 Ulrich Drepper <drepper@redhat.com>
3911 * forward.c (test_loaded): Prevent recursive calls.
3913 * Makefile (routines): Add libc-cancellation.
3914 * libc-cancellation.c: New file.
3915 * descr.h (struct pthread): Add multiple_threads field.
3916 * allocatestack.c (allocate_stack): Initialize multiple_header field of
3917 new thread descriptor to 1.
3918 * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
3919 Initialize multiple_thread field after successful thread creation.
3920 * cancellation.c (__do_cancel): Move to pthreadP.h.
3921 (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
3922 (__pthread_disable_asynccancel): Add internal_function attribute.
3923 * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
3924 * pthread_setcancelstate.c: Likewise.
3925 * pthread_setcanceltype.c: Likewise.
3926 * pthread_exit.c: Likewise.
3927 * pthreadP.h (CANCELLATION_P): Likewise.
3928 (__do_cancel): Define as static inline.
3929 (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
3930 (__libc_enable_asynccancel, __libc_disable_asynccancel): New
3932 * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
3933 fields. Define MULTIPLE_THREADS_OFFSET.
3934 * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
3936 * sysdeps/unix/sysv/linux/accept.S: New file.
3937 * sysdeps/unix/sysv/linux/read.c: New file.
3938 * sysdeps/unix/sysv/linux/write.c: New file.
3939 * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
3940 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
3941 initialization of __libc_locking_needed.
3942 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
3943 __libc_locking_needed, use multiple_threads field in TCB.
3944 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3946 2002-12-12 Ulrich Drepper <drepper@redhat.com>
3948 * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
3950 * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
3952 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
3953 access to __libc_locking_needed for PIC.
3955 2002-12-12 Jakub Jelinek <jakub@redhat.com>
3957 * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
3958 declare for libc.so.
3959 (__libc_lock_init, __libc_lock_init_recursive): Change into comma
3961 (__libc_lock_lock): Put into statement expression.
3962 (__libc_lock_unlock): Remove trailing semicolon.
3963 * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
3965 2002-12-12 Roland McGrath <roland@redhat.com>
3967 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
3968 "m" constraint to refer to __libc_locking_needed. Declare it here.
3970 2002-12-12 Ulrich Drepper <drepper@redhat.com>
3972 * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
3973 * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
3974 Initialize __libc_locking_needed.
3975 * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
3976 instead of __register_pthread_fork_handler.
3977 * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
3978 * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
3979 fork-gen with libc_pthread_init.
3980 * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
3981 of __register_pthread_fork_handler.
3982 * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
3983 of __register_pthread_fork_handler.
3984 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
3985 __libc_locking_needed to determine whether lock prefix can be avoided.
3986 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3988 2002-12-11 Ulrich Drepper <drepper@redhat.com>
3990 * Makefile (tests): Add tst-cleanup1.
3991 * tst-cleanup1.c: New file.
3992 * cancellation.c (__cleanup_thread): Removed.
3993 (__do_cancel): Remove call to __cleanup_thread.
3994 * pthreadP.h: Remove __cleanup_thread prorotype.
3996 * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
3997 Remember function and argument even if cancellation handler
3998 function is not available.
3999 (__libc_cleanup_region_end): Execute registered function directly if
4000 pthread functions are not available.
4001 (__libc_cleanup_end): Likewise.
4003 * init.c (__pthread_initialize_minimal): Fix initialization in
4004 static lib by preventing gcc from being too clever.
4006 2002-12-10 Ulrich Drepper <drepper@redhat.com>
4008 * init.c (__pthread_initialize_minimal): Remove unneccesary
4011 * Makefile (tests): We can run tst-locale2 now.
4013 2002-12-09 Ulrich Drepper <drepper@redhat.com>
4015 * Versions: Remove duplicated sigwait entry.
4017 2002-12-08 Ulrich Drepper <drepper@redhat.com>
4019 * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
4022 * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
4024 * pthreadP.h: Declare __pthread_enable_asynccancel and
4025 __pthread_disable_asynccancel.
4026 (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
4027 (CANCEL_RESET): Use __pthread_disable_asynccancel.
4028 * cancellation.c (__pthread_enable_asynccancel): New function.
4029 (__pthread_disable_asynccancel): New function.
4030 * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
4031 * pt-close.c: Likewise.
4032 * pt-connect.c: Likewise.
4033 * pt-creat.c: Likewise.
4034 * pt-fcntl.c: Likewise.
4035 * pt-fsync.c: Likewise.
4036 * pt-lseek.c: Likewise.
4037 * pt-lseek64.c: Likewise.
4038 * pt-msgrcv.c: Likewise.
4039 * pt-msgsnd.c: Likewise.
4040 * pt-msync.c: Likewise.
4041 * pt-nanosleep.c: Likewise.
4042 * pt-open.c: Likewise.
4043 * pt-open64.c: Likewise.
4044 * pt-pause.c: Likewise.
4045 * pt-poll.c: Likewise.
4046 * pt-pread.c: Likewise.
4047 * pt-pread64.c: Likewise.
4048 * pt-pselect.c: Likewise.
4049 * pt-pwrite.c: Likewise.
4050 * pt-pwrite64.c: Likewise.
4051 * pt-read.c: Likewise.
4052 * pt-readv.c: Likewise.
4053 * pt-recv.c: Likewise.
4054 * pt-recvfrom.c: Likewise.
4055 * pt-recvmsg.c: Likewise.
4056 * pt-select.c: Likewise.
4057 * pt-send.c: Likewise.
4058 * pt-sendmsg.c: Likewise.
4059 * pt-sendto.c: Likewise.
4060 * pt-sigpause.c: Likewise.
4061 * pt-sigsuspend.c: Likewise.
4062 * pt-sigtimedwait.c: Likewise.
4063 * pt-sigwait.c: Likewise.
4064 * pt-sigwaitinfo.c: Likewise.
4065 * pt-system.c: Likewise.
4066 * pt-tcdrain.c: Likewise.
4067 * pt-wait.c: Likewise.
4068 * pt-waitid.c: Likewise.
4069 * pt-waitpid.c: Likewise.
4070 * pt-write.c: Likewise.
4071 * pt-writev.c: Likewise.
4072 * pthread_join.c: Likewise.
4073 * pthread_timedjoin.c: Likewise.
4075 * pt-sigpause.c (sigsuspend): Call __sigsuspend.
4076 (__xpg_sigpause): New function.
4077 * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
4079 2002-12-07 Ulrich Drepper <drepper@redhat.com>
4081 * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
4083 * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
4084 _GI_pthread_cleanup_pop to pthreadP.h.
4086 * ftrylockfile.c: Use _IO_lock_trylock instead of
4087 pthread_mutex_trylock.
4089 * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
4090 (CANCEL_RESET): Likewise.
4091 (__pthread_setcanceltype_): Declare.
4092 (__pthread_mutex_lock_internal): Declare.
4093 (__pthread_mutex_unlock_internal): Declare.
4094 (__pthread_once_internal): Declare.
4095 (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
4096 (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
4098 * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
4099 and pthread_mutex_unlock.
4100 * pthread_cond_wait.c: Likewise.
4101 * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
4102 * pthread_mutex_unlock.c: Likewise.
4104 * pthread_setcanceltype.c: Add additional alias
4105 __pthread_setcanceltype.
4107 * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
4108 * sem_open.c (sem_open): Likewise.
4109 Use __libc_open, __libc_write, and __libc_close instead of
4110 open, write, and close respectively.
4112 * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
4113 Rewrite as statement expression since it must return a value.
4115 * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
4116 * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
4119 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
4120 alias __pthread_once_internal.
4122 * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
4124 2002-12-06 Ulrich Drepper <drepper@redhat.com>
4126 * Makefile (tests): Add tst-stdio1 and tst-stdio2.
4127 * tst-stdio1.c: New file.
4128 * tst-stdio2.c: New file.
4130 * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
4132 * Makefile (tests): Comment out tst-locale2 for now.
4133 (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
4135 * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
4137 * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
4138 Use _IO_lock_init instead of explicit assignment.
4140 * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
4141 Define __libc_lock_* and __libc_lock_recursive macros with
4142 lowlevellock macros, not pthread mutexes.
4144 * flockfile.c: Include <bits/stdio-lock.h>. Use _IO_lock_lock instead
4145 of pthread_mutex_lock.
4146 * funlockfile.c: Include <bits/stdio-lock.h>. Use _IO_lock_unlock
4147 instead of pthread_mutex_unlock.
4149 2002-12-06 Roland McGrath <roland@redhat.com>
4151 * allocatestack.c (__stack_user): Use uninitialized defn.
4152 * init.c (__pthread_initialize_minimal): Initialize it here.
4154 2002-12-05 Roland McGrath <roland@redhat.com>
4156 * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
4158 * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
4160 * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
4163 2002-12-05 Ulrich Drepper <drepper@redhat.com>
4165 * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
4167 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
4168 * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
4169 * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
4170 * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
4171 for __libc_lock_* macros.
4172 * Makefile (routines): Add libc-lowlevellock.
4174 2002-10-09 Roland McGrath <roland@redhat.com>
4176 * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
4177 Under [__PIC__], call the function via the pointer fetched for
4178 comparison rather than a call by name that uses the PLT.
4179 (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
4180 (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
4181 (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
4182 (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
4183 (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
4185 2002-12-04 Roland McGrath <roland@redhat.com>
4187 * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
4189 * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
4190 * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
4192 * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
4194 2002-12-04 Ulrich Drepper <drepper@redhat.com>
4196 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
4197 a completely opaque, non-integer type.
4198 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4200 2002-12-05 Jakub Jelinek <jakub@redhat.com>
4202 * sysdeps/i386/tls.h: Include stdlib.h.
4203 * sysdeps/x86_64/tls.h: Likewise.
4205 2002-12-04 Ulrich Drepper <drepper@redhat.com>
4207 * Makefile (tests): Add tst-locale2.
4208 (tests-static): Likewise.
4209 * tst-locale2.c: New file.
4211 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
4212 volatile and add memory clobbers to lock operations.
4214 2002-12-03 Ulrich Drepper <drepper@redhat.com>
4216 * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
4217 * sysdeps/i386/i486/bits/atomic.h: New file.
4218 * sysdeps/i386/i586/bits/atomic.h: New file.
4219 * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
4220 include i486 version.
4221 * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
4222 * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
4223 Patch by Marijn Ros <marijn@mad.scientist.com>.
4225 * allocatestack.c (get_cached_stack): Don't crash if we first
4226 found a stack with a larger size then needed.
4227 Reported by Hui Huang <hui.huang@sun.com>.
4229 * Makefile (tests): Add tst-sysconf.
4230 * tst-sysconf.c: New file.
4232 * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
4233 PTHREAD_THREADS_MAX.
4235 2002-12-02 Roland McGrath <roland@redhat.com>
4237 * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
4238 Declare using hidden_proto instead of attribute_hidden, so there are
4239 non-.hidden static symbols for gdb to find.
4240 (__pthread_keys): Likewise.
4241 * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
4242 * allocatestack.c (__stack_user): Likewise.
4243 * pthread_create.c (__pthread_keys): Likewise.
4244 (__nptl_threads_events, __nptl_last_event): Make these static instead
4246 * pthread_key_create.c (__pthread_pthread_keys_max,
4247 __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
4249 2002-12-02 Ulrich Drepper <drepper@redhat.com>
4251 * Makefile (tests): Add tst-locale1. If buid-static is yes link
4253 * tst-locale1.c: New file.
4255 * pthread_cond_timedwait.c: Include <stdlib.h>.
4257 * Makefile (tests): Add tst-fork2 and tst-fork3.
4258 * tst-fork2.c: New file.
4259 * tst-fork3.c: New file.
4261 2002-11-28 Ulrich Drepper <drepper@redhat.com>
4263 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
4265 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
4266 require it to 200112L.
4268 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
4269 instruction only if HAVE_CMOV is defined.
4270 * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
4272 * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
4274 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
4276 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
4278 * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
4280 2002-11-27 Ulrich Drepper <drepper@redhat.com>
4282 * sysdeps/x86_64/bits/atomic.h: New file.
4284 * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
4287 * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
4288 possible since gettid cannot fail.
4290 * sysdeps/x86_64/pthreaddef.h: New file.
4292 * sysdeps/i386/pthreaddef.h (gettid): Removed.
4294 * sysdeps/x86_64/pthread_spin_init.c: New file.
4295 * sysdeps/x86_64/pthread_spin_lock.c: New file.
4296 * sysdeps/x86_64/pthread_spin_trylock.c: New file.
4297 * sysdeps/x86_64/pthread_spin_unlock.c: New file.
4299 * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
4300 Add missing lock prefix. Minute optimization.
4302 * tst-spin2.c (main): Also check successful trylock call.
4304 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
4305 syscall. Fix typo in case INTERNAL_SYSCALL is not used.
4307 * sysdeps/i386/pthread_spin_destroy.c: Moved to...
4308 * sysdeps/pthread/pthread_spin_destroy.c: ...here. New file.
4310 * sysdeps/i386/pthread_sigmask.c: Removed. Use the generic code.
4311 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
4312 value in case of an error. Add support for INTERNAL_SYSCALL.
4314 * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
4315 value in case of an error.
4317 * sysdeps/x86_64/tls.h: New file.
4319 2002-11-26 Ulrich Drepper <drepper@redhat.com>
4321 * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface. It now
4322 takes the array member name and the index as parameters.
4323 (THREAD_SETMEM_NC): Likewise.
4324 * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
4325 * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
4328 * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
4329 to decide which code to use.
4330 (THREAD_SETMEM_NC): Likewise.
4332 * allocatestack.c (queue_stack): Don't remove stack from list here.
4333 Do it in the caller. Correct condition to prematurely terminate
4334 loop to free stacks.
4335 (__deallocate_stack): Remove stack from list here.
4337 2002-11-26 Ulrich Drepper <drepper@redhat.com>
4339 * Makefile (tests): Add tst-stack1.
4340 * tst-stack1.c: New file.
4342 * allocatestack.c (allocate_stack): Initialize the TCB on a user
4345 * pthread_attr_getstack.c: Return bottom of the thread area.
4347 2002-11-25 Ulrich Drepper <drepper@redhat.com>
4349 * Makefile (libpthread-routines): Add pt-allocrtsig and
4350 pthread_kill_other_threads.
4351 * pt-allocrtsig.c: New file.
4352 * pthread_kill_other_threads.c: New file.
4353 * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
4354 all three functions.
4355 * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
4357 * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
4358 __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
4359 and __libc_allocate_rtsig_private.
4360 * Versions (libpthread): Export pthread_kill_other_threads_np,
4361 __libc_current_sigrtmin, and __libc_current_sigrtmax.
4363 2002-11-24 Ulrich Drepper <drepper@redhat.com>
4365 * allocatestack.c (allocate_stack): stackaddr in attribute points to
4366 the end of the stack. Adjust computations.
4367 When mprotect call fails dequeue stack and free it.
4368 * pthread_attr_setstack.c: Store top of the stack in stackaddr
4370 * pthread_getattr_np.c: Likewise.
4372 * descr.h (IS_DETACHED): Add some more parenthesis to prevent
4375 2002-11-23 Ulrich Drepper <drepper@redhat.com>
4377 * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
4378 attribute definitions. Patch by Luca Barbieri <ldb@ldb.ods.org>.
4380 2002-11-22 Ulrich Drepper <drepper@redhat.com>
4382 * pthread_getspecific.c: Optimize access to first 2nd-level array.
4383 * pthread_setspecific.c: Likewise.
4385 2002-11-21 Ulrich Drepper <drepper@redhat.com>
4387 * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
4388 definitions. Get them from the official place.
4389 * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
4391 * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
4392 Use new CLONE_ flags in clone() calls.
4394 * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
4395 * sysdeps/unix/sysv/linux/i386/fork.c: New file.
4397 * Versions: Add pthread_* functions for libc.
4398 * forward.c: New file.
4400 * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
4402 * herrno.c: New file.
4405 * Makefile (libpthread-routines): Remove sem_post, sem_wait,
4406 sem_trywait, and sem_timedwait. Add herrno and res.
4407 * sem_init.c: Don't initialize lock and waiters members.
4408 * sem_open.c: Likewise.
4409 * sem_post.c: Removed.
4410 * sem_wait.c: Removed.
4411 * sem_trywait.c: Removed.
4412 * sem_timedwait.c: Removed.
4413 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
4414 Includes full implementations of sem_post, sem_wait, sem_trywait,
4416 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
4417 for new implementation.
4418 * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
4421 * tst-sem3.c: Improve error message.
4422 * tst-signal3.c: Likewise.
4424 * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
4425 to tell the kernel about the termination futex and to initialize tid
4426 member. Don't initialize main_thread.
4427 * descr.h (struct pthread): Remove main_thread member.
4428 * cancelllation.c (__do_cancel): Remove code handling main thread.
4429 The main thread is not special anymore.
4431 * allocatestack.c (__reclaim_stacks): Mark stacks as unused. Add
4432 size of the stacks to stack_cache_actsize.
4434 * pt-readv.c: Add missing "defined".
4435 * pt-sigwait.c: Likewise.
4436 * pt-writev.c: Likewise.
4438 2002-11-09 Ulrich Drepper <drepper@redhat.com>
4440 * Versions: Export __connect from libpthread.
4441 Patch by Luca Barbieri <ldb@ldb.ods.org>.
4443 * Makefile (libpthread-routines): Add pt-raise.
4444 * sysdeps/unix/sysv/linux/raise.c: New file.
4445 * sysdeps/unix/sysv/linux/pt-raise.c: New file.
4446 * sysdeps/generic/pt-raise.c: New file.
4448 * pthread_cond_init.c: Initialize all data elements of the condvar
4449 structure. Patch by Luca Barbieri <ldb@ldb.ods.org>.
4451 * pthread_attr_init.c: Actually implement 2.0 compatibility version.
4452 * pthread_create.c: Likewise.
4454 * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
4455 * tst-key1.c: New file.
4456 * tst-key2.c: New file.
4457 * tst-key3.c: New file.
4459 * Versions: Export pthread_detach for version GLIBC_2.0.
4460 Reported by Saurabh Desai <sdesai@austin.ibm.com>.
4462 2002-11-08 Ulrich Drepper <drepper@redhat.com>
4464 * pthread_key_create.c: Terminate search after an unused key was found.
4465 Patch by Luca Barbieri <ldb@ldb.ods.org>.
4467 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
4468 Patch by Luca Barbieri <ldb@ldb.ods.org>.
4470 2002-10-10 Ulrich Drepper <drepper@redhat.com>
4472 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
4473 dynamic lookup for errno in PIC.
4475 * allocatestack.c (get_cached_stack): Rearrange code slightly to
4476 release the stack lock as soon as possible.
4477 Call _dl_allocate_tls_init for TCB from the cache to re-initialize
4478 the static TLS block.
4479 (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
4481 * cancellation.c: Renamed from cancelation.c.
4482 * Makefile: Adjust accordingly.
4483 * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
4484 * cleanup_defer.c: Use CANCELLATION_P.
4485 * pthread_testcancel.c: Likewise.
4486 * descr.h: Fix spelling in comments.
4488 * pthread_getattr_np.c: Likewise.
4489 * pthread_getschedparam.c: Likewise.
4490 * pthread_setschedparam.c: Likewise.
4491 * Versions: Likewise.
4493 * pt-pselect.c: New file.
4494 * Makefile (libpthread-routines): Add pt-pselect.
4495 * Versions: Add pselect.
4497 * tst-cancel4.c: New file.
4498 * Makefile (tests): Add tst-cancel4.
4500 2002-10-09 Ulrich Drepper <drepper@redhat.com>
4502 * pthread_mutex_lock.c: Always record lock ownership.
4503 * pthread_mutex_timedlock.c: Likewise.
4504 * pthread_mutex_trylock.c: Likewise.
4506 * pt-readv.c: New file.
4507 * pt-writev.c: New file.
4508 * pt-creat.c: New file.
4509 * pt-msgrcv.c: New file.
4510 * pt-msgsnd.c: New file.
4511 * pt-poll.c: New file.
4512 * pt-select.c: New file.
4513 * pt-sigpause.c: New file.
4514 * pt-sigsuspend.c: New file.
4515 * pt-sigwait.c: New file.
4516 * pt-sigwaitinfo.c: New file.
4517 * pt-waitid.c: New file.
4518 * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
4519 pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
4520 pt-sigwait, pt-sigwaitinfo, and pt-waitid.
4521 * Versions: Add all the new functions.
4523 * tst-exit1.c: New file.
4524 * Makefile (tests): Add tst-exit1.
4526 * sem_timedwait.c: Minor optimization for more optimal fastpath.
4528 2002-10-08 Ulrich Drepper <drepper@redhat.com>
4530 * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
4532 * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
4533 call. pthread_join is an official cancellation point.
4534 * pthread_timedjoin.c: Likewise.
4536 * pthread_cond_wait.c: Revert order in which internal lock are dropped
4537 and the condvar's mutex are retrieved.
4538 * pthread_cond_timedwait.c: Likewise.
4539 Reported by dice@saros.East.Sun.COM.
4541 2002-10-07 Ulrich Drepper <drepper@redhat.com>
4543 * pthreadP.h: Cut out all type definitions and move them...
4544 * sysdeps/unix/sysv/linux/internaltypes.h: ...here. New file.
4545 * pthreadP.h: Include <internaltypes.h>.
4547 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
4550 * sem_trywait.c: Shuffle #includes around to get right order.
4551 * sem_timedwait.c: Likewise.
4552 * sem_post.c: Likewise.
4553 * sem_wait.c: Likewise.
4555 * nptl 0.3 released.
4557 * Makefile (tests): Add tst-signal3.
4558 * tst-signal3.c: New file.
4560 2002-10-05 Ulrich Drepper <drepper@redhat.com>
4562 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
4563 the asms modify the sem object.
4564 (__lll_sem_timedwait): Now takes struct sem* as first parameter.
4566 * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
4568 * pthreadP.h (struct sem): New type. Actual semaphore type.
4569 * semaphoreP.h: Include pthreadP.h.
4570 * sem_getvalue.c: Adjust to sem_t change.
4571 * sem_init.c: Likewise.
4572 * sem_open.c: Likewise.
4573 * sem_post.c: Likewise.
4574 * sem_timedwait.c: Likewise.
4575 * sem_trywait.c: Likewise.
4576 * sem_wait.c: Likewise.
4578 2002-10-04 Ulrich Drepper <drepper@redhat.com>
4580 * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
4581 * tst-basic2.c: New file.
4582 * tst-exec1.c: New file.
4583 * tst-exec2.c: New file.
4584 * tst-exec3.c: New file.
4586 * tst-fork1.c: Remove extra */.
4588 * nptl 0.2 released. The API for IA-32 is complete.