]> git.ipfire.org Git - thirdparty/glibc.git/blame - nptl/ChangeLog
Update.
[thirdparty/glibc.git] / nptl / ChangeLog
CommitLineData
71451de2
UD
12003-09-21 Ulrich Drepper <drepper@redhat.com>
2
3 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
4 locking macros. No distinction between normal and mutex locking
5 anymore.
3a226d33 6 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
bc1989aa
UD
7 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
8 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
71451de2
UD
9 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
10 locking. Merge bits from lowlevelmutex.S we still need.
3a226d33 11 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
bc1989aa 12 * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
71451de2 13 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
3a226d33 14 * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
71451de2
UD
15 * Makefile (routines): Remove libc-lowlevelmutex.
16 (libpthread-rountines): Remove lowlevelmutex.
3a226d33
UD
17 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
18 for new mutex implementation.
19 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
20 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
21 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
22 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
23 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
24 Likewise.
25 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
26 Likewise.
27 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
28 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
29 * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
30 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
31 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
32 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
33 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
34 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
35 Likewise.
36 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
37 Likewise.
38 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
39 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
40 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
41 Don't use requeue.
42 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
bc1989aa 43 * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
71451de2 44
8f31c0ef
UD
452003-09-20 Ulrich Drepper <drepper@redhat.com>
46
56a4aa98
UD
47 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
48 in parameters of asm with output parameters.
49
8f31c0ef
UD
50 * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
51 type of DECR parameter to int.
52 * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
53
8b8074da
UD
542003-09-18 Jakub Jelinek <jakub@redhat.com>
55
56 * tst-attr3.c (tf, do_test): Print stack start/end/size and
57 guardsize for each thread.
58
65af7e61
UD
592003-09-17 Jakub Jelinek <jakub@redhat.com>
60
9ba96eda
UD
61 * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
62 * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
63 (pthread_attr_setaffinity_np): Handle cpuset == NULL.
64
06f6ca90
UD
65 * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
66 (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
67 NULL.
68 * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
69 * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
70 * sysdeps/unix/sysv/linux/pthread_getaffinity.c
71 (pthread_getaffinity_np): Add hidden_def.
72
73 * Makefile (tests): Add tst-attr3.
74 * tst-attr3.c: New test.
75
65af7e61
UD
76 * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
77
3402852c
UD
782003-09-15 Jakub Jelinek <jakub@redhat.com>
79
80 * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
81 CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
82
a4db3439
UD
832003-09-17 Jakub Jelinek <jakub@redhat.com>
84
85 * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
86 * tst-align.c: Include tst-stack-align.h.
87 (tf, do_test): Use TEST_STACK_ALIGN macro.
88
892003-09-17 Ulrich Drepper <drepper@redhat.com>
90
91 * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
92 variable.
93
92ce4676
UD
942003-09-16 Ulrich Drepper <drepper@redhat.com>
95
96 * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
97 stack-related values for the initial thread.
98
e07bb02a
UD
992003-09-15 Jakub Jelinek <jakub@redhat.com>
100
101 * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
102
d087b5dc
UD
1032003-09-11 Ulrich Drepper <drepper@redhat.com>
104
105 * pthread_mutex_lock.c: Minor code rearrangements.
106
7f08f55a
RM
1072003-09-05 Roland McGrath <roland@redhat.com>
108
109 * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
110 Instead, include ../nptl_db/db_info.c to do its magic.
111 * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
112 (__pthread_pthread_key_2ndlevel_size): Likewise.
113 * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
114 * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
115 * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
116 * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
117 * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
118 * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
119 * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
120 * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
121 * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
122 * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
123 * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
124 * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
125 * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
126 * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
127 * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
128 * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
129 * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
130
806e4a4a
UD
1312003-09-08 Ulrich Drepper <drepper@redhat.com>
132
133 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
134 of pthread_t to be compatible with LT.
135 * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
136 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
137 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
138 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
139 * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
140 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
141 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
142
17f83e56
UD
1432003-09-04 Ulrich Drepper <drepper@redhat.com>
144
145 * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
146
58e8ec84
UD
1472003-09-04 Jakub Jelinek <jakub@redhat.com>
148
149 * unwind-forcedunwind.c: Move to...
150 * sysdeps/pthread/unwind-forcedunwind.c: ...here.
151 (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
152 * sysdeps/pthread/jmpbuf-unwind.h: New file.
153 * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
154 * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
155 * unwind.c: Include jmpbuf-unwind.h.
156 (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
157
abf1cf21
JJ
1582003-09-02 Jakub Jelinek <jakub@redhat.com>
159
4a244f0d
UD
160 * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
161 * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
162 pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
163 * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
164 * sysdeps/unix/sysv/linux/alpha/Versions: New file.
165 * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
166 * sysdeps/unix/sysv/linux/sparc/Versions: New file.
167 * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
168 (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
169 as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
170 * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
171 function.
172 (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
173 as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
174 * Makefile (tests): Add tst-stack2.
175 * tst-stack2.c: New test.
176 * tst-stack1.c: Include limits.h and sys/param.h.
177 (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
178
e29ef647
UD
179 * pthread_condattr_setpshared.c: Include errno.h.
180 (pthread_condattr_setpshared): Return EINVAL if pshared
181 is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
182
5777d565
UD
183 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
184 defined symbol for entry point to avoid cancellation.
185 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
186 Likewise.
187 * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
188 Likewise.
189 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
190 Likewise.
191 * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
192 Likewise.
193 * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
194 Likewise.
195 * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
196 __close_nocancel, __read_nocancel, __write_nocancel,
197 __waitpid_nocancel): Add attribute_hidden. If not in libc.so,
198 libpthread.so or librt.so, define to corresponding function
199 without _nocancel suffix.
200 * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
201 * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
202 * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
203
abf1cf21
JJ
204 * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
205
8348dcc8
UD
2062003-09-02 Ulrich Drepper <drepper@redhat.com>
207
208 * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
1e03e0af 209 * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
8348dcc8
UD
210
211 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
212 in subsections has a symbol associated with it.
213
214 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
215 defined symbol for entry point to avoid cancellation.
216 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
217
c874a32e
UD
2182003-09-01 Jakub Jelinek <jakub@redhat.com>
219
220 * Makefile (tests): Add tst-tls5.
221 (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
222 ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
223 ($(objpfx)tst-tls5): New.
224 ($(objpfx)tst-tls6.out): Likewise.
225 (tests): Depend on $(objpfx)tst-tls6.out.
226 * tst-tls3.c: Include stdint.h and pthreaddef.h.
227 (do_test): Check pthread_self () return value alignment.
228 * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
229 (tf): Check pthread_self () return value alignment.
230 * tst-tls5.c: New test.
231 * tst-tls5.h: New.
232 * tst-tls5mod.c: New.
233 * tst-tls5moda.c: New.
234 * tst-tls5modb.c: New.
235 * tst-tls5modc.c: New.
236 * tst-tls5modd.c: New.
237 * tst-tls5mode.c: New.
238 * tst-tls5modf.c: New.
239 * tst-tls6.sh: New test.
240
c503d3dc
UD
241 * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
242 ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
243 * init.c (pthread_functions): Initialize them.
244 * forward.c (pthread_cond_timedwait@GLIBC_2.0,
245 pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
246 * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
247 pthread_cond_timedwait@@GLIBC_2.3.2.
248
48614753
JJ
2492003-09-01 Jakub Jelinek <jakub@redhat.com>
250
56a1b877
JJ
251 * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
252 * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
253 * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
254 * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
255 * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
256 * sysdeps/unix/sysv/linux/alpha/Versions: New file.
257
258 * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
259
48614753
JJ
260 * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
261 _POSIX_THREAD_PRIORITY_SCHEDULING.
262 * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
263
28c97261
UD
2642003-08-31 Ulrich Drepper <drepper@redhat.com>
265
eef80cf8
UD
266 * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
267 nested function, use static inline function from libio.h.
268 Code by Richard Henderson.
269
28c97261
UD
270 * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
271 weak.
272
cd2fbe58
UD
2732003-08-30 Jakub Jelinek <jakub@redhat.com>
274
275 * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
276 * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
277 * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
278 * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
279 * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
280 * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
281 * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
282 * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
283 * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
284 * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
285 * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
286 * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
287 * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
288 * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
289 * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
290 * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
291 * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
292 * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
293 * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
294 * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
295 * sysdeps/sparc/sparc32/pthreaddef.h: New file.
296 * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
297 * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
298 * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
299 * sysdeps/sparc/sparc64/pthreaddef.h: New file.
300 * sysdeps/sparc/tls.h: New file.
301 * sysdeps/sparc/tcb-offsets.sym: New file.
302 * sysdeps/sparc/Makefile: New file.
303 * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
304 * init.c [__sparc__] (__NR_set_tid_address): Define.
305
feda52c0
UD
3062003-08-29 Jakub Jelinek <jakub@redhat.com>
307
308 * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
309 _IO_release_lock): Define.
310
7c868816
JJ
3112003-08-29 Jakub Jelinek <jakuB@redhat.com>
312
0261d33f 313 * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
7c868816
JJ
314 sigemptyset before sigaddset. Reported by jreiser@BitWagon.com.
315
68b9e1ae
UD
3162003-08-27 Ulrich Drepper <drepper@redhat.com>
317
318 * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
319 (__pthread_cleanup_class): Add missing return types of member
320 functions.
321
13b3edfc
UD
3222003-08-26 Steven Munroe <sjmunroe@us.ibm.com>
323
324 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
325 (lll_mutex_unlock_force): Add memory barrier between store and futex
326 syscall.
327
bb606fbe
UD
3282003-08-25 Ulrich Drepper <drepper@redhat.com>
329
330 * tst-cancel4.c (do_test): Also unlink tempfname and remove
331 tempmsg in first loop.
332
ee4e5a3d
UD
3332003-08-18 Ulrich Drepper <drepper@redhat.com>
334
335 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
336 _POSIX_THREAD_PRIORITY_SCHEDULING.
337 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
338
334fcf2a
UD
3392003-08-07 Jakub Jelinek <jakub@redhat.com>
340
341 * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
342 (__rtld_lock_default_lock_recursive,
343 __rtld_lock_default_unlock_recursive): Define.
344 [_LIBC && SHARED] (__rtld_lock_lock_recursive,
345 __rtld_lock_unlock_recursive): Define using
346 GL(_dl_rtld_*lock_recursive).
347 * init.c (__pthread_initialize_minimal_internal): Initialize
348 _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
349 Lock GL(_dl_load_lock) the same number of times as
350 GL(_dl_load_lock) using non-mt implementation was nested.
351
352 * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
353 * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
354
a30fb2df
UD
3552003-08-06 Jakub Jelinek <jakub@redhat.com>
356
357 * tst-cancel17.c (do_test): Make len2 maximum of page size and
358 PIPE_BUF.
359
ce0d30a0
JJ
3602003-08-07 Jakub Jelinek <jakub@redhat.com>
361
362 * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
363
9c988b83
UD
3642003-08-03 Jakub Jelinek <jakub@redhat.com>
365
366 * sysdeps/pthread/createthread.c (do_clone): Move error handling
367 to first syscall error check. Move syscall error check for tkill
368 into __ASSUME_CLONE_STOPPED #ifdef.
369
5c5252bd
UD
3702003-08-02 Ulrich Drepper <drepper@redhat.com>
371
f1205aa7
UD
372 * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
373 is not defined, do explicit synchronization.
374 (create_thread): Do not lock pd->lock here. If __ASSUME_CLONE_STOPPED
375 is not defined also unlock pd->lock for non-debugging case in case
376 it is necessary.
377 * pthread_create.c (start_thread): Always get and release pd->lock
378 if __ASSUME_CLONE_STOPPED is not defined.
379 (start_thread_debug): Removed. Adjust users.
380 * allocatestack.c (allocate_stack): Always initialize lock if
381 __ASSUME_CLONE_STOPPED is not defined.
382 * Makefile (tests): Add tst-sched1.
383 * tst-sched1.c: New file.
384
5c5252bd
UD
385 * sysdeps/pthread/createthread.c (do_clone): Only use
386 sched_setschduler and pass correct parameters.
387
973d66e4
UD
3882003-07-31 Jakub Jelinek <jakub@redhat.com>
389
390 * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
391 pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
392 PTHREAD_STACK_MIN in comments.
393
d347a4ab
UD
3942003-07-31 Jakub Jelinek <jakub@redhat.com>
395
396 * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
397 Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
398 argument.
399 * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
400 * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
401 * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
402 (__pthread_cleanup_upto): Fix prototype.
403 (_longjmp_unwind): Adjust caller.
404 * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
405 Change second argument to const struct pointer.
406 * tst-sem8.c (main): Remove unused s2 and s3 variables.
407 * tst-sem9.c (main): Likewise.
408 * unwind.c: Include string.h for strlen prototype.
409
1b26e9a5
UD
4102003-07-31 Ulrich Drepper <drepper@redhat.com>
411
412 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
413 (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
414 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
415 Define HAVE_CMOV.
416 Patch by Nicholas Miell <nmiell@attbi.com>.
417
adc12574
UD
4182003-07-30 Jakub Jelinek <jakub@redhat.com>
419
420 * init.c (__pthread_initialize_minimal_internal): Initialize
421 GL(dl_init_static_tls).
422 * pthreadP.h (__pthread_init_static_tls): New prototype.
423 * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
424 New functions.
425 * Makefile (tests): Add tst-tls4.
426 (modules-names): Add tst-tls4moda and tst-tls4modb.
427 ($(objpfx)tst-tls4): Link against libdl and libpthread.
428 ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
429 tst-tls4modb.so.
430 * tst-tls4.c: New file.
431 * tst-tls4moda.c: New file.
432 * tst-tls4modb.c: New file.
433
a7f6c66e
RM
4342003-06-19 Daniel Jacobowitz <drow@mvista.com>
435
436 * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
437 before __timer_dealloc.
438 * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
439 Don't call list_unlink.
440
172ce013
RM
4412003-07-29 Roland McGrath <roland@redhat.com>
442
443 * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
444
7b787f85
UD
4452003-07-25 Jakub Jelinek <jakub@redhat.com>
446
447 * tst-cancel17.c (do_test): Check if aio_cancel failed.
448 Don't reuse struct aiocb A if it failed.
449 Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
450 not just one byte, as that does not block.
451
0e9d6240
UD
4522003-07-22 Jakub Jelinek <jakub@redhat.com>
453
9d79e037
UD
454 * sysdeps/pthread/unwind-resume.c: New file.
455 * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
456 unwind-resume in csu subdir.
457 (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
458 exceptions.
459 (librt-sysdep_routines, librt-shared-only-routines): Add
460 rt-unwind-resume.
461 * sysdeps/pthread/rt-unwind-resume.c: New file.
462 * unwind-forcedunwind.c: New file.
463 * Makefile (libpthread-routines): Add unwind-forcedunwind.
464 (libpthread-shared-only-routines): Likewise.
465 (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
466 * pthreadP.h (pthread_cancel_init): New prototype.
467 * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
468
469 * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
470 attr argument const struct pthread_attr *.
471
0e9d6240
UD
472 * res.c (__res_state): Return __resp.
473 * descr.h: Include resolv.h.
474 (struct pthread): Add res field.
475 * pthread_create.c: Include resolv.h.
476 (start_thread): Initialize __resp.
477 * Makefile (tests): Add tst-_res1.
478 (module-names): Add tst-_res1mod1, tst-_res1mod2.
479 ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
480 ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
481 libpthread.
482 * tst-_res1.c: New file.
483 * tst-_res1mod1.c: New file.
484 * tst-_res1mod2.c: New file.
485
1a379ea0
UD
4862003-07-21 Ulrich Drepper <drepper@redhat.com>
487
7e939b21
UD
488 * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
489
1a379ea0
UD
490 * Makefile: Define various *-no-z-defs variables for test DSOs
491 which has undefined symbols.
492
ca86a763
UD
4932003-07-21 Steven Munroe <sjmunroe@us.ibm.com>
494
495 * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
496 Retry if the stwcx fails to store once_control.
497
80f536db
UD
4982003-07-20 Ulrich Drepper <drepper@redhat.com>
499
500 * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
501 pthread_attr_setaffinity.
502 * Versions [libpthread] (GLIBC_2.3.3): Likewise.
503 * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
504 * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
505 * pthread_attr_destroy.c: Free cpuset element if allocated.
506 * pthread_create.c: Pass iattr as additional parameter to
507 create_thread.
508 * sysdeps/pthread/createthread.c: If attribute is provided and
509 a new thread is created with affinity set or scheduling parameters,
510 start thread with CLONE_STOPPED.
511 * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
512 pthread_attr_setaffinity.
513 * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
514 cpuset element.
515
73299943
UD
5162003-07-15 Ulrich Drepper <drepper@redhat.com>
517
518 * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
519
da35d15e
UD
5202003-07-14 Ulrich Drepper <drepper@redhat.com>
521
522 * sysdeps/pthread/configure.in: Require CFI directives also for
523 ppc and s390.
524
75540d8a
UD
5252003-07-15 Jakub Jelinek <jakub@redhat.com>
526
527 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
528 Add cfi directives.
529
4a17085f
UD
5302003-07-12 Kaz Kojima <kkojima@rr.iij4u.or.jp>
531
532 * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
533 CLEANUP_JMP_BUF.
534 * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
535 registers as variables. Call __pthread_mutex_unlock_usercnt.
536 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
537 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
538 not self pointer in __writer. Compare with TID to determine
539 deadlocks.
540 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
541 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
542 Likewise.
543 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
544 Likewise.
545 * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
546 * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
547 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
548 macros also when compiling librt.
549
6080ecdf
UD
5502003-07-11 Jakub Jelinek <jakub@redhat.com>
551
552 * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
553 -fasynchronous-unwind-tables.
554 * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
555 (PSEUDO): Add cfi directives.
556 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
557 Likewise.
558 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
559 Likewise.
560
da0c02ee
UD
5612003-07-08 Jakub Jelinek <jakub@redhat.com>
562
563 * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
564 __pthread_unregister_cancel): Add prototypes and hidden_proto.
565 * unwind.c (__pthread_unwind_next): Add hidden_def.
566 * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
567 Likewise.
568 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
569 Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
570 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
571 Likewise.
572 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
573 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
574 Likewise.
575 * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
576 HIDDEN_JUMPTARGET to call __pthread_register_cancel,
577 __pthread_unregister_cancel and __pthread_unwind_next.
578
57a5ea02
UD
5792003-07-04 Jakub Jelinek <jakub@redhat.com>
580
581 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
582 different symbol for the cancellation syscall wrapper and
583 non-cancellation syscall wrapper.
584 (PSEUDO_END): Define.
585
d810b358
UD
5862003-07-05 Richard Henderson <rth@redhat.com>
587
588 * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
589 * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
590 lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
591 return actual return value from the syscall, not 0.
592
db54f488
UD
5932003-07-07 Ulrich Drepper <drepper@redhat.com>
594
595 * descr.h (struct pthread): Add pid field.
596 * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
597 (__reclaim_stacks): Likewise.
598 * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
599 also check for PID of the signal source.
600 (__pthread_initialize_minimal_internal): Also initialize pid field
601 of initial thread's descriptor.
602 * pthread_cancel.c: Use tgkill instead of tkill if possible.
603 * sysdeps/unix/sysv/linux/fork.c: Likewise.
604 * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
605 * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
606 * sysdeps/unix/sysv/linux/raise.c: Likewise.
607
5e497a41
UD
6082003-07-05 Ulrich Drepper <drepper@redhat.com>
609
610 * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
611 Fix use of parameter.
612 (__libc_cleanup_pop): Likewise.
613
86a0c4fa
UD
6142003-07-04 Ulrich Drepper <drepper@redhat.com>
615
616 * init.c (sigcancel_handler): Change parameters to match handler
617 for SA_SIGACTION. Check signal number and code to recognize
618 invalid invocations.
619
bdbecaa3
RM
6202003-07-03 Roland McGrath <roland@redhat.com>
621
622 * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
623 Apply sizeof (struct pthread) bias to r13 value.
624
56421b23
UD
6252003-07-03 Ulrich Drepper <drepper@redhat.com>
626
fbd90f6c
UD
627 * sysdeps/pthread/configure.in: Require CFI directives.
628
56421b23
UD
629 * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
630 definition.
631 * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
632 libpthread compilation.
633 * unwind.c (__pthread_unwind): Add hidden_def.
634 * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
635
ca2b4cd7
UD
6362003-07-01 Ulrich Drepper <drepper@redhat.com>
637
638 * libc-cancellation.c (__libc_cleanup_routine): Define.
639 * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
640 (__pthread_cleanup_pop): Define.
641
f036e569
UD
6422003-07-01 Richard Henderson <rth@redhat.com>
643
644 * sysdeps/alpha/elf/pt-initfini.c: New file.
645 * sysdeps/alpha/pthread_spin_lock.S: New file.
646 * sysdeps/alpha/pthread_spin_trylock.S: New file.
647 * sysdeps/alpha/pthreaddef.h: New file.
648 * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
649 * sysdeps/alpha/tls.h: New file.
650 * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
651 * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
652 * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
653 * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
654 * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
655 * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
656 * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
657 * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
658 * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
659 * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
660
3b985826
UD
6612003-07-01 Ulrich Drepper <drepper@redhat.com>
662
663 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
664 cleanup support and unwind info.
665
3a4d1e1e
UD
6662003-06-30 Ulrich Drepper <drepper@redhat.com>
667
668 * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
669 Use correct cleanup handler registration. Add unwind info.
96c814d3
UD
670 * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
671 * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
3a4d1e1e
UD
672 * tst-once3.c: Add cleanup handler and check it is called.
673 * tst-once4.c: Likewise.
674 * tst-oncex3.c: New file.
675 * tst-oncex4.c: New file.
676 * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
677
e479cc8e
UD
6782003-06-29 Ulrich Drepper <drepper@redhat.com>
679
680 * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
681
7d7ff54c
UD
6822003-06-27 Ulrich Drepper <drepper@redhat.com>
683
483e95d0
UD
684 * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
685 (tf_msgsnd): Likewise.
686
7d7ff54c
UD
687 * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
688 premature returns a bit more.
689
7539c7ec
UD
6902003-06-26 Ulrich Drepper <drepper@redhat.com>
691
692 * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
693 definition to the front.
694
695 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
696 the cleanup functions to make the names unique. Fix dwarf opcode
697 un unwind table.
698 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
699 functions to make the names unique. Fix CFA offset for two blocks.
700
0af6a1d9
UD
7012003-06-25 Ulrich Drepper <drepper@redhat.com>
702
703 * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
704 missing closing braces.
705 Patch by Christophe Saout <christophe@saout.de>.
706
eef4a9f3
RM
7072003-06-24 Roland McGrath <roland@redhat.com>
708
709 * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
710
4165d44d
UD
7112003-06-24 Ulrich Drepper <drepper@redhat.com>
712
7f8f7b9d
UD
713 * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
714 * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
715
4165d44d
UD
716 * pthreadP.h: Declare __find_thread_by_id.
717 * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
718 * pthread_clock_gettime.c: Allow using other thread's clock.
719 * pthread_clock_settime.c: Likewise.
720 * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
721 * Makefile: Add rules to build and run tst-clock2.
722 * tst-clock2.c: New file.
723
67b78ef9
UD
7242003-06-23 Ulrich Drepper <drepper@redhat.com>
725
726 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
727 to use exception-based cleanup handler.
728 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
729
730 * tst-cond8.c (ch): Announce that we are done.
731
732 * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
733
734 * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
735 Also test aio_suspend with timeout value.
736
61623643
UD
7372003-06-22 Ulrich Drepper <drepper@redhat.com>
738
3a4f2043
UD
739 * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
740 * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
741 attribute_hidden.
742
61623643
UD
743 * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
744 (__pthread_mutex_lock_internal): Likewise.
745 (__pthread_mutex_unlock_internal): Likewise.
746 (__pthread_mutex_unlock_usercnt): Declare.
747 * pthread_mutex_destroy.c: Always fail if used in any way.
748 * pthread_mutex_init.c: Update comment.
749 * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
750 * pthread_mutex_timedlock.c: Adjust __nusers.
751 * pthread_mutex_trylock.c: Adjust __nusers.
752 * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
753 and public interfaces are wrapper with pass additional parameter.
754 __pthread_mutex_unlock_usercnt does not adjust __nusers if second
755 parameter zero.
756 * tst-mutex8.c: New file.
757 * Makefile (tests): Add tst-mutex8.
758 * sysdeps/pthread/pthread_cond_timedwait.c: Call
759 __pthread_mutex_unlock_usercnt.
760 * sysdeps/pthread/pthread_cond_wait.c: Likewise.
761 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
762 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
763 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
764 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
765 * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
766 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
767 Add __nusers.
768 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
769 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
770 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
771 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
772 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
773
774 * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
775 * pthread_mutex_timedlock.c: Likewise.
776 * pthread_mutex_trylock.c: Adjust __nusers.
777 * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
778 * tst-mutex9.c: New file.
779 * Makefile (tests): Add tst-mutex9.
780 * sysdeps/i386/tls.h: Remove THREAD_ID definition.
781 * sysdeps/ia64/tls.h: Likewise.
782 * sysdeps/powerpc/tls.h: Likewise.
783 * sysdeps/s390/tls.h: Likewise.
784 * sysdeps/sh/tls.h: Likewise.
785 * sysdeps/x86_64/tls.h: Likewise.
786 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
787 Change type of __owner.
788 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
789 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
790 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
791 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
792 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
793
9bdabb94
UD
7942003-06-19 Jakub Jelinek <jakub@redhat.com>
795
796 * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
797 * sysdeps/unix/sysv/linux/sem_post.c: ...here.
798
799 * sysdeps/unix/sysv/linux/sem_post.c: Move to...
800 * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here. Pass nr + 1
801 instead of nr to lll_futex_wake. Only set errno and return -1
802 if err < 0.
803
804 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
805 lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
806 return actual return value from the syscall, not 0.
807
f6c93bd9
UD
8082003-06-18 Ulrich Drepper <drepper@redhat.com>
809
ca343e73
UD
810 * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
811 find a random value.
812 (tf_msgrcv): Likewise. Also don't report msgrcv returns if
813 errno==EIDRM.
814
50441a98
UD
815 * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
816 compat_timer_settime.
817 * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
818 compat_timer_gettime.
819 * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
9bdabb94 820 compat_timer_getoverrun.
50441a98
UD
821 * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
822 compat_timer_delete.
823
f6c93bd9
UD
824 * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
825 error-checking mutex detect busy mutexes.
826
047aec8f
UD
8272003-06-17 Ulrich Drepper <drepper@redhat.com>
828
1d53508d
UD
829 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
830 Add ax to clobber list.
831 (lll_mutex_cond_lock): Likewise.
832 (lll_mutex_unlock): Likewise.
833 (lll_lock): Likewise.
834 (lll_unlock): Likewise.
835
f23b30e2
UD
836 * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
837 * tst-cancel18.c: New file.
838 * tst-cancelx18.c: New file.
839
840 * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
841 and tcdrain.
842
843 * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
844 * tst-cancel17.c: New file.
845 * tst-cancelx17.c: New file.
846
847 * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
848 * sysdeps/unix/sysv/linux/sigwait.c: New file.
849 * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
850
047aec8f
UD
851 * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
852
bbde8527
UD
8532003-06-16 Jakub Jelinek <jakub@redhat.com>
854
855 * sysdeps/pthread/createthread.c (create_thread): Set
856 header.multiple_threads unconditionally.
857 * allocatestack.c (allocate_stack): Likewise.
858 * descr.h (struct pthread): Add header.multiple_threads
859 unconditionally.
860 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
861 Define for librt. #error if neither libpthread, libc nor librt.
862 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
863 Likewise.
864 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
865 CDISABLE): Likewise.
866 * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
867 CDISABLE): Likewise.
868 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
869 CDISABLE): Likewise.
870 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
871 CDISABLE): Likewise. Access header.multiple_threads outside of
872 libc and libpthread.
873 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
874 Likewise.
875 * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
876 * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
877
26676450
UD
8782003-06-17 Ulrich Drepper <drepper@redhat.com>
879
880 * tst-cancel4.c: Add tests for the socket and signal functions, pause.
881 Also test early cancellation before the thread reaches the cancellation
882 point.
883
884 * Makefile: Compile forward.c with exceptions.
885
886 * sysdeps/unix/sysv/linux/sleep.c: New file.
887
301a6724
UD
8882003-06-16 Ulrich Drepper <drepper@redhat.com>
889
0e0deb03
UD
890 * Makefile: Add CFLAGS definition to compile function wrappers
891 duplicated from libc with exceptions.
892 * tst-cancel4.c: Also check cancellation handlers.
893
301a6724
UD
894 * Makefile: Add rules to build and run tst-cancel16 and
895 tst-cancelx16. Add missing CFLAGS definitions.
896 * tst-cancel16.c: New file.
897 * tst-cancelx16.c: New file.
898
7a114794
UD
8992003-06-15 Ulrich Drepper <drepper@redhat.com>
900
452aea84
UD
901 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
902 (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
903 * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
904 (DL_SYSINFO_IMPLEMENTATION): Likewise.
905
7a114794
UD
906 * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
907 (LIBC_CANCEL_RESET): Likewise.
908 Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
909 * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
910 librt-cancellation.
911 (CFLAGS-libcrt-cancellation.c): Define.
912 * sysdeps/pthread/librt-cancellation.c: New file.
913 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
914 macros also when compiling librt.
915 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
916 * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
917 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
918 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
919 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
920 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
921 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
922
923 * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
924 compat_timer_create.
925
8ba1d429
UD
9262003-06-14 Ulrich Drepper <drepper@redhat.com>
927
cc8fb6f3
UD
928 * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
929
8ba1d429
UD
930 * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
931 __register_atfork.
932 * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
933 Add libc_hidden_def.
934
d4f100e2
RM
9352003-06-13 Roland McGrath <roland@redhat.com>
936
937 * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
938 constant from <sys/reg.h> to ps_get_thread_area, not register contents.
939
dd9423a6
UD
9402003-06-11 Ulrich Drepper <drepper@redhat.com>
941
942 * allocatestack.c (queue_stack): Always inline.
943 * ptreadhP.h (__do_cancel): Likewise.
944
ed24330d
JJ
9452003-06-10 Jakub Jelinek <jakub@redhat.com>
946
947 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
948 a typo.
949
06120d79
UD
9502003-06-10 Ulrich Drepper <drepper@redhat.com>
951
952 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
953 (__pthread_cond_signal): Remove incorrect second addition for
954 cond_lock!=0.
955
b1720346
UD
9562003-06-09 Ulrich Drepper <drepper@redhat.com>
957
5b318f85
UD
958 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
959 (__pthread_cond_signal): Use correct futex pointer in
960 __lll_mutex_lock_wait call.
961
b1720346
UD
962 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
963 (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
964
3e36c37d
UD
9652003-06-08 Ulrich Drepper <drepper@redhat.com>
966
ecf7955d
UD
967 * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
968 cancelable.
ed24330d 969 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
ecf7955d
UD
970 Likewise.
971
3e36c37d
UD
972 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
973 hand-written CFI generation code. Since ENTRY/END also initiated
974 CFI frames this caused two CFI sets to be generated.
975
7726edc2
UD
9762003-06-07 Ulrich Drepper <drepper@redhat.com>
977
978 * cleanup_routine.c: New file.
979 * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
980 * sysdeps/pthread/pthread.h: Add support for fully exception-based
981 cleanup handling.
982 * Makefile (libpthread-routines): Add cleanup_routine.
983 Add more CFLAGS variables to compile with exceptions. Add comments
984 why which file needs unwind tables.
985 (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
986 tests.
987 * tst-cancelx1.c: New file.
988 * tst-cancelx2.c: New file.
989 * tst-cancelx3.c: New file.
990 * tst-cancelx4.c: New file.
991 * tst-cancelx5.c: New file.
992 * tst-cancelx6.c: New file.
993 * tst-cancelx7.c: New file.
994 * tst-cancelx8.c: New file.
995 * tst-cancelx9.c: New file.
996 * tst-cancelx10.c: New file.
997 * tst-cancelx11.c: New file.
998 * tst-cancelx12.c: New file.
999 * tst-cancelx13.c: New file.
1000 * tst-cancelx14.c: New file.
1001 * tst-cancelx15.c: New file.
1002 * tst-cleanupx0.c: New file.
1003 * tst-cleanupx0.expect: New file.
1004 * tst-cleanupx1.c: New file.
1005 * tst-cleanupx2.c: New file.
1006 * tst-cleanupx3.c: New file.
1007
1008 * tst-cleanup0.c: Make standard compliant.
1009 * tst-cleanup1.c: Likewise.
1010
1011 * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
1012 * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1013 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1014 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1015 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1016 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1017 * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
1018 CLEANUP_JMP_BUF.
1019 * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1020 * tst-cancel12.c: New file.
1021 * tst-cancel13.c: New file.
1022 * tst-cancel14.c: New file.
1023 * tst-cancel15.c: New file.
1024 * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
1025 and tst-cancel15.
1026
1027 * tst-cancel1.c: Add some comments.
1028
1029 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
1030 timeout correctly.
1031
7a8a8e21
UD
10322003-06-06 Ulrich Drepper <drepper@redhat.com>
1033
1034 * Makefile (CFLAGS-pthread_cancel.c): Define.
1035
4ad0bbf4
UD
10362003-06-05 Ulrich Drepper <drepper@redhat.com>
1037
1038 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
1039 Change type of __writer element to int.
1040 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1041 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1042 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1043 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1044 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1045 * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
1046 * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1047 * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
1048 Compare with TID to determine deadlocks.
1049 * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
1050 * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
1051 * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
1052 * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
1053 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1054 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1055 Likewise.
1056 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1057 Likewise.
1058 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1059 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1060 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1061 Likewise.
1062 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1063 Likewise.
1064 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1065 * Makefile (tests): Add tst-rwlock12.
1066 * tst-rwlock12.c: New file.
1067
332faa96
JJ
10682003-06-05 Jakub Jelinek <jakub@redhat.com>
1069
1070 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
1071 __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
1072 Remove bogus hidden_proto.
1073 * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
1074 Likewise.
1075 * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
1076 lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
1077 * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
1078 ___lll_mutex_timedlock): Likewise.
1079
29d9e2fd
UD
10802003-06-04 Ulrich Drepper <drepper@redhat.com>
1081
1082 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1083 (__pthread_cond_signal): Add some code to eventually handle
1084 cond_lock!=0.
1085
6f1acb30
UD
10862003-06-01 Ulrich Drepper <drepper@redhat.com>
1087
1088 * Makefile (tests): Add tst-exec4.
1089 (tst-exec4-ARGS): Define.
1090 * tst-exec4.c: New file.
1091
49b65043
UD
10922003-05-31 Ulrich Drepper <drepper@redhat.com>
1093
31195be2
UD
1094 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
1095 Also fail if tv_nsec < 0.
1096 (__lll_timedwait_tid): Likewise.
1097 * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1098 * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
1099 Likewise.
1100 * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
1101 Likewise.
1102 * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
1103 Likewise.
1104 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
1105 Likewise.
80b54217
UD
1106 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
1107 Likewise.
1108 * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
1109 Likewise.
31195be2 1110
dcfc8224
UD
1111 * Makefile (tests): Add tst-sem8 and tst-sem9.
1112 * tst-sem8.c: New file.
1113 * tst-sem9.c: New file.
1114 * sem_open.c: Fix creation of in_use record if the file exists but
1115 no internal record.
1116
49b65043
UD
1117 * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
1118 definitions.
1119
1120 * sysdeps/pthread/timer_create.c (timer_create): In case
1121 evp==NULL, assign timer ID to sival_ptr.
1122
1123 * descr.h (struct pthread_unwind_buf): Change type of prev element to
1124 struct pthread_unwind_buf *.
1125 (struct pthread): Likewise for cleanup_jmp_buf element.
1126
1127 * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
1128 * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
1129 * unwind.c (__pthread_unwind_next): Likewise.
1130
50794a45
UD
11312003-05-30 Ulrich Drepper <drepper@redhat.com>
1132
5d4f57bd
UD
1133 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
1134 (lll_futex_timed_wait): Use int for futex value parameter.
1135 (lll_futex_wake): Likewise.
1136 (lll_futex_requeue): Likewise.
1137
1138 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
1139 Replace one memory operation with one register operation.
1140
1141 * tst-join4.c (do_test): Fix error message.
1142
7ab7ea33
UD
1143 * tst-rwlock6.c (do_test): Use correct format specifier.
1144
1145 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
1146 (__lll_mutex_lock_wait): Replace one memory operation with one
1147 register operation.
1148 * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
1149 (__lll_mutex_lock_wait): Likewise.
1150
50794a45
UD
1151 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
1152 (__lll_mutex_cond_lock): Add one to value parameter of
1153 __lll_lock_wait to reflect reality in the futex syscall.
1154 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1155 (lll_mutex_cond_lock): Likewise.
1156
5a70784e
JJ
11572003-05-30 Jakub Jelinek <jakub@redhat.com>
1158
1159 * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
1160 New function.
1161 (lll_mutex_cond_lock): Define.
1162
e7c5ac68
UD
11632003-05-29 Ulrich Drepper <drepper@redhat.com>
1164
586d1748
UD
1165 * Makefile (tests): Add tst-signal6.
1166 * tst-signal6.c: New file.
1167
b8ba4a27
UD
1168 * sysdeps/unix/sysv/linux/s390/lowlevellock.h
1169 (__lll_mutex_unlock_force): New function
1170 (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
1171
65d46efe
UD
1172 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
1173 (__lll_mutex_unlock_force): New function.
1174 (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
1175
1176 * tst-rwlock7.c (do_test): Use correct format specifier.
1177
e7c5ac68
UD
1178 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
1179 Find break parameter in correct asm argument.
1180
284bdc42
UD
11812003-05-27 Jakub Jelinek <jakub@redhat.com>
1182
1183 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
1184 Remove out4.
1185 (lll_futex_requeue): Fix __o3 constraint, return negative errno if
1186 error occured.
1187 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1188 Add __mutex.
1189 * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
1190 lll_futex_requeue, lll_mutex_unlock_force): Define.
1191
e7c5ac68
UD
11922003-05-30 Jakub Jelinek <jakub@redhat.com>
1193
1194 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1195 (pthread_cond_t): Add __mutex.
1196 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
1197 lll_futex_requeue, lll_mutex_unlock_force): Define.
1198
ea2630c6
UD
11992003-05-28 Kaz Kojima <kkojima@rr.iij4u.or.jp>
1200
1201 * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
1202 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1203 Add __mutex field.
1204 * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
1205 Define.
1206 (lll_futex_wait, lll_futex_wake): Define.
1207 * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
1208 * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
1209 FUTEX_REQUEUE instead of FUTEX_WAIT.
1210 * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
1211 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
1212 mutex which was used in condvar structure. Call
1213 __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
1214 * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1215
1216 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
1217 include tcb-offsets.h. Read wakeup value in locked region.
1218 Use the value of gbr register as THREAD_ID.
1219 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1220 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1221 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1222
1223 * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
1224 macros.
1225
5a77f150
UD
12262003-05-28 Ulrich Drepper <drepper@redhat.com>
1227
1228 * sysdeps/pthread/pthread_cond_broadcast.c
1229 (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
1230
7661d9f7
UD
12312003-05-26 Ulrich Drepper <drepper@redhat.com>
1232
1233 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
1234 typo in register name.
1235 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
1236 correctly. Actually use requeue. Little optimization.
1237 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
1238 mutex address early. Handle cancellation state as 32-bit value.
1239 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1240 Remove unnecessary label.
1241
69431c9a
UD
12422003-05-25 Ulrich Drepper <drepper@redhat.com>
1243
1244 * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
1245 instead of FUTEX_WAIT.
1246 * sysdeps/pthread/pthread_cond_signal.c: Likewise.
1247 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1248 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1249 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1250 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1251 * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
1252 used in condvar structure. Call __pthread_mutex_cond_lock instead
1253 of __pthread_mutex_lock_internal.
1254 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1255 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1256 * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1257 (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
1258 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1259 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1260 * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
1261 Add pthread_mutex_cond_lock.
1262 * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
1263 * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
1264 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
1265 lll_mutex_cond_lock.
1266 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1267 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
248a3490 1268 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
69431c9a 1269 Add __mutex field.
248a3490 1270 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
69431c9a
UD
1271 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1272
1273 * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
1274 * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1275
1276 * pthreadP.h: Declare __pthread_mutex_cond_lock.
1277 * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
1278 Use it instead of lll_mutex_lock. If __pthread_mutex_lock is a
1279 macro don't define aliases.
1280
1281 * cancellation.c: Remove __pthread_enable_asynccancel_2.
1282 * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
1283 * sysdeps/pthread/pthread_cond_timedwait.c: Use
1284 __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
1285 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1286 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1287 * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1288 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1289 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1290
fddfebbd
UD
12912003-05-17 Ulrich Drepper <drepper@redhat.com>
1292
1293 * sem_open.c: Fix one endless loop. Implement correct semantics
1294 wrt opening the same semaphore more then once.
1295 * sem_close.c: Adjust for sem_open change.
1296 * semaphoreP.h: Include <semaphore.h>. Define struct inuse_sem.
1297 Declare __sem_mappings, __sem_mappings_lock, __sem_search.
1298 * Makefile (tests): Add tst-sem7.
1299 * tst-sem7.c: New file.
1300
1eefffb0
RM
13012003-05-16 Roland McGrath <roland@redhat.com>
1302
1303 * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
1304 uninitialized variable braino.
1305
6e66dc78
UD
13062003-05-16 Ulrich Drepper <drepper@redhat.com>
1307
23ae6451
UD
1308 * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
1309 test for syscall availability.
1310
1311 * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
1312 __no_posix_timers to -1 if the syscalls don't exist.
1313
7ac5b8e2
UD
1314 * pthread_join.c (pthread_join): Set tid field of the joined
1315 thread to -1. This isn't necessary but helps to recognize some
1316 error conditions with almost no cost.
1317
1318 * allocatestack.c (FREE_P): Also negative values indicate an
1319 unused stack.
1320
6e66dc78
UD
1321 * unwind.c: Include <unistd.h>.
1322
855dba3c
UD
13232003-05-14 Ulrich Drepper <drepper@redhat.com>
1324
1325 * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
1326
81f3ac4c
UD
13272003-05-14 Jakub Jelinek <jakub@redhat.com>
1328
1329 * Makefile (crti-objs, crtn-objs): New variables.
1330 (omit-deps, extra-objs): Add crtn.
1331 ($(objpfx)libpthread.so): Depend on both crti and crtn
1332 and links to them in multidir.
1333 ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
1334
7158eae4
UD
13352003-05-12 Steven Munroe <sjmunroe@us.ibm.com>
1336
1337 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1338 (lll_mutex_unlock): Use atomic_exchange_rel.
1339
edf205d5
UD
13402003-05-11 Ulrich Drepper <drepper@redhat.com>
1341
1342 * cond-perf.c (cons): Add missing locking around setting of alldone.
1343
a3f979a7
UD
13442003-05-10 Ulrich Drepper <drepper@redhat.com>
1345
1346 * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
1347 related macros.
1348 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
1349
880867a4
UD
13502003-05-09 Ulrich Drepper <drepper@redhat.com>
1351
949ec764
UD
1352 * tst-sem6.c: New file.
1353 * Makefile (tests): Add tst-sem6.
1354
1355 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
1356 Use atomic_exchange_rel instead of atomic_exchange.
1357 * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
1358 Likewise.
1359
1360 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
1361 code for lll_futex_wait and lll_futex_wake in static apps. Use
1362 vsyscall is possible.
1363
1364 * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
1365 * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
1366 * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
1367 pthread_setaffinity_np.
1368 * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
1369 and pthread_setaffinity_np.
1370 * Makefile (libpthread-routines): Add pthread_getaffinity and
1371 pthread_setaffinity.
1372
880867a4
UD
1373 * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
1374 use it in case mmap to allocate the stack fails.
1375 * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
1376 ARCH_MAP_FLAGS here.
1377 * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
1378 ARCH_RETRY_MMAP.
1379
92d83c72
UD
13802003-05-08 Ulrich Drepper <drepper@redhat.com>
1381
1382 * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
1383 handler implementation. It is now lockless in fork().
1384 * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
1385 * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1386 * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>. Don't
1387 declare the __fork_*_lists.
1388 (struct fork_handler): Include pointers to all three functions.
1389 Add next, refcntr and need_signal elements.
1390 (__fork_handlers): New declaration.
1391 (__register_atfork_malloc): Remove declaration.
1392 (HAVE_register_atfork_malloc): Remove definition.
1393 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
1394 __pthread_child_handler variable.
1395 (__libc_pthread_init): Use __register_atfork instead of explicitly
1396 adding to the list.
1397 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
1398 and lll_futex_wake.
1399 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1400
1401 * unwind.c (unwind_cleanup): Print error message and then abort. This
1402 function must never be reached.
1403
1404 * cond-perf.c: New file.
1405
be4d8038
UD
14062003-05-05 Ulrich Drepper <drepper@redhat.com>
1407
1408 * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
1409
c6696b79
RM
14102003-05-04 Roland McGrath <roland@redhat.com>
1411
1412 * Makefile ($(objpfx)../libc.so): New target.
1413
7da168bf
UD
14142003-05-02 Ulrich Drepper <drepper@redhat.com>
1415
1416 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1417 (pthread_condattr_t): Size is only an int, don't use long for
1418 alignment.
1419 (pthread_mutexattr_t): Likewise.
7da168bf
UD
1420 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1421 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1422 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1423
9a7178d6
UD
14242003-05-01 Ulrich Drepper <drepper@redhat.com>
1425
1426 * sysdeps/i386/tls.h: Define THREAD_ID.
1427 * sysdeps/ia64/tls.h: Likewise.
1428 * sysdeps/powerpc/tls.h: Likewise.
1429 * sysdeps/s390/tls.h: Likewise.
1430 * sysdeps/sh/tls.h: Likewise.
1431 * sysdeps/x86_64/tls.h: Likewise.
1432 * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
1433 record ownership.
1434 * pthread_mutex_timedlock.c: Likewise.
1435 * pthread_mutex_trylock.c: Likewise.
1436 * pthread_mutex_unlock.c: Likewise.
1437 * pthread_rwlock_trywrlock.c: Likewise.
1438 * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
1439 * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
1440 * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1441 * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
1442
1443 * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
1444 flag.
1445
a234e27d
UD
14462003-04-29 Jakub Jelinek <jakub@redhat.com>
1447
1448 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1449 (__SIZEOF_PTHREAD_COND_T): Define to 48.
1450 (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
1451 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1452 Make __align long long instead of long.
1453 (pthread_rwlock_t): Formatting.
1454 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
1455 (pthread_rwlock_t): Formatting.
1456 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1457 (pthread_cond_t): Make __align long long instead of long.
1458 (pthread_rwlock_t): Move __flags field to the same position as in
1459 linuxthreads.
1460
f025c136
UD
14612003-04-30 Ulrich Drepper <drepper@redhat.com>
1462
1463 * tst-rwlock6.c (do_test): Use correct printf format specifiers.
1464 * tst-rwlock7.c (do_test): Likewise.
1465
7531ab9e
RM
14662003-04-26 Roland McGrath <roland@redhat.com>
1467
1468 * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
1469
299601a1
UD
14702003-04-22 Jakub Jelinek <jakub@redhat.com>
1471
299601a1
UD
1472 * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
1473 sizeof (struct pthread).
1474 (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
468777e1 1475 1 struct pthread.
299601a1
UD
1476 * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
1477 to 0.
1478 (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
1479 struct pthread.
1480 (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
1481 to 32-bit bytes.
1482 (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
1483 tcbp.
1484 (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
1485 unneccessarily.
1486 (NO_TLS_OFFSET): Define.
299601a1
UD
1487 * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
1488 add TLS_TCB_SIZE unnecessarily.
299601a1 1489
950094f8
RM
14902003-04-22 Roland McGrath <roland@redhat.com>
1491
1492 * Makeconfig (shared-thread-library): Reverse link order to work
1493 around linker bug.
1494
dc2f6455
UD
14952003-04-22 Ulrich Drepper <drepper@redhat.com>
1496
1497 * semaphore.h: Fix typo in comment.
1498
e7608d77
UD
14992003-04-21 Ulrich Drepper <drepper@redhat.com>
1500
6a87ee19
UD
1501 * sysdeps/pthread/sigfillset.c: New file.
1502
e7608d77
UD
1503 * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
1504 * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
1505 * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
1506 * sysdeps/pthread/sigaction.c: Likewise.
1507 * sysdeps/pthread/sigprocmask.c: New file.
1508 * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
1509 __SIGRTMIN+1.
1510 * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1511 Block SIGTIMER. Also handle SI_TKILL events and terminate thread
1512 in this case.
1513
0b3df49e
UD
15142003-04-19 Ulrich Drepper <drepper@redhat.com>
1515
58a7a325
UD
1516 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
1517 (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
1518
0b3df49e
UD
1519 * sysdeps/unix/sysv/linux/unregister-atfork.c
1520 (__unregister_atfork): Don't free memory not allocated dynamically.
1521
1522 * semaphore.h: Remove __THROW marker from cancellation points.
1523 * nptl/sysdeps/pthread/pthread.h: Likewise.
1524
7d74651e
UD
15252003-04-18 Ulrich Drepper <drepper@redhat.com>
1526
76a67697
UD
1527 * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
1528 pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7d74651e
UD
1529 __THROW.
1530
dd9d6538
JJ
15312003-04-16 Jakub Jelinek <jakub@redhat.com>
1532
1533 * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
1534
4ab6f47c
RM
15352003-04-15 Roland McGrath <roland@redhat.com>
1536
1537 * forward.c (__pthread_unwind): Tweak to avoid warning.
1538
162434a6
UD
15392003-04-15 Ulrich Drepper <drepper@redhat.com>
1540
1541 * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
1542
35909161
UD
15432003-04-14 Ulrich Drepper <drepper@redhat.com>
1544
18ddd3aa 1545 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
35909161
UD
1546 overflow CFA advance instructions.
1547 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1548
18a8e730
UD
15492003-04-14 Jakub Jelinek <jakub@redhat.com>
1550
bd4f43b4
UD
1551 * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
1552 * sysdeps/i386/pthread_spin_lock.c: Likewise.
1553 * sysdeps/x86_64/tls.h: Likewise. Define LOCK_PREFIX if not already
1554 defined.
1555
18a8e730
UD
1556 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
1557 DW_CFA_advance_loc2 for .Laddl-.Lsubl.
1558 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
1559 DW_CFA_advance_loc for .Laddl-.Lsubl.
1560
08c765fa
UD
15612003-04-13 Ulrich Drepper <drepper@redhat.com>
1562
18a8e730
UD
1563 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
1564 position-independent unwind data for static libraries.
1565 Add missing unwind info. Add comments.
1566
ad2be852
UD
1567 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
1568 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1569 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
08c765fa
UD
1570 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1571
177d1ad3
UD
15722003-04-12 Ulrich Drepper <drepper@redhat.com>
1573
08c765fa
UD
1574 * Makefile: Make sure all cancellation points are compiled with
1575 exception and asynchronous unwind tables.
1576
177d1ad3
UD
1577 * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
1578 which mishandles loading of global object addresses in PIC.
1579 (THREAD_SETMEM_NC): Likewise.
1580
09d65ff3
UD
15812003-04-11 Ulrich Drepper <drepper@redhat.com>
1582
1583 * pthread.h: Define new data structure for cleanup buffer. Declare
1584 new cleanup handler interfaces.
1585 * descr.h: Include <unwind.h> if necessary. Define pthread_unwind_buf.
1586 (struct pthread): Add cleanup_jmp_buf pointer. Define
1587 HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
1588 * pthreadP.h: Declare __pthread_unwind. Define __do_cancel to use
1589 it. Declare old cleanup handler installation functions.
1590 * cleanup.c: Rewrite. Install handler for unwind-based cleanup
1591 handling.
1592 * cleanup_defer.c: Likewise.
1593 * cleanup_compat.c: New file. Old cleanup code.
1594 * cleanup_def_compat.c: New file. Old cleanup code.
1595 * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
1596 if own thread descriptor.
1597 * unwind.c: New file.
1598 * forward.c: Add __pthread_unwind.
1599 * init.c (pthread_functions): Add __pthread_unwind.
1600 * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
1601 Add ptr___pthread_unwind.
1602 * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
1603 and unwind function.
1604 * Makefile (libpthread-routines): Add cleanup_compat,
1605 cleanup_def_compat, and unwind. Define CFLAGS to enable unwind
1606 table generation if necessary.
1607 * version.c: Record whether unwind support is compiled in.
1608 * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
1609 * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
1610 handler interfaces.
1611 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
1612 complication to generate unwind information for syscall wrappers.
68107ec0 1613 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
09d65ff3
UD
1614 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
1615 __cleanup_fct_attribute.
1616
1617 * Makefile: Add rules to build and run tst-cleanup0.
1618 * tst-cleanup0.c: New file.
1619 * tst-cleanup0.expect: New file.
1620
1621 * pthread_create.c (deallocate_tsd): Don't take parameter. Adjust
1622 caller. Optimize to avoid often unecessary local variable.
1623
0dc44b51
RM
16242003-04-11 Roland McGrath <roland@redhat.com>
1625
1626 * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
1627 sets variable `multidir'; include that.
1628 (generated): Add it.
1629 ($(objpfx)$(multidir)/crti.o): New target.
1630 [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
1631
84a80719
UD
16322003-04-11 Ulrich Drepper <drepper@redhat.com>
1633
1634 * tst-attr2.c (do_test): Add cast to avoid warning.
1635 * tst-mutex4.c (do_test): Likewise.
1636
88ff4759
UD
16372003-04-10 Ulrich Drepper <drepper@redhat.com>
1638
1639 * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
1640 in child.
1641
b2041097
UD
16422003-04-09 Ulrich Drepper <drepper@redhat.com>
1643
1644 * Makefile (tests): Add tst-detach1.
1645 * tst-detach1.c: New file.
1646
f9657e88
UD
16472003-04-08 Ulrich Drepper <drepper@redhat.com>
1648
9afe4964
UD
1649 * sysdeps/pthread/pthread.h: Remove duplicate
1650 pthread_cleanup_{push,pop} definitions.
1651
f9657e88
UD
1652 * tst-barrier2.c: Eliminate warnings.
1653 * tst-cancel4.c: Likewise.
1654 * tst-cond4.c: Likewise.
1655 * tst-cond6.c: Likewise.
1656 * tst-detach1.c: Likewise.
1657 * tst-rwlock4.c: Likewise.
1658 * tst-rwlock6.c: Likewise.
1659 * tst-rwlock7.c: Likewise.
1660 * tst-sem3.c: Likewise.
1661 * tst-spin2.c: Likewise.
1662 * tst-umask1.c: Likewise.
1663
69b35e86
UD
16642003-04-07 Ulrich Drepper <drepper@redhat.com>
1665
1666 * pthread_detach.c (pthread_detach): Fix test for invalid TID.
1667
c70ad7d7
UD
16682003-04-06 Ulrich Drepper <drepper@redhat.com>
1669
1670 * descr.h (struct pthread): Move cancelhandling member to the front.
1671
54e0138f
UD
16722003-04-05 Ulrich Drepper <drepper@redhat.com>
1673
1674 * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
1675 malloc_parent, and malloc_child statically.
1676 (__register_atfork_malloc): New function.
1677 (free_mem): Don't free any of the malloc_* variables on the list.
1678 * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
1679 Define HAVE_register_atfork_malloc.
1680
b22d701b
UD
16812003-04-04 Ulrich Drepper <drepper@redhat.com>
1682
1683 * sysdeps/pthread/createthread.c (create_thread): Add some more
1684 comments explaining when to set multiple_threads and when not.
1685
1686 * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
1687 THREAD_ATOMIC_BIT_SET if not already defined.
1688 * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
1689 THREAD_ATOMIC_BIT_SET:
1690 * sysdeps/x86_64/tls.h: Likewise.
1691 * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
1692 THREAD_ATOMIC_CMPXCHG_VAL.
1693 (_pthread_cleanup_pop_restore): Likewise.
1694 * cancellation.c (__pthread_enable_asynccancel): Likewise.
1695 (__pthread_enable_asynccancel_2): Likewise.
1696 (__pthread_disable_asynccancel): Likewise.
1697 * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
1698 (__libc_disable_asynccancel): Likewise.
1699 * init.c (sigcancel_handler): Likewise.
1700 * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
1701 * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
1702
86246935
UD
17032003-04-03 Ulrich Drepper <drepper@redhat.com>
1704
1705 * init.c (sigcancel_handler): Don't set EXITING_BIT here.
1706 * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
1707 * pthreadP.h (__do_cancel): Set EXITING_BIT here.
1708 * Makefile (tests): Add tst-cancel11.
1709 * tst-cancel11.c: New file.
1710
6b4686a5
UD
17112003-04-01 Ulrich Drepper <drepper@redhat.com>
1712
1713 * pthread_create.c (deallocate_tsd): Clear/free memory after the last
1714 round, not the first. Use specific_used flag instead of local
1715 found_nonzero variable. Use THREAD_[SG]ETMEM where possible.
1716 (__free_tcb): Don't call deallocate_tsd here.
1717 (start_thread): Call deallocate_tsd here.
1718 * pthread_setspecific.c: Set specific_used flag really only when
1719 needed.
0d73a73b 1720 * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
6b4686a5 1721 * tst-tsd3.c: New file.
0d73a73b 1722 * tst-tsd4.c: New file.
6b4686a5 1723
42b2395d
UD
17242003-03-31 Ulrich Drepper <drepper@redhat.com>
1725
211d90c5
UD
1726 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
1727 Use atomic_exchange_and_add instead of __lll_add.
1728 (__lll_mutex_timedlock): Likewise.
1729 Patch by Ian Wienand.
1730
17312003-03-24 Steven Munroe <sjmunroe@us.ibm.com>
1732
1733 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1734 (SINGLE_THREAD_P): Fix typo.
1735 * tst-cancel-wrappers.sh: Handle '.'ed symbols.
1736
17372003-03-31 Ulrich Drepper <drepper@redhat.com>
1738
1739 * Makefile (tests): Add tst-align.
1740 * tst-align.c: New file.
1741 * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
211d90c5 1742
42b2395d
UD
1743 * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
1744 function correctly.
1745
211d90c5
UD
1746 * tst-tsd2.c: Add casts to avoid warnings.
1747
163b180f
UD
17482003-03-30 Ulrich Drepper <drepper@redhat.com>
1749
1750 * descr.h (struct pthread): Move most often used elements to the front.
1751
ea473bad
UD
17522003-03-29 Ulrich Drepper <drepper@redhat.com>
1753
1754 * Makefile (libpthread-routines): Add pthread_atfork.
1755 (libpthread-static-only-routines): Add pthread_atfork.
1756
dd731d53
UD
17572003-03-28 Kaz Kojima <kkojima@rr.iij4u.or.jp>
1758
1759 * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
1760 of TLS_DTV_AT_TP.
1761 (INSTALL_DTV): Add parens.
1762 (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
1763 Use passed descr instead of THREAD_SELF.
1764 * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
1765 (__lll_mutex_timedlock_wait): Correct expected value after
1766 spurious wakeup.
1767 * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
1768 Release lock before waking up the waiters.
1769 * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
1770 criteria. Reorderstruct passed to cleanup handler. Fix
1771 handling of cancellation and failung pthread_mutex_unlock call.
1772 Use __pthread_enable_asynccancel_2 instead of
1773 __pthread_enable_asynccancel.
1774 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1775 Return result of lock re-get if it fails.
1776 * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
1777 for __pthread_cleanup_push.
1778 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
1779 completely broken rwlock implementation.
1780 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1781 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1782 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1783 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1784 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1785 * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value. Use
1786 versioned_symbol macro.
1787 * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
1788 * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
1789
c75d02f0
UD
17902003-03-27 Ulrich Drepper <drepper@redhat.com>
1791
5f5004df
UD
1792 * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
1793 __timer_helper_thread. Declare __start_helper_thread, __helper_once,
1794 and __helper_tid.
1795 (struct timer): Remove th and bar field.
1796 * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
1797 debugging code. Create only one helper thread.
1798 * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
1799 helper thread.
1800 * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1801 Renamed. Define statically. Use thread info from siginfo.
1802 (__helper_once): New variable.
1803 (__helper_tid): New variable.
1804 (__reset_helper_control): New function.
1805 (__start_helper_thread): New function.
1806
18d009ca
UD
1807 * pthread_create.c (start_thread): Don't use setjmp inside
1808 __builtin_expect to work around gcc bug.
1809
c75d02f0
UD
1810 * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
1811 timer_delete syscall fails, but not with ENOSYS, set
1812 __no_posix_timers.
1813
1814 * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
1815 (timer_settime): Fix typo.
28cf3058
UD
1816 * sysdeps/unix/sysv/linux/timer_getoverr.c
1817 [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
c75d02f0 1818
049ac259
JJ
18192003-03-27 Jakub Jelinek <jakub@redhat.com>
1820
1821 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
1822 offset of cleanupbuf.__prev.
1823
f93d39dd
JJ
18242003-03-26 Jakub Jelinek <jakub@redhat.com>
1825
1826 * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
1827 of included file.
1828
f064e4c5
UD
18292003-03-26 Ulrich Drepper <drepper@redhat.com>
1830
1831 * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
1832 NULL provide default definition to syscall.
1833
83e886a3
RM
18342003-03-25 Roland McGrath <roland@redhat.com>
1835
1836 * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
1837 (timer_id2ptr): Fix typo.
1838
09402f5b
UD
18392003-03-25 Ulrich Drepper <drepper@redhat.com>
1840
1841 * pthreadP.h: Define SIGCANCEL and SIGTIMER.
1842 * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
1843 * sysdeps/ia64/pthreaddef.h: Likewise.
1844 * sysdeps/powerpc/pthreaddef.h: Likewise.
1845 * sysdeps/s390/pthreaddef.h: Likewise.
1846 * sysdeps/sh/pthreaddef.h: Likewise.
1847 * sysdeps/x86_64/pthreaddef.h: Likewise.
1848 * init.c (__pthread_initialize_minimal): Block SIGTIMER.
1849 * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
1850 being changed.
1851 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
1852 SIGTIMER is not unblocked.
1853 * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
1854 RT signal taken.
1855 * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
1856 be send.
1857 * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
1858 pass pointer through as ID.
1859 * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
1860 * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
1861 * sysdeps/unix/sysv/linux/timer_create.c: New file.
1862 * sysdeps/unix/sysv/linux/timer_delete.c: New file.
1863 * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
1864 * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
1865 * sysdeps/unix/sysv/linux/timer_routines.c: New file.
1866 * sysdeps/unix/sysv/linux/timer_settime.c: New file.
1867 * sysdeps/unix/sysv/linux/ia64/Versions: New file.
1868 * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
1869 * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
1870 * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
1871 * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
1872 * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
1873 * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
1874 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
1875 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
1876 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
1877 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
1878 * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
1879 * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
1880 * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
1881 * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
1882 * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
1883 * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
1884 * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
1885 * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
1886 * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
1887 * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
1888 * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
1889 * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
1890 * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
1891 * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
1892
1893 * pthreadP.h: Remove FRAME_LEFT definition.
1894 * cleanup.c (_pthread_cleanup_push): Don't check for reference to
1895 already left frame. Programs which have this problem are not POSIX
1896 compliant.
1897 * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
1898
5e826ab5
UD
18992003-03-24 Ulrich Drepper <drepper@redhat.com>
1900
1901 * sysdeps/pthread/tst-timer.c: Check return values of the
1902 functions we test.
1903
b910f788
RM
19042003-03-23 Roland McGrath <roland@redhat.com>
1905
3045a1fe
RM
1906 * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
1907 * tst-tls3mod.c: Likewise.
1908 * tst-tls1.c: Likewise.
1909 * tst-tls2.c: Likewise.
1910
85047fe3
RM
1911 * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
1912 undefined behavior.
1913
b910f788
RM
1914 * tst-join5.c (tf1, tf2): Add a cast.
1915
1916 * Makeconfig (includes): Append -I$(..)nptl to this variable.
1917
1918 * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
1919 Don't test anything.
1920 * tst-cond4.c: Likewise.
1921 * tst-cond6.c: Likewise.
1922 * tst-flock2.c: Likewise.
1923 * tst-mutex4.c: Likewise.
1924 * tst-rwlock4.c: Likewise.
1925 * tst-signal1.c: Likewise.
1926 * tst-spin2.c: Likewise.
1927 * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
1928
1929 * tst-mutex4.c: Use test-skeleton.c.
1930 * tst-spin2.c: Likewise.
1931 * tst-sysconf.c: Likewise.
1932 * tst-barrier2.c: Likewise.
1933 * tst-cond4.c: Likewise.
1934 * tst-cond6.c: Likewise.
1935 * tst-rwlock4.c: Likewise.
1936 * tst-unload.c: Likewise.
1937 * tst-flock2.c (do_test): Use return instead of exit.
1938
4baa087a
RM
19392003-03-22 Jakub Jelinek <jakub@redhat.com>
1940
1941 * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
1942
5a3ab2fc
UD
19432003-03-21 Ulrich Drepper <drepper@redhat.com>
1944
9f07eae2
UD
1945 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
1946 (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
1947 instead of __lll_compare_and_swap.
1948 * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
1949 Likewise.
1950 Removed definition if __lll_compare_and_swap.
1951
5a3ab2fc
UD
1952 * cancellation.c: Adjust for new form of compare&exchange macros.
1953 * cleanup_defer.c: Likewise.
1954 * init.c: Likewise.
1955 * libc-cancellation.c: Likewise.
1956 * old_pthread_cond_broadcast.c: Likewise.
1957 * old_pthread_cond_signal.c: Likewise.
1958 * old_pthread_cond_timedwait.c: Likewise.
1959 * old_pthread_cond_wait.c: Likewise.
1960 * pthread_cancel.c: Likewise.
1961 * pthread_create.c: Likewise.
1962 * pthread_detach.c: Likewise.
1963 * pthread_join.c: Likewise.
1964 * pthread_key_delete.c: Likewise.
1965 * pthread_setcancelstate.c: Likewise.
1966 * pthread_setcanceltype.c: Likewise.
1967 * pthread_timedjoin.c: Likewise.
1968 * pthread_tryjoin.c: Likewise.
1969 * sysdeps/pthread/createthread.c: Likewise.
1970
b1aea098
UD
19712003-03-20 Ulrich Drepper <drepper@redhat.com>
1972
1973 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
4baa087a 1974 Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
b1aea098
UD
1975 definitions. Replace uses with calls to atomic_* functions.
1976 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1977 * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
1978 __lll_test_and_set calls with atomic_exchange_and_add and
1979 atomic_exchange calls respectively.
1980 * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1981 * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1982 * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
1983 * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1984 * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
1985 * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
1986 * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
1987
1988 * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
1989 returns the old value.
1990
100a7100
RM
19912003-03-20 Martin Schwidefsky <sky@mschwid3.boeblingen.de.ibm.com>
1992
1993 * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
1994 int for variable OLDVAL and correct inline assembler contraint.
1995 * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
1996 type int for variable OLD.
1997
1998 * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
1999 only for s390-32.
2000 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2001 (SINGLE_THREAD_P): Use global variable __local_multiple_threads
2002 instead of multiple_threads field in the TCB.
2003
95767b36
UD
20042003-03-19 Ulrich Drepper <drepper@redhat.com>
2005
4009bf40
UD
2006 * sysdeps/i386/i686/bits/atomic.h: Removed.
2007 * sysdeps/i386/i586/bits/atomic.h: Removed.
2008 * sysdeps/i386/i486/bits/atomic.h: Removed. Moved to glibc.
2009 * sysdeps/x86_64/bits/atomic.h: Removed. Moved to glibc.
2010 * sysdeps/s390/bits/atomic.h: Removed. Moved to glibc.
2011 * sysdeps/sh/bits/atomic.h: Removed. Moved to glibc.
2012 * sysdeps/ia64/bits/atomic.h: Removed. Moved to glibc.
2013 * sysdeps/powerpc/bits/atomic.h: Removed. Moved to glibc.
2014 * atomic.h: Removed. Moved to glibc.
2015
560a784f
UD
2016 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
2017 support for clock selection.
2018
95767b36
UD
2019 * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
2020 signalling waiters.
2021
043ad426
RM
20222003-03-18 Roland McGrath <roland@redhat.com>
2023
94659495
RM
2024 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
2025 Add __lll_rel_instr first. Add memory clobber.
2026 (lll_mutex_unlock): Use __lll_test_and_set.
2027 From Paul Mackerras <paulus@samba.org>.
2028
2029 * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
2030 unconditionally.
2031 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2032 (SINGLE_THREAD_P): Add `header.' prefix.
2033 From Paul Mackerras <paulus@samba.org>.
2034
043ad426
RM
2035 * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
2036 pthread_timedjoin_np to ...
2037 (libpthread: GLIBC_2.3.3): ... here.
2038 (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
2039
2040 * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2041 Avoid shadowing VAL variable.
2042
2043 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
2044 New macro.
2045
86a9ee5e
UD
20462003-03-18 Ulrich Drepper <drepper@redhat.com>
2047
ac9e0aa1
UD
2048 * Makefile (tests): Add tst-cond11.
2049 * tst-cond11.c: New file.
2050
a14b373c
UD
2051 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
2052 struct passed to cleanup handler to eliminate one more
2053 instruction.
2054 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2055
24a49f38
UD
2056 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
2057 (pthrad_cond_t): Replace __unused field with __clock.
2058
2059 * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
2060 waken all waiters in cleanup handler.
2061 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2062 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2063
86a9ee5e
UD
2064 * pthread_condattr_getclock.c: New file.
2065 * pthread_condattr_setclock.c: New file.
2066 * sysdeps/pthread/pthread.h: Declare these new functions.
2067 * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
2068 * Makefile (libpthread-routines): Add the new functions.
2069 * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
2070 Renamed field to value. Document use of the bits.
2071 * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
2072 change.
2073 * pthread_condattr_setpshared.c: Likewise.
d5cb8389 2074 * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
86a9ee5e
UD
2075 * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
2076 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2077 Add __clock field.
2078 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2079 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2080 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2081 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2082 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
2083 Implement clock selection.
2084 * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
2085 * pthread-errnos.sym: Add ENOSYS.
2086 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2087 _POSIX_CLOCK_SELECTION.
2088 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2089
2090 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
2091 invalid .size directive.
2092
98054a05
RM
20932003-03-17 Roland McGrath <roland@redhat.com>
2094
2095 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
2096 Formatting tweaks.
2097
001bea71
UD
20982003-03-17 Ulrich Drepper <drepper@redhat.com>
2099
4773086e
UD
2100 * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
2101 Use __lll_add instead of spelling it out. Use protected symbol names.
2102 * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
2103 Use __lll_add.
2104 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
2105 Renamed from lll_compare_and_swap. Use new name where necessary.
2106 (__lll_add): Defined.
2107 (__lll_dec_if_positive): Defined.
2108 (__lll_test_and_set): Defined.
2109 * sysdeps/ia64/pthread_spin_init.c: Removed.
2110 * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
2111 * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
2112 * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
2113 * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
2114 * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
2115 * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
2116 * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
001bea71
UD
2117 * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
2118 * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2119 __sync_lock_release_si.
2120 Patch by Jakub Jelinek.
2121
2122 * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2123 Fix timeout handling.
2124 (__lll_timedwait_tid): Likewise.
2125 (lll_unlock_wake_cb): Wake up other waiters if necessary.
2126 Patch by Jakub Jelinek.
2127
2128 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
2129
de4471dd
RM
21302003-03-17 Roland McGrath <roland@redhat.com>
2131
2132 PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
2133 * sysdeps/pthread/pthread_spin_init.c: New file.
2134 * sysdeps/pthread/pthread_spin_unlock.c: New file.
2135 * sysdeps/powerpc/Makefile: New file.
2136 * sysdeps/powerpc/pthread_spin_lock.c: New file.
2137 * sysdeps/powerpc/pthread_spin_trylock.c: New file.
2138 * sysdeps/powerpc/pthreaddef.h: New file.
2139 * sysdeps/powerpc/tcb-offsets.sym: New file.
2140 * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
2141 * sysdeps/powerpc/tls.h: New file.
2142 * sysdeps/powerpc/bits/atomic.h: New file.
2143 * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
2144 * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
2145 * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
98054a05 2146
de4471dd
RM
2147 * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
2148 * sysdeps/unix/sysv/linux/sem_post.c: New file.
2149 * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
2150 * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
2151 * sysdeps/unix/sysv/linux/sem_wait.c: New file.
2152 * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
2153 * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
2154 * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
2155 * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
2156 * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
2157 * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
2158 * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
2159 * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
2160 * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
2161 * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
2162
2163 * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
2164 not gettimeofday.
2165 * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
2166 * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
2167 * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
2168 * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
2169 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
2170
5778033f
UD
21712003-03-17 Ulrich Drepper <drepper@redhat.com>
2172
2173 * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
2174 * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
2175 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2176 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2177 Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
2178
796038f8
RM
21792003-03-16 Roland McGrath <roland@redhat.com>
2180
2181 * tst-fork4.c: Include <string.h>.
2182 * tst-signal2.c: Likewise.
2183 * tst-mutex5.c (do_test): exit -> return.
2184 * tst-mutex2.c: Include <stdlib.h>.
2185
51d0678c
UD
21862003-03-16 Ulrich Drepper <drepper@redhat.com>
2187
5778033f
UD
2188 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2189 (__lll_mutex_timedlock_wait): Correct expected value after
2190 spurious wakeup. Otherwise we would never wait again.
2191
b6e2f87a
UD
2192 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
2193 zone versus inline asm stupidity. Use correct instructions.
2194
51d0678c
UD
2195 * tst-rwlock6.c: Add some more status output.
2196
8112cc70
RM
21972003-03-15 Roland McGrath <roland@redhat.com>
2198
2199 * sysdeps/pthread/configure.in: New file.
2200 * sysdeps/pthread/configure: New file (generated).
2201
49773c19
UD
22022003-03-15 Ulrich Drepper <drepper@redhat.com>
2203
2204 * allocatestack.c (allocate_stack): Store the exact stack size of
2205 user allocated stacks.
2206
eec0ca9f
JJ
22072003-03-15 Jakub Jelinek <jakub@redhat.com>
2208
2209 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2210 (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
2211 * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
2212 * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
2213 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2214 Use `header.' prefix.
2215 * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
2216
a87731e2
UD
22172003-03-15 Ulrich Drepper <drepper@redhat.com>
2218
2219 * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
2220 __builtin_frame_address, use stack pointer.
2221
2222 * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
2223 instead of __builtin_frame_pointer.
2224
e22a221d
UD
22252003-03-14 Ulrich Drepper <drepper@redhat.com>
2226
92ed3daf
UD
2227 * tst-basic1.c (do_test): Add cast to avoid warning.
2228 * tst-basic2.c (do_test): Likewise.
2229
9b89567d
UD
2230 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
2231 amount of stack correction.
2232
e22a221d
UD
2233 * tst-fork4.c: Use test-skeleton.c.
2234
2e49caba
RM
22352003-03-14 Roland McGrath <roland@redhat.com>
2236
2237 * init.c: Fix typo "#eli" for "#else".
2238
415ef7d8
RM
22392003-03-14 Steven Munroe <sjmunroe@us.ibm.com>
2240
2241 * allocatestack.c (__stack_user): Use hidden_data_def.
2242 * pthread_create.c (__pthread_keys): Likewise.
2243
2244 * init.c [__powerpc__] (__NR_set_tid_address): Define it.
2245
52287505
RM
22462003-03-14 Roland McGrath <roland@redhat.com>
2247
415ef7d8
RM
2248 * tst-fork4.c: New file.
2249 * Makefile (tests): Add it.
2250
52287505
RM
2251 * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
2252 we always define the padding space.
2253 [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
2254 stopped supporting its own extensions fully.
2255 [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
2256 struct also called `header', so `header.multiple_threads' is the field
2257 name to use on all machines.
2258 * allocatestack.c (allocate_stack): Use `header.' prefix.
2259 * sysdeps/pthread/createthread.c (create_thread): Likewise.
2260 * pthread_create.c (__pthread_create_2_1): Likewise.
2261 * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
2262 (THREAD_SELF): Likewise.
2263 * sysdeps/x86_64/tls.h: Likewise.
2264 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
2265 (SINGLE_THREAD_P): Likewise.
2266 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
2267 (SINGLE_THREAD_P): Likewise.
2268 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2269 (SINGLE_THREAD_P): Likewise.
2270
2271 * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
2272 value directly.
2273
c44bf9aa
UD
22742003-03-14 Ulrich Drepper <drepper@redhat.com>
2275
e22a221d
UD
2276 * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
2277 * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
2278
0eb18281
UD
2279 * pthread_create.c (start_thread): setjmp is expected to return 0.
2280
c44bf9aa
UD
2281 * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
2282 (THREAD_GETMEM_NC): Likewise.
2283
564cd8b6
UD
22842003-03-13 Ulrich Drepper <drepper@redhat.com>
2285
2286 * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
2287 and the size of the stack which must be allocated is a multiple,
2288 allocate one more page.
2289 * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
2290 MULTI_PAGE_ALIASING.
2291
6461e577
RM
22922003-03-13 Roland McGrath <roland@redhat.com>
2293
2294 * pthread_create.c (start_thread): Set EXITING_BIT after the
2295 event-reporting (and destructors), not before.
2296
b5ec5617
UD
22972003-03-13 Jakub Jelinek <jakub@redhat.com>
2298
6461e577
RM
2299 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
2300 lll_futex_wake): Declare register variables as long int instead of
2301 unsigned long int. Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
2302 Make syscall arguments clobbered by the syscall.
2303 (lll_futex_wait): Define using lll_futex_timed_wait.
2304
2305 * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
2306 to void *.
2307
2308 * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
2309 PPID if [! NDEBUG].
2310
2311 * allocatestack.c (nptl_ncreated): Only declare if
2312 COLORING_INCREMENT != 0.
2313
2314 * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
2315 (__libc_enable_asynccancel_2): Remove prototype.
2316
b5ec5617
UD
2317 * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
2318 ctid to match kernel.
2319
d0369fb8
UD
23202003-03-12 Ulrich Drepper <drepper@redhat.com>
2321
7588880f
UD
2322 * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
2323 libc_multiple_threads.
2324 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
2325 __libc_multiple_threads to...
2326 * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here. New file.
2327
2328 * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
2329 versioning.
2330 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2331 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2332
2333 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
2334 (__pthread_once_internal): Define.
2335
2336 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
2337 macros instead of .symver directly.
2338 * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2339 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2340
d0369fb8
UD
2341 * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
2342 * sysdeps/x86_64/tcb-offsets.sym: New file.
2343 * sysdeps/x86_64/Makefile: New file.
2344
2345 * sysdeps/i386/tcb-offsets.sym: Add SELF.
2346 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
2347 to access own pthread_t in TCB.
2348 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2349 Likewise.
2350 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2351 Likewise.
2352 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2353
0bb2ac85
RM
23542003-03-12 Roland McGrath <roland@redhat.com>
2355
2356 * pthread-errnos.sym: New file.
2357 * Makefile (gen-as-const-headers): New variable, list that file.
2358 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
2359 header <pthread-errnos.h> instead of defining errno values here.
2360 * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2361 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2362 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2363 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2364 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2365 Likewise.
2366 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2367 Likewise.
2368 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2369 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2370 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
2371 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2372 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2373 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2374 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2375 * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2376 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2377 * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
2378 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2379 * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
2380 * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2381 * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
2382 * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
2383 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2384 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2385 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2386 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2387 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
2388 * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2389 * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
2390 * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
2391 * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
2392 * sysdeps/sh/pthread_spin_trylock.S: Likewise.
2393 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2394 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2395
2396 * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
2397 CLONE_CHILD_SETTID worked.
2398
35e148cb
UD
23992003-03-12 Ulrich Drepper <drepper@redhat.com>
2400
d0369fb8
UD
2401 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
2402 file.
2403 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
2404 file.
2405
2406 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
2407 (pthread_cond_t): Add padding.
2408
da49194d
UD
2409 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
2410 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
2411 * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
2412
35e148cb
UD
2413 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
2414 (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
2415 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
2416 (__pthread_rwlock_timedrdlock): Likewise.
2417 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
2418 (__pthread_rwlock_wrlock): Likewise.
2419 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
2420 (__pthread_rwlock_rdlock): Likewise.
2421
2422 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
2423
2424 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
2425 result of lock re-get if it fails.
2426
3e976b96
UD
24272003-03-11 Ulrich Drepper <drepper@redhat.com>
2428
5a03acfe
UD
2429 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
2430 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2431 * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
2432 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2433 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2434 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
2435 * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2436 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2437 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2438 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2439
2440 * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
2441 THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
2442
2443 * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
2444 Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
2445 * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
2446 (create_thread): Likewise.
2447 Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
2448 * init.c (__pthread_initialize_minimal_internal): Initialize
2449 __libc_multiple_threads_ptr if necessary.
2450 * pthreadP.h: Adjust prototype for __libc_pthread_init. Declare
2451 __pthread_multiple_threads and __libc_multiple_threads_ptr.
2452 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
2453 __libc_multiple_threads.
2454 (__libc_pthread_init): Return pointer to __libc_pthread_init if
2455 necessary.
2456
2457 * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
2458 (THREAD_SETMEM_NC): Likewise.
2459
2460 * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
2461 * sysdeps/x86_64/pthread_spin_trylock.S: New file.
2462 * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
2463 * sysdeps/x86_64/pthread_spin_unlock.S: New file.
2464
2465 * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
2466 Eliminate one entire instruction.
2467
32a589b1
UD
2468 * cancellation.c (__pthread_enable_asynccancel_2): New function.
2469 * pthreadP.h: Declare __pthread_enable_asynccancel_2.
2470 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2471 (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
2472 instead of __pthread_enable_asynccancel.
2473 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2474 (__pthread_cond_wait): Likewise.
2475 * sysdeps/pthread/pthread_cond_timedwait.c
2476 (__pthread_cond_timedwait): Likewise.
2477 * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2478
3e976b96
UD
2479 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2480 (__condvar_cleanup): Wake up all waiters in case we got signaled
2481 after being woken up but before disabling asynchronous
2482 cancellation.
2483 * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
2484 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2485 (__condvar_cleanup): Likewise.
2486
2487 * init.c (__NR_set_tid_address): If already defined, don't redefine.
2488 Make it an error if architecture has no #if case. Add x86-64.
2489
2490 * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
2491 pt-initfini.s generation.
2492
2493 * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
2494 (TLS_INIT_TP): Fix typo.
2495
6c477888
UD
24962003-03-11 Jakub Jelinek <jakub@redhat.com>
2497
2498 * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
2499 3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
2500
2501 * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
2502 * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
2503 * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
2504 * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
2505 * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
2506 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
2507 * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
2508 * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
2509
ea694823
UD
25102003-03-11 Ulrich Drepper <drepper@redhat.com>
2511
6c477888
UD
2512 * sysdeps/pthread/pthread_cond_timedwait.c
2513 (__pthread_cond_timedwait): Return the result of the final
2514 locking. If it succeeds, the regular function return value.
2515
2516 * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
2517 Return result of the final locking.
2518 * version.c (__nptl_main): Work around problems with the strange
2519 INTERNAL_SYSCALL macro on ppc32.
2520 * init.c (__pthread_initialize_minimal_internal): Unblock
2521 SIGCANCEL in case the parent blocked it.
2522 Reported by Paul Mackerras <paulus@samba.org>.
2523
ea694823
UD
2524 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
2525 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
2526 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
2527
b33e6163
RM
25282003-03-11 Jakub Jelinek <jakub@redhat.com>
2529
2530 * sysdeps/pthread/pthread_cond_timedwait.c
2531 (__pthread_cond_timedwait): Unlock and fail if
2532 __pthread_mutex_unlock_internal failed.
2533
2534 * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
2535 (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
2536 Use ARCH_CLONE.
2537 * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
2538 [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
2539 STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
2540 ALLOCATE_STACK): New macros.
2541 (TLS_TPADJ): New macro.
2542 (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
2543 (allocate_stack): Handle TLS_DTV_AT_TP and
2544 NEED_SEPARATE_REGISTER_STACK. Use TLS_TPADJ.
2545 * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
2546 Don't set PD->self.
2547 * init.c [__ia64__] (__NR_set_tid_address): Define.
2548
2549 * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
2550 * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
2551 * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
2552 * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
2553 * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
2554 * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
2555 * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
2556 * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
2557 * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
2558 * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
2559 * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
2560 * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
2561 * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
2562 * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
2563 * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
2564 * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
2565 * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
2566 * sysdeps/ia64/bits/atomic.h: New file.
2567 * sysdeps/ia64/Makefile: New file.
2568 * sysdeps/ia64/pthread_spin_init.c: New file.
2569 * sysdeps/ia64/pthread_spin_lock.c: New file.
2570 * sysdeps/ia64/pthread_spin_trylock.c: New file.
2571 * sysdeps/ia64/pthread_spin_unlock.c: New file.
2572 * sysdeps/ia64/pthreaddef.h: New file.
2573 * sysdeps/ia64/tcb-offsets.sym: New file.
2574 * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
2575 * sysdeps/ia64/tls.h: New file.
2576
2577 * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
2578 to syscall instead of no arguments.
2579
2b30b2e5
UD
25802003-03-10 Ulrich Drepper <drepper@redhat.com>
2581
db5f2fc9
UD
2582 * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
2583 * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
2584 * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
2585 * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
2586
2587 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
2588 unused code.
2589
6a4263e3
UD
2590 * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
2591
3de7c2a9
UD
2592 * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2593 lowlevelbarrier.sym.
2594 * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
2595 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
2596 Include lowlevelbarrier.h and don't define offsets locally.
6a4263e3 2597 * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
3de7c2a9 2598
2a544d82
UD
2599 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2600 (__lll_mutex_lock_wait): Reverse order of first two parameters.
2601 (__lll_mutex_timedlock_wait): Likewise.
2602 (lll_mutex_lock): Adjust asm for that.
2603 (lll_mutex_timedlock): Likewise. Mark cx, cc, r10 as clobbered.
2604 (lll_lock): Adjust asm for operand order change.
2605 * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
2606 * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
2607
ec06436c
UD
2608 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
2609 Reverse order of parameters.
2610 (__lll_timedwait_tid): Remove regparms attribute.
2611 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
2612 * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
2613
3273832c
UD
2614 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2615 (__lll_timedwait_tid): Remove one unnecessary instruction.
2616
51f32ab8
UD
2617 * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
2618 __lll_mutex_timedlock_wait only for NOT_IN_libc.
2619 * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
2620 lowlevelmutex.S.
2621
2622 * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
2623 lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
2624 for NOT_IN_libc.
2625 * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
2626 lowlevellock.S.
2627
fad48d9e
UD
2628 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
2629 LOCK is already defined. Don't define __lll_mutex_timedlock_wait
2630 for libc.so.
2631 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
2632 define LOCK here (if UP is not defined). The actual code is in
2633 lowlevelmutex.S.
2634
9356d063
UD
2635 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
2636 LOCK is already defined. Don't define lll_unlock_wake_cb and
2637 __lll_timedwait_tid for libc.so.
2638 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
2639 define LOCK here (if UP is not defined). The actual code is in
2640 lowlevellock.S.
2641
ebf0cbc5 2642 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
106f6f9d
UD
2643 * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
2644 * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
2645 instead of lowlevelsem.h.
2646 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
2647 * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
2648 * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
0be8ee21 2649
c915e5ad
UD
2650 * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2651 lowlevelrwlock.sym.
2652 * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
2653 * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
146fa1ee 2654 * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
c915e5ad 2655
4c3c2e8a
UD
2656 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
2657 register loading.
2658 * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
2659 last changed. D'oh.
2660
2b30b2e5
UD
2661 * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
2662
2663 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
2664 of __libc_locking_needed.
2665 (lll_trylock): Initialize %eax to zero.
2666
2b30b2e5
UD
2667 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
2668 pthread_cond_t definition.
2669
e48f9638
RM
26702003-03-10 Roland McGrath <roland@redhat.com>
2671
2672 * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
2673 * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
2674 * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
2675 * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
2676 * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
2677
2678 * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
2679 Instead of setting PD->multiple_threads, set globals
2680 __pthread_multiple_threads and __libc_multiple_threads.
2681 * sysdeps/pthread/createthread.c (create_thread): Likewise.
2682 * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
2683 * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
2684
2685 * descr.h (struct pthread): Conditionalize first member on
2686 [!TLS_DTV_AT_TP]. Replace the `header' member with an anonymous union
2687 containing an anonymous tcbhead_t. Move `list' member out.
2688 [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
2689 * allocatestack.c: Remove use of `header.data.' prefix.
2690 * pthread_create.c: Likewise.
2691 * init.c (__pthread_initialize_minimal_internal): Likewise.
2692 * sysdeps/pthread/createthread.c (create_thread): Likewise.
2693 * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
2694 (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
2695 * sysdeps/x86_64/tls.h: Likewise.
2696 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
2697 (SINGLE_THREAD_P): Likewise.
2698 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
2699 (SINGLE_THREAD_P): Likewise.
2700 * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
2701 * sysdeps/s390/tls.h (tcbhead_t): Likewise.
2702
c37cae9e
UD
27032003-03-09 Ulrich Drepper <drepper@redhat.com>
2704
d38c777e
RM
2705 * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
2706
7b44a5e0 2707 * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
2b30b2e5 2708 * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
7b44a5e0 2709
c2e5e085
UD
2710 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
2711 leftovers from the ia32 code.
2712
2713 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
2714 memory load.
2715 (clear_once_control): Don't load %esi.
2716
2717 * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
2718 handling.
2719
2720 * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
2721
cd4b2a55
UD
2722 * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
2723 * sysdeps/unix/sysv/linux/createthread.c: ...here.
2724
c37cae9e
UD
2725 * Makefile (tests): Add tst-cond10.
2726 * tst-cond10.c: New file.
2727
d130a341
UD
27282003-03-08 Ulrich Drepper <drepper@redhat.com>
2729
ccf1d573
UD
2730 * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
2731 * tst-signal3.c (do_test): Likewise.
2732 * tst-sem5.c (do_test): Likewise.
2733 * tst-kill6.c (do_test): Likewise.
2734 * tst-tls3.c (do_test): Likewise. Include <errno.h>.
2735
2736 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
2737 of inc/dec.
2738 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
2739 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
2740 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2741 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2742 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2743 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2744 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2745 Likewise.
2746 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2747 Likewise.
2748 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2749 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2750 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2751 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2752 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2753 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2754 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
2755 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2756
d130a341
UD
2757 * allocatestack.c (allocate_stack): If mprotect() fails free the
2758 TLS memory.
2759
bc6389ad
UD
27602003-03-07 Ulrich Drepper <drepper@redhat.com>
2761
41d4d223
UD
2762 * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
2763
2764 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
2765 lll_wake_tid. This was used only to work around kernel limits in
2766 the early days.
2767 * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2768 * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
2769 * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2770 * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2771
bc6389ad
UD
2772 * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
2773 (__pthread_initialize_minimal_internal): Change initialization of
2774 __static_tls_align_m1 appropriately.
2775 * pthreadP.h (__static_tls_align_m1): Renamed from
2776 __static_tls_align.
2777 * allocatestack.c (allocate_stack): Use __static_tls_align_m1
2778 instead of __static_tls_align-1.
2779
cc775edf
UD
27802003-03-04 Ulrich Drepper <drepper@redhat.com>
2781
0de28d5c 2782 * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
6245b6ae 2783
518b5308
UD
2784 * pthread_create.c: Define __pthread_keys using nocommon
2785 attribute, not by placing it explicitly in bss.
2786 Remove DEFINE_DEALLOC definition. Not needed anymore.
2787
2788 * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
2789 Use it in mmap call to allocate stacks.
2790
2791 * sysdeps/pthread/createthread.c (create_thread): Fix comment.
2792
cc775edf
UD
2793 * pthread_create.c (start_thread): Use THREAD_SETMEM to store
2794 result of the thread function.
2795
4f6f0a8f
UD
27962003-03-03 Ulrich Drepper <drepper@redhat.com>
2797
f04a2721
UD
2798 * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed. The generic
2799 version is just fine.
2800
4f6f0a8f
UD
2801 * sysdeps/unix/sysv/linux/libc_pthread_init.c
2802 (__pthread_child_handler): Renamed from pthread_child_handler,
2803 exported, and marked hidden. Change all users.
2804 * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
2805 free __pthread_child_handler from child list.
2806
7ce5c164
UD
28072003-03-03 Martin Schwidefsky <schwidefsky@de.ibm.com>
2808
2809 * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
2810
2811 * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2812 Fix handling of cancellation and failing pthread_mutex_unlock call.
2813 * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
2814 (__pthread_cond_wait): Likewise.
2815
2816 * sysdeps/pthread/pthread_rwlock_timedrdlock.c
2817 (pthread_rwlock_timedrdlock): Fix clobber of result variable by
2818 lll_futex_timed_wait call.
2819 * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2820 (pthread_rwlock_timedwrlock): Likewise.
2821
2822 * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2823 Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
2824 * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
2825
2826 * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
2827 check of lll_futex_wake return value.
2828
ea6a015b
RM
28292003-03-03 Roland McGrath <roland@redhat.com>
2830
2831 * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
2832
2833 * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2834 Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
2835 * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2836
4adacf57
UD
28372003-03-02 Ulrich Drepper <drepper@redhat.com>
2838
1be3d664
UD
2839 * sysdeps/pthread/timer_create.c (timer_create): Return correct
2840 error for CPU clocks.
2841
885bafa1
UD
2842 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2843 _POSIX_MONOTONIC_CLOCK.
2844 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2845
4adacf57
UD
2846 * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
2847 recent kernels.
2848
86bfff4d
UD
28492003-03-01 Ulrich Drepper <drepper@redhat.com>
2850
2851 * descr.h (struct pthread): Move cleanup field to the front.
2852
d1149385
RM
28532003-03-01 Roland McGrath <roland@redhat.com>
2854
2855 * sem_open.c (sem_open): Braino fix.
2856
bd8bb78b
UD
28572003-03-01 Ulrich Drepper <drepper@redhat.com>
2858
748bec08
UD
2859 * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
2860 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
2861 __pthread_cleanup_pop functionality.
2862 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2863
bd8bb78b
UD
2864 * descr.h (struct pthread): Move tid field to the front now that
2865 it is often used.
2866
2867 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
2868 (__lll_mutex_timedlock_wait): Remove.
2869 (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
2870 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2871 (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
2872 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2873 (lll_unlock_wake_cb): Don't save and restore %esi.
2874 (__lll_unlock_wake): Add alignment. Don't save, load, and restore
2875 %esi.
2876 (__lll_timedwait_tid): Add alignment.
2877 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
2878 (__lll_unlock_wake): Add alignment. Don't save, load, and restore
2879 %esi.
2880 (__lll_timedwait_tid): Removed.
2881 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2882 (__pthread_cond_broadcast): Don't save, load, and restore %esi.
2883 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
2884 (pthread_barrier_wait): Don't save, load, and restore %esi for
2885 last thread.
2886 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2887 (__pthread_cond_signal): Don't save, load, and restore %esi.
2888 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
2889 (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
2890 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
2891 Don't save, load, and restore %esi.
2892
d2637c70
UD
28932003-02-27 Ulrich Drepper <drepper@redhat.com>
2894
567fb22a
UD
2895 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
2896 Release lock before waking up the waiters.
2897
427f5fa1
UD
2898 * tst-exit1.c (do_test): Don't start more than one thread in parallel.
2899
a2d83cfb
UD
2900 * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
2901 (reader_thread): Likewise.
2902
d2637c70
UD
2903 * sysdeps/pthread/pthread_rwlock_unlock.c
2904 (__pthread_rwlock_unlock): Release internal lock early. Don't try
2905 to wake up readers if there are none.
2906
2907 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
2908 Release internal lock before wake threads.
2909
b1531183
UD
29102003-02-26 Ulrich Drepper <drepper@redhat.com>
2911
dbf6131c
UD
2912 * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
2913 * tst-rwlock8.c: Initialize lock with INIT. Allow INIT to be
2914 predefined.
2915 * tst-rwlock9.c: Likewise.
2916 * tst-rwlock10.c: New file.
2917 * tst-rwlock11.c: New file.
2918
695799fe
UD
2919 * Makefile (tests): Add tst-dlsym1.
2920 * tst-dlsym1.c: New file.
2921
b1531183
UD
2922 * init.c (__pthread_initialize_minimal_internal): Set
2923 GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
2924 * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
2925
3724f268
UD
29262003-02-24 Ulrich Drepper <drepper@redhat.com>
2927
3857ca78
UD
2928 * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
2929
80d80779
UD
2930 * tst-cond2.c: Fix sychronization with child.
2931
86371308
UD
2932 * tst-rwlock8.c (reader_thread): Remove unused variable.
2933
ffeb4481
UD
2934 * Makefile: Add rules to build and run tst-tls3.
2935 * tst-tls3.c: New file.
2936 * tst-tls3mod.c: New file.
2937
3724f268
UD
2938 * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
2939 * tst-rwlock8.c: New file.
2940 * tst-rwlock9.c: New file.
2941 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
2942 complete broken rwlock implementation.
2943 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2944 Likewise.
2945 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2946 Likewise.
2947 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2948 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
18a53579
UD
2949 * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2950 * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2951 * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
2952 * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
2953 * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3724f268 2954
8915cc40
RM
29552003-02-23 Roland McGrath <roland@redhat.com>
2956
2957 * Makefile (nptl-version): Change regexp so case sensitivity is ok.
2958
fd1a0d0c
UD
29592003-02-23 Ulrich Drepper <drepper@redhat.com>
2960
ecf28959
UD
2961 * Makefile (tests): Add tst-context1.
2962 * tst-context1.c: New file.
2963
5e47b76b
UD
2964 * Makefile (tests): Add tst-tls1 and tst-tls2.
2965 * tst-tls1.c: New file.
2966 * tst-tls2.c: New file.
2967
5a6bbb41
UD
2968 * libc-cancellation.c (__libc_enable_asynccancel): Correct test
2969 for failed cmpxchg.
2970
fd1a0d0c
UD
2971 * pthread_create.c (start_thread): Set EXITING_BIT early.
2972
2973 * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
2974 (THREAD_GETMEM_NC): Likewise.
2975
757f9fcb
UD
29762003-02-22 Ulrich Drepper <drepper@redhat.com>
2977
b1b8e747
UD
2978 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
2979 off 3 more bytes by using offset-less instructions when possible.
2980
c780aa21 2981 * Makefile: Add dependency for $(objpfx)version.d.
757f9fcb
UD
2982
2983 * eintr.c (eintr_source): Add unnecessary return but the compiler
2984 insists.
2985
2986 * tst-kill3.c: Include <unistd.h>.
2987
5148559c
RM
29882003-02-21 Roland McGrath <roland@redhat.com>
2989
2990 * pthread_create.c (start_thread): Call __libc_thread_freeres.
2991
ab2d98e3
UD
29922003-02-21 Ulrich Drepper <drepper@redhat.com>
2993
71028edd
UD
2994 * Makefile (tests): Add tst-eintr1.
2995 (distribute): Add eintr.c.
2996 * tst-eintr1.c: New file.
2997 * eintr.c: New file.
2998
e814f748
UD
2999 * pthread_cancel.c (pthread_cancel): Use tkill directly.
3000
3001 * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
3002 Disallow sending SIGCANCEL.
3003
ab2d98e3 3004 * Makefile (tests): Remove tst-basic7. Add tst-kill1, tst-kill2,
9c03686d 3005 tst-kill3, tst-kill4, tst-kill5, tst-kill6.
e814f748
UD
3006 * tst-kill1.c: New file.
3007 * tst-kill2.c: New file.
3008 * tst-kill3.c: New file.
3009 * tst-kill5.c: New file.
9c03686d 3010 * tst-kill6.c: New file.
e814f748
UD
3011 * tst-basic7.c: Renamed to...
3012 * tst-kill4.c: ...this.
ab2d98e3 3013
59fed0e2
RM
30142003-02-21 Roland McGrath <roland@redhat.com>
3015
3016 * Makefile (install-lib-ldscripts): New variable.
3017
49dc759f
UD
30182003-02-21 Ulrich Drepper <drepper@redhat.com>
3019
8c2e9a29
UD
3020 * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
3021 * pthread_cancel.c: Use INVALID_TD_P.
3022 * pthread_detach.c: Likewise.
3023 * pthread_getschedparam.c: Likewise.
3024 * pthread_setschedparam.c: Likewise.
3025 * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
3026 * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
3027 * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
3028 * pthread_timedjoin.c: Likewise.
3029
3030 * tst-basic7.c: Include <signal.h>.
3031
49dc759f
UD
3032 * pthread_join.c (pthread_join): Limited checking for invalid
3033 descriptors.
3034 * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
3035
df5803bf
UD
30362003-02-20 Ulrich Drepper <drepper@redhat.com>
3037
c5acd3d7
UD
3038 * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
3039 beginning of the loop. Clear the entire first block of TSD.
df5803bf
UD
3040 * Makefile (tests): Add tst-key4.
3041 * tst-key4.c: New file.
3042
729924a0
UD
30432003-02-18 Ulrich Drepper <drepper@redhat.com>
3044
2f7dc594
UD
3045 * Makefile (tests): Add tst-basic7.
3046 * tst-basic7.c: New file.
3047
ba25bb0f
UD
3048 * pthread_create.c (deallocate_tsd): Mark as internal_function.
3049 Add some more __builtin_expect.
3050
12fd3c5f 3051 * pthreadP.h: Define dummy version of DEBUGGING_P.
729924a0 3052
5430d926
UD
30532003-02-17 Ulrich Drepper <drepper@redhat.com>
3054
b0db7fbe
UD
3055 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
3056 _POSIX_THREAD_PRIORITY_SCHEDULING.
3057 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
3058 _XOPEN_REALTIME_THREADS.
3059 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3060
3061 * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
3062 kernel returns EINVAL for PID <= 0, work around it.
3063
ecfda9bd
UD
3064 * Makefile (tests): Add tst-signal5.
3065 * tst-signal5.c: New file.
3066
7d78ab99
UD
3067 * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
3068 and LOGIN_NAME_MAX.
3069
371a2972
UD
3070 * tst-cancel1.c (tf): Block all signals.
3071
5430d926
UD
3072 * Makefile (tests): Add tst-basic6.
3073 * tst-basic6.c: New file.
3074
3075 * tst-basic1.c: Add test for process ID.
3076
3077 * Makefile (tests): Add tst-cancel10.
3078 * tst-cancel10.c: New file.
3079
3080 * Makefile (tests): Add tst-signal4.
3081 * tst-signal4.c: New file.
3082
3083 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
3084 __sigismember instead of sigismember. Add __builtin_expect.
3085
1564916a
UD
30862003-02-16 Ulrich Drepper <drepper@redhat.com>
3087
179ff175
UD
3088 * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
3089 pthread_setcancelstate, and pthread_rwlock_setpshared.
3090
e4335f9a
UD
3091 * tst-cancel7.c (do_test): Make sure the pid file exists before
3092 canceling the thread.
3093
0a37669a
UD
3094 * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
3095 pthread_rwlock_timedrdlock tests.
3096 * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
3097 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3098 Check for invalid tv_nsec field.
3099 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3100 Likewise.
3101
3102 * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
3103 recursive mutex of overflow.
3104
3105 * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
3106
e4335f9a 3107 * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
1564916a
UD
3108 going into an endless loop.
3109 * Makefile (tests): Add tst-cancel9.
3110 * tst-cancel9.c: New file.
3111
3112 * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
3113
b270b548
UD
31142003-02-15 Ulrich Drepper <drepper@redhat.com>
3115
1c82b97f
UD
3116 * tst-mutex5.c (do_test): Add more timedlock tests.
3117
b2f05465 3118 * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
c3bb9ee1
UD
3119 * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
3120
e798b60f
UD
3121 * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3122 use INLINE_SYSCALL. Error number is returned, not -1.
3123
90491dc4
UD
3124 * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
3125 and __deallocate_stack with internal_function.
3126 * pthread_create.c: Adjust definitions appropriately.
3127 * allocatestack.c: Likewise.
3128
3129 * pthread_join.c: Add one more __builtin_expect.
3130 * pthread_timedjoin.c: Likewise.
3131
3132 * pthread_getspecific.c (__pthread_getspecific): Clear data->data
3133 not data of sequence number does not match.
3134 Add one __builtin_expect.
3135
c6247c9d
UD
3136 * Makefile (tests): Add tst-clock1.
3137 * tst-clock1.c: New file.
3138
b270b548
UD
3139 * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
3140 negative arguments.
3141 * Makefile (tests): Add tst-basic5.
3142 * tst-basic5.c: New file.
3143
700bf7af
UD
31442003-02-14 Ulrich Drepper <drepper@redhat.com>
3145
757de559
UD
3146 * Makefile (tests): Add tst-basic4.
3147 * tst-basic4.c: New file.
3148
47202270
UD
3149 * pthreadP.h: Add declaraction for __nptl_nthreads.
3150 * pthread_create.c: Define __nptl_nthreads
3151 (start_thread): Increment __nptl_nthreads at beginning. Decrement
b270b548 3152 after thread is done. If then zero, call exit(0).
47202270
UD
3153 * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3154 Add ptr_nthreads. Define HAVE_PTR_NTHREADS.
3155 * init.c (pthread_functions): Initialize ptr_nthreads.
3156 * allocatestack.c (nptl_nthreads): Remove definition and all uses.
3157 (__reclaim_stacks): Decrement __nptl_nthreads.
3158 * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
3159 Define.
3160 * Makefile (tests): Add tst-basic3.
3161 * tst-basic3.c: New file.
3162
e320ef46
UD
3163 * descr.h: Define CANCELING_BIT and CANCELING_BITMASK. Introduce
3164 after CANCELTYPE_BIT, move the other bits up. Update CANCEL_RESTMASK.
3165 * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
3166 * pthread_cancel.c (pthread_cancel): Likewise. Also set CANCELING_BIT
3167 if asynchronous canceling is enabled.
3168 * pthread_join.c (pthread_join): When recognizing circular joins,
3169 take into account the other thread might be already canceled.
3170 * Makefile (tests): Add tst-join5.
3171 * tst-join5.c: New file.
3172
700bf7af
UD
3173 * Makefile (tests): Add tst-join4.
3174 * tst-join4.c: New file.
3175
31762003-02-13 Ulrich Drepper <drepper@redhat.com>
3177
3178 * tst-cond4.c (main): Add test of pthread_attr_getpshared.
3179
dac0f772
UD
31802003-02-13 Martin Schwidefsky <schwidefsky@de.ibm.com>
3181
3182 * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
3183 THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
3184 * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
3185 warning.
3186 * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
3187 to avoid warning.
3188 * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
3189 error if lll_futex_wake failed.
3190
e8cda341
UD
31912003-02-13 Ulrich Drepper <drepper@redhat.com>
3192
a7720b5e
UD
3193 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
3194 handling of cancellation and failung pthread_mutex_unlock call.
3195 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3196 * Makefile (tests): Add tst-cond8 and tst-cond9.
3197 * tst-cond8.c: New file.
3198 * tst-cond9.c: New file.
3199
a1ea4c06
UD
3200 * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
3201
3202 * sysdeps/pthread/pthread.h: Add missing initializers. Protect
3203 non-standard initializers with __USE_GNU.
3204
e8cda341
UD
3205 * Makefile (tests): Add tst-cleanup3.
3206 * tst-cleanup3.c: New file.
3207
2067577c
UD
32082003-02-12 Ulrich Drepper <drepper@redhat.com>
3209
89e78a95
UD
3210 * Makefile (tests): Add tst-attr1 and tst-attr2.
3211 * tst-attr1.c: New file.
3212 * tst-attr2.c: New file.
3213
dfdd294a
UD
3214 * Makefile: Add rules to build and run tst-atfork2 test.
3215 * tst-atfork2.c: New file.
3216 * tst-atfork2mod.c: New file.
3217
3218 * sysdeps/unix/sysv/linux/unregister-atfork.c
3219 (__unregister_atfork): Free the memory allocated for the handlers
3220 after removing them from the lists.
3221
3222 * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
3223 cleanup function.
3224
3225 * tst-atfork1.c (do_test): Wait for the child we forked.
3226 Report error in child.
3227
3228 * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
3229
2067577c
UD
3230 * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
3231
2a8a8a84
UD
32322003-02-10 Ulrich Drepper <drepper@redhat.com>
3233
d9dd121e
UD
3234 * Makefile (tests): Add tst-cancel8.
3235 * tst-cancel8.c: New file.
3236
2a8a8a84
UD
3237 * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
3238 clearing of control variable.
defd1870 3239 * Makefile (tests): Add tst-once3 and tst-once4.
2a8a8a84 3240 * tst-once3.c: New file.
defd1870 3241 * tst-once4.c: New file.
2a8a8a84 3242
a54e8d33
UD
32432003-02-08 kaz Kojima <kkojima@rr.iij4u.or.jp>
3244
3245 * sysdeps/sh/Makefile: New file.
3246 * sysdeps/sh/bits/atomic.h: New file.
3247 * sysdeps/sh/pthread_spin_init.c: New file.
3248 * sysdeps/sh/pthread_spin_lock.c: New file.
3249 * sysdeps/sh/pthread_spin_trylock.S: New file.
3250 * sysdeps/sh/pthread_spin_unlock.S: New file.
3251 * sysdeps/sh/pthreaddef.h: New file.
3252 * sysdeps/sh/tcb-offsets.sym: New file.
3253 * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
3254 * sysdeps/sh/tls.h: New file.
3255 * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
3256 * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
3257 * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
3258 * sysdeps/unix/sysv/linux/sh/fork.c: New file.
3259 * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
3260 * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
3261 * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
3262 * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
3263 * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
3264 * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
3265 * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
3266 * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
3267 * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
3268 * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
3269 * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
3270 * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
3271 * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
3272 * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
3273 * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
3274 * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
3275 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
3276 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
3277 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
3278 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
3279 * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
3280 * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
3281 * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
3282 * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
3283 * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
3284 * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
3285
696e556e
UD
32862003-02-08 Ulrich Drepper <drepper@redhat.com>
3287
3288 * tst-cond2.c: Rearrange code to not rely on behavior undefined
3289 according to POSIX.
3290
3291 * tst-basic2.c (do_test): Lock mutex before creating the thread.
3292
fef710d6
UD
32932003-02-07 Ulrich Drepper <drepper@redhat.com>
3294
c6180643
UD
3295 * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
3296 (TLS_GET_FS): New #define.
3297 (TLS_SET_FS): New #define.
3298 Correct value of __NR_set_thread_area.
3299
fef710d6
UD
3300 * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
3301
11090a99
UD
33022003-02-06 Ulrich Drepper <drepper@redhat.com>
3303
65c68990
UD
3304 * Makefile (tests): Add tst-popen1.
3305 * tst-popen1.c: New file.
3306
11090a99
UD
3307 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
3308 but inactive generalization.
3309 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3310 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3311 Minor optimization, remove one instruction.
3312 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3313
a88c9263
UD
33142003-02-04 Martin Schwidefsky <schwidefsky@de.ibm.com>
3315
3316 * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
3317
33182003-01-31 Martin Schwidefsky <schwidefsky@de.ibm.com>
3319
3320 * init.c (__NR_set_tid_address): Add #ifdef for s390.
3321 * sysdeps/pthread/pthread_barrier_wait.c: New file.
3322 * sysdeps/pthread/pthread_cond_broadcast.c: New file.
3323 * sysdeps/pthread/pthread_cond_signal.c: New file.
3324 * sysdeps/pthread/pthread_cond_timedwait.c: New file.
3325 * sysdeps/pthread/pthread_cond_wait.c: New file.
3326 * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
3327 * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
3328 * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
3329 * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
3330 * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
3331 * sysdeps/s390/Makefile: New file.
3332 * sysdeps/s390/bits/atomic.h: New file.
3333 * sysdeps/s390/pthread_spin_init.c: New file.
3334 * sysdeps/s390/pthread_spin_lock.c: New file.
3335 * sysdeps/s390/pthread_spin_trylock.c: New file.
3336 * sysdeps/s390/pthread_spin_unlock.c: New file.
3337 * sysdeps/s390/pthreaddef.h: New file.
3338 * sysdeps/s390/tcb-offsets.sym: New file.
3339 * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
3340 * sysdeps/s390/tls.h: New file.
3341 * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
3342 * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
3343 * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
3344 * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
3345 * sysdeps/unix/sysv/linux/s390/fork.c: New file.
3346 * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
3347 * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
3348 * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
3349 * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
3350 * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
3351 * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
3352 * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
3353 * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
3354 * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
3355 * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
3356 * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
3357 * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
3358 * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
3359 * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
3360 * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
3361 * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
3362 * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
3363 * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
3364
6f1cff95
UD
33652003-02-04 Ulrich Drepper <drepper@redhat.com>
3366
ec609a8e
UD
3367 * atomic.h: Add a couple more default implementations.
3368 (atomic_compare_and_exchange_acq): Use
d45e8740
UD
3369 __arch_compare_and_exchange_32_acq in return value definition. It
3370 always exists.
3371 (atomic_bit_set): Renamed from atomic_set_bit.
0289bef9 3372 Add missing atomic_ prefixes.
e3ec8904 3373
6f1cff95
UD
3374 * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
3375 thread library is available, use correct value to mark initialized
3376 once variable.
3377
4f088329
UD
33782003-02-03 Ulrich Drepper <drepper@redhat.com>
3379
6f1cff95
UD
3380 * allocatestack.c (allocate_stack): Use __getpagesize instead of
3381 __sysconf to determine pagesize.
3382
3e4fc359 3383 * pthread_create.c: Include <atomic.h>.
4f088329
UD
3384 * allocatestack.c (allocate_stack): Implement coloring of the
3385 allocated stack memory. Rename pagesize to pagesize_m1. It's the
3386 size minus one. Adjust users.
3e4fc359 3387 * sysdeps/i386/i686/Makefile: New file.
4f088329 3388
2f42e8be
UD
33892003-02-02 Ulrich Drepper <drepper@redhat.com>
3390
4301f7e2
UD
3391 * allocatestack.c: Improve comment throughout the file.
3392
2f42e8be 3393 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
a37818b3 3394 (__lll_lock_wait): Add branch prediction.
2f42e8be
UD
3395 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
3396 (__lll_lock_wait): Likewise.
3397 (lll_unlock_wake_cb): Removed.
3398
4a7d6545
UD
33992003-01-31 Ulrich Drepper <drepper@redhat.com>
3400
3401 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
3402 _POSIX_THREAD_PRIORITY_SCHEDULING.
3403
886d5973
UD
34042003-01-30 Jakub Jelinek <jakub@redhat.com>
3405
3406 * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3407 Fix return type of ptr___pthread_getspecific.
3408
e474ca78
UD
34092003-01-29 Ulrich Drepper <drepper@redhat.com>
3410
3411 * Makefile (tests): Add tst-umask1.
3412 (tst-umask1-ARGS): Define.
3413 * tst-umask1.c: New file.
3414
e6ebd2e4
UD
34152003-01-28 Ulrich Drepper <drepper@redhat.com>
3416
6cf26f41
UD
3417 * Makefile (libpthread-routines): Remove lowlevelrwlock. Add
3418 pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
3419 pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
3420 pthread_rwlock_unlock.
3421 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
3422 * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
3423 * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
3424 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
3425 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3426 New file.
3427 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
3428 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3429 New file.
3430 * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
3431 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
3432 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
3433 New file.
3434 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
3435 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
3436 New file.
3437 * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
3438 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
3439 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
3440 New file.
3441 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
3442 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
3443 New file.
3444 * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
3445
1d087a7e
UD
3446 * Makefile (libpthread-routines): Remove lowlevelcond and
3447 lowlevelsem. Add sem_wait, sem_trywait, sem_timedwait, sem_post,
3448 pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
3449 and pthread_cond_broadcast.
4a99d160
UD
3450 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
3451 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
3452 * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
3453 * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
3454 * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
3455 * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
3456 * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
3457 * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
3458 * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
3459 * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
3460 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
3461 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
3462 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
3463 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
3464 * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
3465 * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
3466 * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
3467 * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
3468 * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
3469 * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
3470 * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
3471 * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
3472 * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
3473 * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
3474 * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
3475 * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
3476 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
3477 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
3478 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
3479 * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
3480 * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
1d087a7e 3481
e6ebd2e4
UD
3482 * sysdeps/unix/sysv/linux/i386/createthread.c: Define
3483 PREPARE_CREATE and TLS_VALUE with x86-specific bits. All the rest
3484 of the code is moved to ...
3485 * sysdeps/pthread/createthread.c: ...here. New file.
3486
a15698cb
UD
34872003-01-27 Ulrich Drepper <drepper@redhat.com>
3488
0566b130
UD
3489 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
3490 (__new_sem_post): Clear %eax before returning.
3491 Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
3492
e6fb8846
UD
3493 * Makefile (tests): Add tst-cleanup2.
3494 * tst-cleanup2.c: New file.
3495
a15698cb
UD
3496 * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
3497 Interpret first parameter correctly.
3498
8824b0a1
UD
34992003-01-17 Ulrich Drepper <drepper@redhat.com>
3500
3501 * Makefile (headers): Add bits/semaphore.h.
3502
850dcfca
UD
35032003-01-16 Jakub Jelinek <jakub@redhat.com>
3504
3505 * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
3506 if not SHARED.
3507
574b892e
UD
35082003-01-14 Ulrich Drepper <drepper@redhat.com>
3509
a8d87c92
UD
3510 * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
3511 must be used and mapping failed.
3512 Reported by Luke Elliott <luke.elliott@activfinancial.com>.
3513
574b892e
UD
3514 * Makefile (CFLAGS-pthread_self.os): Define this, not
3515 CFLAGS-pthread_self.c.
3516
fb48047a
UD
35172003-01-13 Ulrich Drepper <drepper@redhat.com>
3518
47805511
UD
3519 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
3520 lll_unlock_wake_cb.
3521
fb48047a
UD
3522 * Makefile (libpthread-routines): Add version. Add rules to build
3523 version.os and banner.h.
3524 * version.c: New file.
3525
115bb61d
UD
35262003-01-13 Jakub Jelinek <jakub@redhat.com>
3527
3528 * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
3529 the alias unconditional.
3530 * pthread_mutex_unlock.c (__pthread_mutex_unlock_internal): Likewise.
3531
35322003-01-13 Ulrich Drepper <drepper@redhat.com>
3533
3534 * Makefile (CFLAGS-pthread_self.c): New definition.
3535
6aca81bb
UD
35362003-01-06 Jakub Jelinek <jakub@redhat.com>
3537
3538 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
3539 INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
3540 * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
3541 * init.c (__pthread_initialize_minimal_internal): Likewise.
3542
e9c7764e
UD
35432003-01-07 Jakub Jelinek <jakub@redhat.com>
3544
b5facfda
UD
3545 * pthreadP.h (__pthread_cond_timedwait): Add prototype.
3546
e9c7764e
UD
3547 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3548 (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
3549 (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
3550 * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
3551 (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
3552 (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
3553
bef1e42f
UD
35542003-01-06 Jakub Jelinek <jakub@redhat.com>
3555
3556 * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
3557 * pt-system.c (LIBC_CANCEL_HANDLED): Add.
3558 * tst-cancel-wrappers.sh: Remove all exceptions.
3559
bbd17455
UD
35602003-01-05 Ulrich Drepper <drepper@redhat.com>
3561
a73ab6df
UD
3562 * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
3563 features. Reported by Marijn Ros <marijn@mad.scientist.com>.
3564
bbd17455
UD
3565 * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
3566 Use __libc_pthread_functions array if SHARED.
3567
3568 * pthreadP.h: Move pthread_cond_2_0_t definition to...
3569 * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
3570
3571 * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
3572 (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
3573 __libc_key_create, __libc_getspecific, __libc_setspecific): Use
3574 __libc_ptf_call instead of __libc_maybe_call.
3575 (PTF): New #define.
3576 (__libc_cleanup_region_start): Wrap function name with PTF call.
3577 (__libc_cleanup_region_end): Likewise.
3578 (__libc_cleanup_end): Likewise.
3579
3580 * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
3581 * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
3582 * pthread_key_create.c: Add __pthread_key_create_internal alias.
3583 * pthreadP.h: Add prototypes.
3584
3585 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
3586 __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
3587 __pthread_rwlock_unlock aliases.
3588 * pthreadP.h: Add prototypes for new aliases.
3589
3590 * pthreadP.h (struct pthead_functions): Moved to...
3591 * sysdeps/pthread/pthread-functions.h: ...here. New file.
3592 * init.c (pthread_functions): Add initializers for new elements.
3593
3594 * cleanup_defer.c: Add __pthread_cleanup_push_defer and
3595 __pthread_cleanup_pop_restore aliases.
3596 * pthreadP.h: Add prototypes.
3597
3598 * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
3599 and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
3600 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
3601 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
3602 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3603 * pthreadP.h: Adjust prototypes and callers.
3604
d27a78be
UD
36052003-01-04 Ulrich Drepper <drepper@redhat.com>
3606
b74121ae
UD
3607 * Makefile (tests): Add tst-cancel7.
3608 (tst-cancel7-ARGS): New variable.
bbd17455 3609 * tst-cancel7.c: New file.
b74121ae 3610
29bc410c
UD
3611 * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
3612 around gcc defficiencies.
3613 * old_pthread_cond_signal.c: Likewise.
3614 * old_pthread_cond_timedwait.c: Likewise.
3615 * old_pthread_cond_wait.c: Likewise.
3616
d27a78be
UD
3617 * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
3618
733f25e6
UD
36192003-01-03 Ulrich Drepper <drepper@redhat.com>
3620
7edb2ae3
UD
3621 * Makefile (tests): Add tst-cond7.
3622 * tst-cond7.c: New file.
3623
b1151300
UD
3624 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
3625 (condvar_cleanup): Get condvar address from the right place.
3626
733f25e6
UD
3627 * atomic.h: Correct definitions of atomic_full_barrier,
3628 atomic_read_barrier, atomic_write_barrier.
3629
3630 * old_pthread_cond_broadcast.c: Make memory allocate and initialization
3631 race-free.
3632 * old_pthread_cond_signal.c: Likewise.
3633 * old_pthread_cond_timedwait.c: Likewise.
3634 * old_pthread_cond_wait.c: Likewise.
3635
686b7223
UD
36362003-01-03 Jakub Jelinek <jakub@redhat.com>
3637
3638 * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
3639
0e07706e
UD
36402003-01-03 Ulrich Drepper <drepper@redhat.com>
3641
997256dd
UD
3642 * pthreadP.h (pthread_cond_2_0_t): New type.
3643 (struct pthread_functions): Use new type for 2.0 condvar callbacks.
3644 Use new type for the 2.0 condvar function prototypes.
3645 * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
3646 * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
3647 parameter.
3648 * old_pthread_cond_destroy.c: Likewise.
3649 * old_pthread_cond_broadcast.c: Likewise. Lock appropriately.
3650 * old_pthread_cond_signal.c: Likewise.
3651 * old_pthread_cond_timedwait.c: Likewise.
3652 * old_pthread_cond_wait.c: Likewise.
3653
842d2817
UD
3654 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
3655 (__pthread_cond_wait): Don't save cancellation mode and seq value
3656 in same location.
3657
0e07706e
UD
3658 * herrno.c (__h_errno_location): Don't define as weak.
3659
bf293afe
UD
36602003-01-02 Jakub Jelinek <jakub@redhat.com>
3661
3662 * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
3663 pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
3664 and pthread_cond_wait.
3665 * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
3666 Renamed to...
3667 (__pthread_cond_broadcast_2_0): ... this.
3668 * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
3669 Renamed to...
3670 (__pthread_cond_destroy_2_0): ... this.
3671 * old_pthread_cond_init.c (__old_pthread_cond_init):
3672 Renamed to...
3673 (__pthread_cond_init_2_0): ... this.
3674 * old_pthread_cond_signal.c (__old_pthread_cond_signal):
3675 Renamed to...
3676 (__pthread_cond_signal_2_0): ... this.
3677 * old_pthread_cond_wait.c (__old_pthread_cond_wait):
3678 Renamed to...
3679 (__pthread_cond_wait_2_0): ... this.
3680 * pthread_cond_destroy.c: Include shlib-compat.h.
3681 (pthread_cond_destroy): Change strong_alias into versioned_symbol.
3682 * pthread_cond_init.c: Include shlib-compat.h.
3683 (pthread_cond_init): Change strong_alias into versioned_symbol.
3684 * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
3685 fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
3686 fields.
3687 (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
3688 __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
3689 __pthread_cond_wait_2_0): New prototypes.
3690 (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
3691 __old_pthread_cond_init, __old_pthread_cond_signal,
3692 __old_pthread_cond_wait): Removed.
3693 * init.c: Include shlib-compat.h.
3694 (pthread_functions): Guard ptr___pthread_attr_init_2_0
3695 initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
3696 Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
3697 ptr___pthread_cond_*_2_0 fields.
3698 * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
3699 pthread_cond_*@GLIBC_2.0 compatibility symbols.
3700
3701 * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
3702 LIBC_SIGACTION was not yet defined.
3703 [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
3704 [!defined LIBC_SIGACTION] (__sigaction): New function and
3705 libc_hidden_weak.
3706 [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
3707 [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
3708
37092003-01-02 Jakub Jelinek <jakub@redhat.com>
3710
3711 * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
3712
05df18c3
UD
37132003-01-02 Ulrich Drepper <drepper@redhat.com>
3714
3715 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3716 New, larger type definition.
3717 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
3718 implementation.
3719 * Versions [libpthread]: Add definitions for new pthread_cond_*
3720 interfaces for version GLIBC_2.3.2.
3721 * pthread_cond_init.c: Update initialization for new type definition.
3722 * Makefile (libpthread-routines): Remove pthread_cond_wait,
3723 pthread_cond_timedwait, pthread_cond_signal, and
3724 pthread_cond_broadcast. Add old_pthread_cond_init,
3725 old_pthread_cond_destroy, old_pthread_cond_wait,
3726 old_pthread_cond_timedwait, old_pthread_cond_signal, and
3727 old_pthread_cond_broadcast.
3728 * old_pthread_cond_broadcast.c: New file.
3729 * old_pthread_cond_destroy.c: New file.
3730 * old_pthread_cond_init.c: New file.
3731 * old_pthread_cond_signal.c: New file.
3732 * old_pthread_cond_timedwait.c: New file.
3733 * old_pthread_cond_wait.c: New file.
3734 * pthreadP.h: Add prototypes for the compatibility interfaces.
3735
3736 * pthread_cond_destroy.c: Don't include <errno.h>.
3737
fd8979e4
UD
37382003-01-01 Ulrich Drepper <drepper@redhat.com>
3739
3740 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
3741 unnecessary zero offset when addressing MUTEX.
3742
6d6ee629
UD
37432002-12-31 Ulrich Drepper <drepper@redhat.com>
3744
3745 * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
3746 __register_atfork.
3747 * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
3748 for __register_atfork.
3749
a4baf360
UD
37502002-12-31 Jakub Jelinek <jakub@redhat.com>
3751
3752 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
3753 instead of ASSEMBLER test macro.
3754
3755 * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
3756 __libc_current_sigrtmax): Add libc_hidden_def.
3757
3758 * sysdeps/pthread/list.h: Remove assert.h include.
3759
e9395a94
UD
37602002-12-31 Ulrich Drepper <drepper@redhat.com>
3761
3762 * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
3763 __pthread_initialize_minimal_internal not
3764 __pthread_initialize_minimal.
3765
89d6e444
UD
37662002-12-30 Ulrich Drepper <drepper@redhat.com>
3767
416d2de6
UD
3768 * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
3769 __pthread_initialize_minimal as hidden.
3770
89d6e444
UD
3771 * init.c (__pthread_initialize_minimal_internal): Don't mark as
3772 constructor.
3773
37742002-12-31 Jakub Jelinek <jakub@redhat.com>
3775
3776 * Makefile ($(inst_libdir)/libpthread.so): Depend on
3777 $(common-objpfx)format.lds, include that into the output script.
3778 Fix comment.
3779 (extra-B-pthread.so): Change linuxthreads/ into nptl/.
3780
8cac677c
UD
37812002-12-28 Andreas Jaeger <aj@suse.de>
3782
3783 * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
3784 nsec resolution changes.
3785 (xstat64_conv): Likewise.
3786 (xstat32_conv): Likewise.
3787 * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
3788 struct kernel_stat.
3789 * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
3790 structs stat and stat64.
3791 * time/time.h (__timespec_defined): Define for __USE_MISC.
89d6e444 3792 * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
8cac677c 3793
49e9f864
UD
37942002-12-30 Jakub Jelinek <jakub@redhat.com>
3795
3796 * forward.c (FORWARD2): Renamed from FORWARD3. Remove unused export
3797 argument.
3798 (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
3799 (pthread_exit): Use strong_alias to avoid warnings.
3800 * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
3801 and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
3802 ptr___pthread_attr_init_2_*.
3803 * init.c (pthread_functions): Adjust.
3804
bab09b26
UD
38052002-12-29 Ulrich Drepper <drepper@redhat.com>
3806
598d7a42
UD
3807 * forward.c: Make all functions available by default again. It
3808 caused too much trouble.
3809
bab09b26
UD
3810 * pt-siglongjmp.c: Removed.
3811
3b7ed871
UD
38122002-12-28 Jakub Jelinek <jakub@redhat.com>
3813
3814 * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
3815 (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
3816 * sysdeps/i386/Makefile: New file.
3817 * sysdeps/i386/tcb-offsets.sym: New file.
3818 * sysdeps/pthread/tcb-offsets.h: New file.
3819 * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3820 Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
3821
3822 * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
3823 __register_atfork...
3824 (GLIBC_2.3.2): ...here.
3825
38262002-12-28 Ulrich Drepper <drepper@redhat.com>
3827
3828 * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
3829 pthread_attr_setstackaddr with __attribute_deprecated__.
3830
270d9d47
UD
38312002-12-27 Jakub Jelinek <jakub@redhat.com>
3832
3833 * pt-system.c (system): Remove cancellation handling.
3834 * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
3835 cancellation routines.
3836
131fd126
UD
38372002-12-28 Ulrich Drepper <drepper@redhat.com>
3838
afb2e954
UD
3839 * descr.h: Include <dl-sysdep.h>.
3840 (struct pthread): Move header.data.list to the back of the struct.
131fd126
UD
3841 * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
3842 (MULTIPLE_THREADS_OFFSET): Adjust offset.
3843 (SYSINFO_OFFSEET): Likewise.
3844
38452002-12-27 Jakub Jelinek <jakub@redhat.com>
3846
3847 * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
3848 Define.
3849 (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
3850 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
3851 DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
3852 (USE_DL_SYSINFO): Undef.
3853
38542002-12-22 Jakub Jelinek <jakub@redhat.com>
3855
3856 * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
3857 $(common-objpfx)libc.so.
3858 * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
3859 it is bigger than pipe buffer size even on arches with bigger
3860 page size.
3861 (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
3862
a218c9cf
UD
38632002-12-25 Ulrich Drepper <drepper@redhat.com>
3864
3865 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
3866 correct errno access for case that USE___THREAD is not defined.
3867
015a2dc9
UD
38682002-12-24 Ulrich Drepper <drepper@redhat.com>
3869
3870 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
3871 Patch by Marijn Ros <marijn@mad.scientist.com>.
3872
5220f9ac
RM
38732002-12-22 Roland McGrath <roland@redhat.com>
3874
3875 * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
3876
1561bf63
UD
38772002-12-20 Ulrich Drepper <drepper@redhat.com>
3878
3879 * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
3880
3325198e
UD
38812002-12-19 Ulrich Drepper <drepper@redhat.com>
3882
057c823f
UD
3883 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
3884 NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
3885 * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
3886
097eca29
UD
3887 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
3888 of int $0x80.
3889 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3890 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
3891 * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
3892 * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3893 * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
3894 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
3895 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
3896 * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3897
3898 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
3899 sysenter.
3900 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
3901
3902 * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
3903
5f5843e3
UD
3904 * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
3905 in new TCB.
3906 * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
3907 that sysinfo is properly initialized.
3908 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
3909 to 1 only for ld.so.
3910
3325198e
UD
3911 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
3912 RTLD_CORRECT_DYNAMIC_WEAK.
3913
74e8f2dc
UD
39142002-12-19 Jakub Jelinek <jakub@redhat.com>
3915
3916 * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
3917 Use return 0 as 6th argument to FORWARD4.
3918 * pthread_equal.c: Include pthreadP.h instead of pthread.h.
3919
df45b31e
UD
39202002-12-18 Ulrich Drepper <drepper@redhat.com>
3921
3922 * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
3923 * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
3924 Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
3925 (INIT_SYSINFO): New #define.
3926 (TLS_TP_INIT): Use INIT_SYSINFO.
3927 * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3928 At test to make sure SYSINFO_OFFSET value is correct.
3929 * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
3930
3d539579
UD
39312002-12-18 Jakub Jelinek <jakub@redhat.com>
3932
3933 * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
3934 * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
3935 * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
3936 [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
3937 __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
3938 __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
3939 __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
3940
d7913e0e
UD
39412002-12-18 Ulrich Drepper <drepper@redhat.com>
3942
f051627f
UD
3943 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
3944 macro instead of using int $0x80 directly.
3945
d7913e0e
UD
3946 * sysdeps/pthread/bits/stdio-lock.h: New file.
3947 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
3948 * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
3949 * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
3950 * Makefile (routines): Add libc-lowlevelmutex.
3951
3952 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
3953 __i686.get_pc_thunk.dx.
3954
f077a4a9
UD
39552002-12-17 Jakub Jelinek <jakub@redhat.com>
3956
3957 * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
3958 (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
3959 ($(objpfx)tst-cancel-wrappers.out): New rule.
3960 * tst-cancel-wrappers.sh: New test.
3961 * tst-locale1.c: Include signal.h.
3962 (uselocale): Test static linking of __libc_current_sigrt*.
3963
39642002-12-17 Ulrich Drepper <drepper@redhat.com>
3965
3966 * Makefile (tests): Add tst-cancel6.
3967 * tst-cancel6.c: New file
3968
bd499a3b
UD
39692002-12-17 Jakub Jelinek <jakub@redhat.com>
3970
3971 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
3972 Define meaningfully for assembler as well.
3973 * pthreadP.h (struct pthread_functions): Remove
3974 ptr_pthread_attr_init field. Add ptr_pthread_attr_init_2_0
3975 and ptr_pthread_attr_init_2_1 fields.
3976 * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
3977 and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
3978 * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
3979 (FORWARD3): Define using FORWARD4.
3980 (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
3981 versions.
3982 * pt-system.c: Remove duplicate stdlib.h include.
3983
0a1063f4
UD
39842002-12-16 Ulrich Drepper <drepper@redhat.com>
3985
87d60668
UD
3986 * sem_init.c: Define sem_init@GLIBC_2.0.
3987 * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
3988 * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
3989
0a1063f4
UD
3990 * flockfile.c: Moved to...
3991 * sysdeps/pthread/flockfile.c: ...here. New file.
3992 * funlockfile.c: Moved to...
3993 * sysdeps/pthread/funlockfile.c: ...here. New file.
3994 * ftrylockfile.c: Moved to...
3995 * sysdeps/pthread/ftrylockfile.c: ...here. New file.
3996
9634cf9d
UD
39972002-12-16 Jakub Jelinek <jakub@redhat.com>
3998
3999 * libc-cancellation.c: Guard both function with
4000 #if !defined NOT_IN_libc.
4001 * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
4002 automatically provided pthread wrappers.
4003 * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
4004 CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
4005 nor in libpthread.
4006 * pt-open.c: Removed.
4007 * pt-fcntl.c: Removed.
4008 * pt-fsync.c: Removed.
4009 * pt-lseek.c: Removed.
4010 * pt-msgrcv.c: Removed.
4011 * pt-msgsnd.c: Removed.
4012 * pt-msync.c: Removed.
4013 * pt-nanosleep.c: Removed.
4014 * pt-open64.c: Removed.
4015 * pt-pause.c: Removed.
4016 * pt-pread.c: Removed.
4017 * pt-pread64.c: Removed.
4018 * pt-pwrite.c: Removed.
4019 * pt-pwrite64.c: Removed.
4020 * pt-read.c: Removed.
4021 * pt-recv.c: Removed.
4022 * pt-recvfrom.c: Removed.
4023 * pt-recvmsg.c: Removed.
4024 * pt-send.c: Removed.
4025 * pt-sendto.c: Removed.
4026 * pt-sigtimedwait.c: Removed.
4027 * pt-sigwait.c: Removed.
4028 * pt-wait.c: Removed.
4029 * pt-waitpid.c: Removed.
4030 * pt-write.c: Removed.
4031 * pt-accept.c: Removed.
4032 * pt-close.c: Removed.
4033 * pt-connect.c: Removed.
4034 * pt-lseek64.c: Removed.
4035 * pt-sendmsg.c: Removed.
4036 * pt-tcdrain.c: Removed.
4037
6ee8d334
UD
40382002-12-15 Ulrich Drepper <drepper@redhat.com>
4039
81fa9371
UD
4040 * init.c (__pthread_initialize_minimal_internal): Renamed from
4041 __pthread_initialize_minimal. Make old name an alias. This
4042 converts a normal relocation into a relative relocation.
4043
f3015aa5
UD
4044 * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
4045
4cbc1950
UD
4046 * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
4047 readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
4048 * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
4049 pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
4050 pt-sigwaitinfo, pt-waitid, and pt-writev.
4051 * pt-creat.c: Removed.
4052 * pt-poll.c: Removed.
4053 * pt-pselect.c: Removed.
4054 * pt-readv.c: Removed.
4055 * pt-select.c: Removed.
4056 * pt-sigpause.c: Removed.
4057 * pt-sigsuspend.c: Removed.
4058 * pt-sigwaitinfo.c: Removed.
4059 * pt-waitid.c: Removed.
4060 * pt-writev.c: Removed.
4061
8454830b
UD
4062 * init.c (pthread_functions): New variable.
4063 (__pthread_initialize_minimal): Pass pointer to pthread_functions
4064 (or NULL) to __libc_pthread_init.
4065 * forward.c: Rewrite to use __libc:pthread_functions array to get
4066 function addresses.
4067 * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
4068 prototype.
4069 * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
4070 Take new parameter. Copy content of variable pointed to by it
4071 to __libc_pthread_init.
4072
4073 * pthreadP.h (struct pthread_functions): New type.
4074 (__libc_pthread_init): Declare.
4075
4076 * pthread_attr_destroy.c: Add namespace protected alias.
4077 * pthread_attr_getdetachstate.c: Likewise.
4078 * pthread_attr_getinheritsched.c: Likewise.
4079 * pthread_attr_getschedparam.c: Likewise.
4080 * pthread_attr_getschedpolicy.c: Likewise.
4081 * pthread_attr_getscope.c: Likewise.
4082 * pthread_attr_setdetachstate.c: Likewise.
4083 * pthread_attr_setinheritsched.c: Likewise.
4084 * pthread_attr_setschedparam.c: Likewise.
4085 * pthread_attr_setschedpolicy.c: Likewise.
4086 * pthread_attr_setscope.c: Likewise.
4087 * pthread_cond_broadcast.c: Likewise.
4088 * pthread_cond_destroy.c: Likewise.
4089 * pthread_cond_init.c: Likewise.
4090 * pthread_cond_signal.c: Likewise.
4091 * pthread_cond_wait.c: Likewise.
4092 * pthread_condattr_destroy.c: Likewise.
4093 * pthread_condattr_init.c: Likewise.
4094 * pthread_equal.c: Likewise.
4095 * pthread_exit.c: Likewise.
4096 * pthread_getschedparam.c: Likewise.
4097 * pthread_self.c: Likewise.
4098 * pthread_setcancelstate.c: Likewise.
4099 * pthread_setschedparam.c: Likewise.
4100 * pthread_mutex_destroy.c: Likewise.
4101 * pthread_mutex_init.c: Likewise.
4102 * pthreadP.h: Add prototypes for the aliases.
4103
0d5f4929
UD
4104 * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
4105 multiple_threads member in correct TCB to 1.
4106
6ee8d334
UD
4107 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
4108 SINGLE_THREAD_P. If in libc or libpthread examine multiple_thread
4109 member of thread decriptor, otherwise return unconditionally 1.
4110
2fb6444d
UD
41112002-12-14 Ulrich Drepper <drepper@redhat.com>
4112
4113 * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
4114 regular Linux version. Remove file.
4115 * sysdeps/unix/sysv/linux/connect.S: Likewise. Remove file.
4116 * sysdeps/unix/sysv/linux/llseek.c: Likewise. Remove file.
4117 * sysdeps/unix/sysv/linux/msgrcv.c: Likewise. Remove file.
4118 * sysdeps/unix/sysv/linux/msgsnd.c: Likewise. Remove file.
4119 * sysdeps/unix/sysv/linux/open64.c: Likewise. Remove file.
4120 * sysdeps/unix/sysv/linux/poll.c: Likewise. Remove file.
4121 * sysdeps/unix/sysv/linux/pread.c: Likewise. Remove file.
4122 * sysdeps/unix/sysv/linux/pread64.c: Likewise. Remove file.
4123 * sysdeps/unix/sysv/linux/pselect.c: Likewise. Remove file.
4124 * sysdeps/unix/sysv/linux/pwrite.c: Likewise. Remove file.
4125 * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. Remove file.
4126 * sysdeps/unix/sysv/linux/readv.c: Likewise. Remove file.
4127 * sysdeps/unix/sysv/linux/recv.S: Likewise. Remove file.
4128 * sysdeps/unix/sysv/linux/recvfrom.S: Likewise. Remove file.
4129 * sysdeps/unix/sysv/linux/recvmsg.S: Likewise. Remove file.
4130 * sysdeps/unix/sysv/linux/send.S: Likewise. Remove file.
4131 * sysdeps/unix/sysv/linux/sendmsg.S: Likewise. Remove file.
4132 * sysdeps/unix/sysv/linux/sendto.S: Likewise. Remove file.
4133 * sysdeps/unix/sysv/linux/sigpause.c: Likewise. Remove file.
4134 * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise. Remove file.
4135 * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise. Remove file.
4136 * sysdeps/unix/sysv/linux/sigwait.c: Likewise. Remove file.
4137 * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. Remove file.
4138 * sysdeps/unix/sysv/linux/system.c: Likewise. Remove file.
4139 * sysdeps/unix/sysv/linux/tcdrain.c: Likewise. Remove file.
4140 * sysdeps/unix/sysv/linux/wait.c: Likewise. Remove file.
4141 * sysdeps/unix/sysv/linux/waitid.c: Likewise. Remove file.
4142 * sysdeps/unix/sysv/linux/waitpid.c: Likewise. Remove file.
4143 * sysdeps/unix/sysv/linux/writev.c: Likewise. Remove file.
4144 * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise. Remove file.
4145
86b2dc40
UD
41462002-12-14 Jakub Jelinek <jakub@redhat.com>
4147
4148 * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
4149 * sysdeps/unix/sysv/linux/open.c: Removed.
4150 * sysdeps/unix/sysv/linux/fsync.c: Removed.
4151 * sysdeps/unix/sysv/linux/lseek.c: Removed.
4152 * sysdeps/unix/sysv/linux/msync.c: Removed.
4153 * sysdeps/unix/sysv/linux/read.c: Removed.
4154 * sysdeps/unix/sysv/linux/close.c: Removed.
4155 * sysdeps/unix/sysv/linux/creat.c: Removed.
4156 * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
4157 * sysdeps/unix/sysv/linux/pause.c: Removed.
4158 * sysdeps/unix/sysv/linux/select.c: Removed.
4159 * sysdeps/unix/sysv/linux/write.c: Removed.
4160
9d263d72
UD
41612002-12-14 Ulrich Drepper <drepper@redhat.com>
4162
4163 * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
4164 element in TCB to see whether locking is needed.
4165
4166 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
4167 MULTIPLE_THREADS_OFFSET value is correct.
4168
4169 * sysdeps/unix/sysv/linux/close.c: New file.
4170 * sysdeps/unix/sysv/linux/connect.S: New file.
4171 * sysdeps/unix/sysv/linux/creat.c: New file.
4172 * sysdeps/unix/sysv/linux/fsync.c: New file.
4173 * sysdeps/unix/sysv/linux/llseek.c: New file.
4174 * sysdeps/unix/sysv/linux/lseek.c: New file.
4175 * sysdeps/unix/sysv/linux/msgrcv.c: New file.
4176 * sysdeps/unix/sysv/linux/msgsnd.c: New file.
4177 * sysdeps/unix/sysv/linux/msync.c: New file.
4178 * sysdeps/unix/sysv/linux/nanosleep.c: New file.
4179 * sysdeps/unix/sysv/linux/open.c: New file.
4180 * sysdeps/unix/sysv/linux/open64.c: New file.
4181 * sysdeps/unix/sysv/linux/pause.c: New file.
4182 * sysdeps/unix/sysv/linux/poll.c: New file.
4183 * sysdeps/unix/sysv/linux/pread.c: New file.
4184 * sysdeps/unix/sysv/linux/pread64.c: New file.
4185 * sysdeps/unix/sysv/linux/pselect.c: New file.
4186 * sysdeps/unix/sysv/linux/pwrite.c: New file.
4187 * sysdeps/unix/sysv/linux/pwrite64.c: New file.
4188 * sysdeps/unix/sysv/linux/readv.c: New file.
4189 * sysdeps/unix/sysv/linux/recv.S: New file.
4190 * sysdeps/unix/sysv/linux/recvfrom.S: New file.
4191 * sysdeps/unix/sysv/linux/recvmsg.S: New file.
4192 * sysdeps/unix/sysv/linux/select.c: New file.
4193 * sysdeps/unix/sysv/linux/send.S: New file.
4194 * sysdeps/unix/sysv/linux/sendmsg.S: New file.
4195 * sysdeps/unix/sysv/linux/sendto.S: New file.
4196 * sysdeps/unix/sysv/linux/sigpause.c: New file.
4197 * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
4198 * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
4199 * sysdeps/unix/sysv/linux/sigwait.c: New file.
4200 * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
4201 * sysdeps/unix/sysv/linux/system.c: New file.
4202 * sysdeps/unix/sysv/linux/tcdrain.c: New file.
4203 * sysdeps/unix/sysv/linux/wait.c: New file.
4204 * sysdeps/unix/sysv/linux/waitid.c: New file.
4205 * sysdeps/unix/sysv/linux/waitpid.c: New file.
4206 * sysdeps/unix/sysv/linux/writev.c: New file.
4207 * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
4208
4209 * pt-readv.c: Fix comment.
4210
42112002-12-14 Jakub Jelinek <jakub@redhat.com>
4212
4213 * tst-cleanup1.c: Include stdlib.h.
4214
4215 * tst-cancel5.c: New test.
4216 * Makefile (tests): Add tst-cancel5.
4217 (tst-cancel5): Link against libc.so libpthread.so in that order.
4218
9ae0909b
UD
42192002-12-13 Ulrich Drepper <drepper@redhat.com>
4220
b7bdd9c4
UD
4221 * forward.c (test_loaded): Prevent recursive calls.
4222
9ae0909b
UD
4223 * Makefile (routines): Add libc-cancellation.
4224 * libc-cancellation.c: New file.
4225 * descr.h (struct pthread): Add multiple_threads field.
4226 * allocatestack.c (allocate_stack): Initialize multiple_header field of
4227 new thread descriptor to 1.
4228 * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
4229 Initialize multiple_thread field after successful thread creation.
4230 * cancellation.c (__do_cancel): Move to pthreadP.h.
4231 (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
4232 (__pthread_disable_asynccancel): Add internal_function attribute.
4233 * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
4234 * pthread_setcancelstate.c: Likewise.
4235 * pthread_setcanceltype.c: Likewise.
4236 * pthread_exit.c: Likewise.
4237 * pthreadP.h (CANCELLATION_P): Likewise.
4238 (__do_cancel): Define as static inline.
4239 (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
4240 (__libc_enable_asynccancel, __libc_disable_asynccancel): New
4241 declarations.
4242 * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
4243 fields. Define MULTIPLE_THREADS_OFFSET.
4244 * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
4245 declaration.
4246 * sysdeps/unix/sysv/linux/accept.S: New file.
4247 * sysdeps/unix/sysv/linux/read.c: New file.
4248 * sysdeps/unix/sysv/linux/write.c: New file.
4249 * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
4250 * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
4251 initialization of __libc_locking_needed.
4252 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
4253 __libc_locking_needed, use multiple_threads field in TCB.
4254 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
4255
22f20674
UD
42562002-12-12 Ulrich Drepper <drepper@redhat.com>
4257
2ad2e1e7
UD
4258 * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
4259 version.
4260 * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
4261
22f20674
UD
4262 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
4263 access to __libc_locking_needed for PIC.
4264
aa80bf86
UD
42652002-12-12 Jakub Jelinek <jakub@redhat.com>
4266
4267 * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
4268 declare for libc.so.
4269 (__libc_lock_init, __libc_lock_init_recursive): Change into comma
4270 expression.
4271 (__libc_lock_lock): Put into statement expression.
4272 (__libc_lock_unlock): Remove trailing semicolon.
4273 * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
4274
24021373
RM
42752002-12-12 Roland McGrath <roland@redhat.com>
4276
4277 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
4278 "m" constraint to refer to __libc_locking_needed. Declare it here.
4279
14e7aece
UD
42802002-12-12 Ulrich Drepper <drepper@redhat.com>
4281
4282 * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
4283 * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
4284 Initialize __libc_locking_needed.
4285 * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
4286 instead of __register_pthread_fork_handler.
4287 * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
4288 * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
4289 fork-gen with libc_pthread_init.
4290 * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
4291 of __register_pthread_fork_handler.
4292 * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
4293 of __register_pthread_fork_handler.
4294 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
4295 __libc_locking_needed to determine whether lock prefix can be avoided.
4296 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
4297
85631c8e
UD
42982002-12-11 Ulrich Drepper <drepper@redhat.com>
4299
da63009e
UD
4300 * Makefile (tests): Add tst-cleanup1.
4301 * tst-cleanup1.c: New file.
4302 * cancellation.c (__cleanup_thread): Removed.
4303 (__do_cancel): Remove call to __cleanup_thread.
4304 * pthreadP.h: Remove __cleanup_thread prorotype.
4305
000160a2
UD
4306 * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
4307 Remember function and argument even if cancellation handler
4308 function is not available.
4309 (__libc_cleanup_region_end): Execute registered function directly if
4310 pthread functions are not available.
4311 (__libc_cleanup_end): Likewise.
4312
85631c8e
UD
4313 * init.c (__pthread_initialize_minimal): Fix initialization in
4314 static lib by preventing gcc from being too clever.
4315
dce8f2b6
UD
43162002-12-10 Ulrich Drepper <drepper@redhat.com>
4317
34a075be
UD
4318 * init.c (__pthread_initialize_minimal): Remove unneccesary
4319 sigaddset call.
4320
dce8f2b6
UD
4321 * Makefile (tests): We can run tst-locale2 now.
4322
e5e45b53
UD
43232002-12-09 Ulrich Drepper <drepper@redhat.com>
4324
4325 * Versions: Remove duplicated sigwait entry.
4326
bdb04f92
UD
43272002-12-08 Ulrich Drepper <drepper@redhat.com>
4328
1e506629
UD
4329 * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
4330 inside libpthread.
4331
a3957dd5
UD
4332 * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
4333
bdb04f92
UD
4334 * pthreadP.h: Declare __pthread_enable_asynccancel and
4335 __pthread_disable_asynccancel.
4336 (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
4337 (CANCEL_RESET): Use __pthread_disable_asynccancel.
4338 * cancellation.c (__pthread_enable_asynccancel): New function.
4339 (__pthread_disable_asynccancel): New function.
4340 * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
4341 * pt-close.c: Likewise.
4342 * pt-connect.c: Likewise.
4343 * pt-creat.c: Likewise.
4344 * pt-fcntl.c: Likewise.
4345 * pt-fsync.c: Likewise.
4346 * pt-lseek.c: Likewise.
4347 * pt-lseek64.c: Likewise.
4348 * pt-msgrcv.c: Likewise.
4349 * pt-msgsnd.c: Likewise.
4350 * pt-msync.c: Likewise.
4351 * pt-nanosleep.c: Likewise.
4352 * pt-open.c: Likewise.
4353 * pt-open64.c: Likewise.
4354 * pt-pause.c: Likewise.
4355 * pt-poll.c: Likewise.
4356 * pt-pread.c: Likewise.
4357 * pt-pread64.c: Likewise.
4358 * pt-pselect.c: Likewise.
4359 * pt-pwrite.c: Likewise.
4360 * pt-pwrite64.c: Likewise.
4361 * pt-read.c: Likewise.
4362 * pt-readv.c: Likewise.
4363 * pt-recv.c: Likewise.
4364 * pt-recvfrom.c: Likewise.
4365 * pt-recvmsg.c: Likewise.
4366 * pt-select.c: Likewise.
4367 * pt-send.c: Likewise.
4368 * pt-sendmsg.c: Likewise.
4369 * pt-sendto.c: Likewise.
4370 * pt-sigpause.c: Likewise.
4371 * pt-sigsuspend.c: Likewise.
4372 * pt-sigtimedwait.c: Likewise.
4373 * pt-sigwait.c: Likewise.
4374 * pt-sigwaitinfo.c: Likewise.
4375 * pt-system.c: Likewise.
4376 * pt-tcdrain.c: Likewise.
4377 * pt-wait.c: Likewise.
4378 * pt-waitid.c: Likewise.
4379 * pt-waitpid.c: Likewise.
4380 * pt-write.c: Likewise.
4381 * pt-writev.c: Likewise.
a3957dd5
UD
4382 * pthread_join.c: Likewise.
4383 * pthread_timedjoin.c: Likewise.
bdb04f92
UD
4384
4385 * pt-sigpause.c (sigsuspend): Call __sigsuspend.
4386 (__xpg_sigpause): New function.
4387 * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
4388
6ccb3834
UD
43892002-12-07 Ulrich Drepper <drepper@redhat.com>
4390
09efc3ba
UD
4391 * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
4392
4393 * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
4394 _GI_pthread_cleanup_pop to pthreadP.h.
4395
4396 * ftrylockfile.c: Use _IO_lock_trylock instead of
4397 pthread_mutex_trylock.
4398
4399 * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
4400 (CANCEL_RESET): Likewise.
4401 (__pthread_setcanceltype_): Declare.
4402 (__pthread_mutex_lock_internal): Declare.
4403 (__pthread_mutex_unlock_internal): Declare.
4404 (__pthread_once_internal): Declare.
4405 (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
4406 (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
4407
4408 * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
4409 and pthread_mutex_unlock.
4410 * pthread_cond_wait.c: Likewise.
4411 * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
4412 * pthread_mutex_unlock.c: Likewise.
4413
4414 * pthread_setcanceltype.c: Add additional alias
4415 __pthread_setcanceltype.
4416
4417 * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
4418 * sem_open.c (sem_open): Likewise.
4419 Use __libc_open, __libc_write, and __libc_close instead of
4420 open, write, and close respectively.
4421
4422 * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
4423 Rewrite as statement expression since it must return a value.
4424
4425 * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
4426 * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
4427 __pthread_kill.
4428
4429 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
4430 alias __pthread_once_internal.
4431
6ccb3834
UD
4432 * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
4433
d3c9f895
UD
44342002-12-06 Ulrich Drepper <drepper@redhat.com>
4435
4614167a
UD
4436 * Makefile (tests): Add tst-stdio1 and tst-stdio2.
4437 * tst-stdio1.c: New file.
4438 * tst-stdio2.c: New file.
4439
a4548cea
UD
4440 * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
4441
d3c9f895
UD
4442 * Makefile (tests): Comment out tst-locale2 for now.
4443 (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
4444
4445 * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
4446 -D_IO_MTSAFE_IO.
4447 * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
4448 Use _IO_lock_init instead of explicit assignment.
4449
4450 * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
4451 Define __libc_lock_* and __libc_lock_recursive macros with
4452 lowlevellock macros, not pthread mutexes.
4453
4454 * flockfile.c: Include <bits/stdio-lock.h>. Use _IO_lock_lock instead
4455 of pthread_mutex_lock.
4456 * funlockfile.c: Include <bits/stdio-lock.h>. Use _IO_lock_unlock
4457 instead of pthread_mutex_unlock.
4458
fde89ad0
RM
44592002-12-06 Roland McGrath <roland@redhat.com>
4460
4461 * allocatestack.c (__stack_user): Use uninitialized defn.
4462 * init.c (__pthread_initialize_minimal): Initialize it here.
4463
11767d47
RM
44642002-12-05 Roland McGrath <roland@redhat.com>
4465
fde89ad0
RM
4466 * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
4467 string.
4468 * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
4469
11767d47
RM
4470 * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
4471 missing & here too.
4472
440d8bc2
UD
44732002-12-05 Ulrich Drepper <drepper@redhat.com>
4474
4475 * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
4476 lowlevellock.
4477 * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
4478 * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
4479 * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
4480 * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
4481 for __libc_lock_* macros.
4482 * Makefile (routines): Add libc-lowlevellock.
4483
44842002-10-09 Roland McGrath <roland@redhat.com>
4485
4486 * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
4487 Under [__PIC__], call the function via the pointer fetched for
4488 comparison rather than a call by name that uses the PLT.
4489 (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
4490 (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
4491 (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
4492 (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
4493 (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
4494
d5ed0118
RM
44952002-12-04 Roland McGrath <roland@redhat.com>
4496
4497 * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
4498
4499 * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
4500 * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
4501
4502 * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
4503
eaa4099f
UD
45042002-12-04 Ulrich Drepper <drepper@redhat.com>
4505
4506 * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
4507 a completely opaque, non-integer type.
4508 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4509
33b5d0cc
UD
45102002-12-05 Jakub Jelinek <jakub@redhat.com>
4511
4512 * sysdeps/i386/tls.h: Include stdlib.h.
4513 * sysdeps/x86_64/tls.h: Likewise.
4514
7a5cdb30
UD
45152002-12-04 Ulrich Drepper <drepper@redhat.com>
4516
c4a6d859
UD
4517 * Makefile (tests): Add tst-locale2.
4518 (tests-static): Likewise.
4519 * tst-locale2.c: New file.
4520
7a5cdb30
UD
4521 * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
4522 volatile and add memory clobbers to lock operations.
4523
d82d5d12
UD
45242002-12-03 Ulrich Drepper <drepper@redhat.com>
4525
69cae3cf
UD
4526 * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
4527 * sysdeps/i386/i486/bits/atomic.h: New file.
4528 * sysdeps/i386/i586/bits/atomic.h: New file.
4529 * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
4530 include i486 version.
4531 * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
4532 * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
c97c64de 4533 Patch by Marijn Ros <marijn@mad.scientist.com>.
69cae3cf 4534
e4044c01
UD
4535 * allocatestack.c (get_cached_stack): Don't crash if we first
4536 found a stack with a larger size then needed.
4537 Reported by Hui Huang <hui.huang@sun.com>.
4538
d82d5d12
UD
4539 * Makefile (tests): Add tst-sysconf.
4540 * tst-sysconf.c: New file.
4541
4542 * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
4543 PTHREAD_THREADS_MAX.
4544
fa9a4ff0
RM
45452002-12-02 Roland McGrath <roland@redhat.com>
4546
4547 * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
4548 Declare using hidden_proto instead of attribute_hidden, so there are
4549 non-.hidden static symbols for gdb to find.
4550 (__pthread_keys): Likewise.
4551 * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
4552 * allocatestack.c (__stack_user): Likewise.
4553 * pthread_create.c (__pthread_keys): Likewise.
4554 (__nptl_threads_events, __nptl_last_event): Make these static instead
4555 of hidden.
4556 * pthread_key_create.c (__pthread_pthread_keys_max,
4557 __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
4558
91949a33
UD
45592002-12-02 Ulrich Drepper <drepper@redhat.com>
4560
c22b52fa
UD
4561 * Makefile (tests): Add tst-locale1. If buid-static is yes link
4562 statically.
4563 * tst-locale1.c: New file.
4564
beb6aa41
UD
4565 * pthread_cond_timedwait.c: Include <stdlib.h>.
4566
91949a33
UD
4567 * Makefile (tests): Add tst-fork2 and tst-fork3.
4568 * tst-fork2.c: New file.
4569 * tst-fork3.c: New file.
4570
654dff90
UD
45712002-11-28 Ulrich Drepper <drepper@redhat.com>
4572
cb0e76b4
UD
4573 * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
4574
4575 * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
4576 require it to 200112L.
4577
4578 * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
4579 instruction only if HAVE_CMOV is defined.
4580 * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
4581
975aa229
UD
4582 * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
4583
654dff90
UD
4584 * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
4585
4586 * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
4587
4588 * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
4589
a3931336
UD
45902002-11-27 Ulrich Drepper <drepper@redhat.com>
4591
c10c099c
UD
4592 * sysdeps/x86_64/bits/atomic.h: New file.
4593
4594 * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
4595 16-bit operations.
4596
dca99d27
UD
4597 * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
4598 possible since gettid cannot fail.
4599
f78deea6
UD
4600 * sysdeps/x86_64/pthreaddef.h: New file.
4601
4602 * sysdeps/i386/pthreaddef.h (gettid): Removed.
4603
4604 * sysdeps/x86_64/pthread_spin_init.c: New file.
4605 * sysdeps/x86_64/pthread_spin_lock.c: New file.
4606 * sysdeps/x86_64/pthread_spin_trylock.c: New file.
4607 * sysdeps/x86_64/pthread_spin_unlock.c: New file.
4608
4609 * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
4610 Add missing lock prefix. Minute optimization.
4611
4612 * tst-spin2.c (main): Also check successful trylock call.
4613
4614 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
4615 syscall. Fix typo in case INTERNAL_SYSCALL is not used.
4616
4617 * sysdeps/i386/pthread_spin_destroy.c: Moved to...
4618 * sysdeps/pthread/pthread_spin_destroy.c: ...here. New file.
4619
4620 * sysdeps/i386/pthread_sigmask.c: Removed. Use the generic code.
4621 * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
4622 value in case of an error. Add support for INTERNAL_SYSCALL.
b54e18eb
UD
4623
4624 * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
4625 value in case of an error.
4626
a3931336
UD
4627 * sysdeps/x86_64/tls.h: New file.
4628
76a50749
UD
46292002-11-26 Ulrich Drepper <drepper@redhat.com>
4630
117c452c
UD
4631 * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface. It now
4632 takes the array member name and the index as parameters.
4633 (THREAD_SETMEM_NC): Likewise.
4634 * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
4635 * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
4636 interfaces.
4637
4638 * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
4639 to decide which code to use.
4640 (THREAD_SETMEM_NC): Likewise.
4641
76a50749
UD
4642 * allocatestack.c (queue_stack): Don't remove stack from list here.
4643 Do it in the caller. Correct condition to prematurely terminate
4644 loop to free stacks.
4645 (__deallocate_stack): Remove stack from list here.
4646
46472002-11-26 Ulrich Drepper <drepper@redhat.com>
4648
4649 * Makefile (tests): Add tst-stack1.
4650 * tst-stack1.c: New file.
4651
4652 * allocatestack.c (allocate_stack): Initialize the TCB on a user
4653 provided stack.
4654
4655 * pthread_attr_getstack.c: Return bottom of the thread area.
4656
46572002-11-25 Ulrich Drepper <drepper@redhat.com>
4658
4659 * Makefile (libpthread-routines): Add pt-allocrtsig and
4660 pthread_kill_other_threads.
4661 * pt-allocrtsig.c: New file.
4662 * pthread_kill_other_threads.c: New file.
4663 * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
4664 all three functions.
4665 * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
4666 allocrtsig.
4667 * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
4668 __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
4669 and __libc_allocate_rtsig_private.
4670 * Versions (libpthread): Export pthread_kill_other_threads_np,
4671 __libc_current_sigrtmin, and __libc_current_sigrtmax.
4672
46732002-11-24 Ulrich Drepper <drepper@redhat.com>
4674
4675 * allocatestack.c (allocate_stack): stackaddr in attribute points to
4676 the end of the stack. Adjust computations.
4677 When mprotect call fails dequeue stack and free it.
4678 * pthread_attr_setstack.c: Store top of the stack in stackaddr
4679 attribute.
4680 * pthread_getattr_np.c: Likewise.
4681
4682 * descr.h (IS_DETACHED): Add some more parenthesis to prevent
4683 surprises.
4684
46852002-11-23 Ulrich Drepper <drepper@redhat.com>
4686
4687 * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
4688 attribute definitions. Patch by Luca Barbieri <ldb@ldb.ods.org>.
4689
46902002-11-22 Ulrich Drepper <drepper@redhat.com>
4691
4692 * pthread_getspecific.c: Optimize access to first 2nd-level array.
4693 * pthread_setspecific.c: Likewise.
4694
46952002-11-21 Ulrich Drepper <drepper@redhat.com>
4696
4697 * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
4698 definitions. Get them from the official place.
4699 * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
4700
4701 * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
4702 Use new CLONE_ flags in clone() calls.
4703
4704 * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
4705 * sysdeps/unix/sysv/linux/i386/fork.c: New file.
4706
4707 * Versions: Add pthread_* functions for libc.
4708 * forward.c: New file.
4709
4710 * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
4711 errno-loc.
4712 * herrno.c: New file.
4713 * res.c: New file.
4714
4715 * Makefile (libpthread-routines): Remove sem_post, sem_wait,
4716 sem_trywait, and sem_timedwait. Add herrno and res.
4717 * sem_init.c: Don't initialize lock and waiters members.
4718 * sem_open.c: Likewise.
4719 * sem_post.c: Removed.
4720 * sem_wait.c: Removed.
4721 * sem_trywait.c: Removed.
4722 * sem_timedwait.c: Removed.
4723 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
4724 Includes full implementations of sem_post, sem_wait, sem_trywait,
4725 and sem_timedwait.
4726 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
4727 for new implementation.
4728 * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
4729 and waiters fields.
4730
4731 * tst-sem3.c: Improve error message.
4732 * tst-signal3.c: Likewise.
4733
4734 * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
4735 to tell the kernel about the termination futex and to initialize tid
4736 member. Don't initialize main_thread.
4737 * descr.h (struct pthread): Remove main_thread member.
4738 * cancelllation.c (__do_cancel): Remove code handling main thread.
4739 The main thread is not special anymore.
4740
4741 * allocatestack.c (__reclaim_stacks): Mark stacks as unused. Add
4742 size of the stacks to stack_cache_actsize.
4743
4744 * pt-readv.c: Add missing "defined".
4745 * pt-sigwait.c: Likewise.
4746 * pt-writev.c: Likewise.
4747
47482002-11-09 Ulrich Drepper <drepper@redhat.com>
4749
4750 * Versions: Export __connect from libpthread.
4751 Patch by Luca Barbieri <ldb@ldb.ods.org>.
4752
4753 * Makefile (libpthread-routines): Add pt-raise.
4754 * sysdeps/unix/sysv/linux/raise.c: New file.
4755 * sysdeps/unix/sysv/linux/pt-raise.c: New file.
4756 * sysdeps/generic/pt-raise.c: New file.
4757
4758 * pthread_cond_init.c: Initialize all data elements of the condvar
4759 structure. Patch by Luca Barbieri <ldb@ldb.ods.org>.
4760
4761 * pthread_attr_init.c: Actually implement 2.0 compatibility version.
4762 * pthread_create.c: Likewise.
4763
4764 * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
4765 * tst-key1.c: New file.
4766 * tst-key2.c: New file.
4767 * tst-key3.c: New file.
4768
4769 * Versions: Export pthread_detach for version GLIBC_2.0.
4770 Reported by Saurabh Desai <sdesai@austin.ibm.com>.
4771
47722002-11-08 Ulrich Drepper <drepper@redhat.com>
4773
4774 * pthread_key_create.c: Terminate search after an unused key was found.
4775 Patch by Luca Barbieri <ldb@ldb.ods.org>.
4776
4777 * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
4778 Patch by Luca Barbieri <ldb@ldb.ods.org>.
4779
47802002-10-10 Ulrich Drepper <drepper@redhat.com>
4781
4782 * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
4783 dynamic lookup for errno in PIC.
4784
4785 * allocatestack.c (get_cached_stack): Rearrange code slightly to
4786 release the stack lock as soon as possible.
4787 Call _dl_allocate_tls_init for TCB from the cache to re-initialize
4788 the static TLS block.
4789 (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
4790
4791 * cancellation.c: Renamed from cancelation.c.
4792 * Makefile: Adjust accordingly.
4793 * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
4794 * cleanup_defer.c: Use CANCELLATION_P.
4795 * pthread_testcancel.c: Likewise.
4796 * descr.h: Fix spelling in comments.
4797 * init.c: Likewise.
4798 * pthread_getattr_np.c: Likewise.
4799 * pthread_getschedparam.c: Likewise.
4800 * pthread_setschedparam.c: Likewise.
4801 * Versions: Likewise.
4802
4803 * pt-pselect.c: New file.
4804 * Makefile (libpthread-routines): Add pt-pselect.
4805 * Versions: Add pselect.
4806
4807 * tst-cancel4.c: New file.
4808 * Makefile (tests): Add tst-cancel4.
4809
48102002-10-09 Ulrich Drepper <drepper@redhat.com>
4811
4812 * pthread_mutex_lock.c: Always record lock ownership.
4813 * pthread_mutex_timedlock.c: Likewise.
4814 * pthread_mutex_trylock.c: Likewise.
4815
4816 * pt-readv.c: New file.
4817 * pt-writev.c: New file.
4818 * pt-creat.c: New file.
4819 * pt-msgrcv.c: New file.
4820 * pt-msgsnd.c: New file.
4821 * pt-poll.c: New file.
4822 * pt-select.c: New file.
4823 * pt-sigpause.c: New file.
4824 * pt-sigsuspend.c: New file.
4825 * pt-sigwait.c: New file.
4826 * pt-sigwaitinfo.c: New file.
4827 * pt-waitid.c: New file.
4828 * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
4829 pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
4830 pt-sigwait, pt-sigwaitinfo, and pt-waitid.
4831 * Versions: Add all the new functions.
4832
4833 * tst-exit1.c: New file.
4834 * Makefile (tests): Add tst-exit1.
4835
4836 * sem_timedwait.c: Minor optimization for more optimal fastpath.
4837
48382002-10-08 Ulrich Drepper <drepper@redhat.com>
4839
4840 * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
4841
4842 * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
4843 call. pthread_join is an official cancellation point.
4844 * pthread_timedjoin.c: Likewise.
4845
4846 * pthread_cond_wait.c: Revert order in which internal lock are dropped
4847 and the condvar's mutex are retrieved.
4848 * pthread_cond_timedwait.c: Likewise.
4849 Reported by dice@saros.East.Sun.COM.
4850
48512002-10-07 Ulrich Drepper <drepper@redhat.com>
4852
4853 * pthreadP.h: Cut out all type definitions and move them...
4854 * sysdeps/unix/sysv/linux/internaltypes.h: ...here. New file.
4855 * pthreadP.h: Include <internaltypes.h>.
4856
4857 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
4858 performance tweaks.
4859
4860 * sem_trywait.c: Shuffle #includes around to get right order.
4861 * sem_timedwait.c: Likewise.
4862 * sem_post.c: Likewise.
4863 * sem_wait.c: Likewise.
4864
4865 * nptl 0.3 released.
4866
4867 * Makefile (tests): Add tst-signal3.
4868 * tst-signal3.c: New file.
4869
48702002-10-05 Ulrich Drepper <drepper@redhat.com>
4871
4872 * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
4873 the asms modify the sem object.
4874 (__lll_sem_timedwait): Now takes struct sem* as first parameter.
4875
4876 * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
4877 the actual members.
4878 * pthreadP.h (struct sem): New type. Actual semaphore type.
4879 * semaphoreP.h: Include pthreadP.h.
4880 * sem_getvalue.c: Adjust to sem_t change.
4881 * sem_init.c: Likewise.
4882 * sem_open.c: Likewise.
4883 * sem_post.c: Likewise.
4884 * sem_timedwait.c: Likewise.
4885 * sem_trywait.c: Likewise.
4886 * sem_wait.c: Likewise.
4887
48882002-10-04 Ulrich Drepper <drepper@redhat.com>
4889
4890 * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
4891 * tst-basic2.c: New file.
4892 * tst-exec1.c: New file.
4893 * tst-exec2.c: New file.
4894 * tst-exec3.c: New file.
4895
4896 * tst-fork1.c: Remove extra */.
4897
4898 * nptl 0.2 released. The API for IA-32 is complete.