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