Update.
[kopensolaris-gnu/glibc.git] / nptl / ChangeLog
1 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
2
3         * Makefile (libpthread-routines): Add version.  Add rules to build
4         version.os and banner.h.
5         * version.c: New file.
6
7 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
8
9         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
10         the alias unconditional.
11         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
12
13 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
14
15         * Makefile (CFLAGS-pthread_self.c): New definition.
16
17 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
18
19         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
20         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
21         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
22         * init.c (__pthread_initialize_minimal_internal): Likewise.
23
24 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
25
26         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
27
28         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
29         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
30         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
31         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
32         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
33         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
34
35 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
36
37         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
38         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
39         * tst-cancel-wrappers.sh: Remove all exceptions.
40
41 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
42
43         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
44         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
45
46         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
47         Use __libc_pthread_functions array if SHARED.
48
49         * pthreadP.h: Move pthread_cond_2_0_t definition to...
50         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
51
52         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
53         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
54         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
55         __libc_ptf_call instead of __libc_maybe_call.
56         (PTF): New #define.
57         (__libc_cleanup_region_start): Wrap function name with PTF call.
58         (__libc_cleanup_region_end): Likewise.
59         (__libc_cleanup_end): Likewise.
60
61         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
62         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
63         * pthread_key_create.c: Add __pthread_key_create_internal alias.
64         * pthreadP.h: Add prototypes.
65
66         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
67         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
68         __pthread_rwlock_unlock aliases.
69         * pthreadP.h: Add prototypes for new aliases.
70
71         * pthreadP.h (struct pthead_functions): Moved to...
72         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
73         * init.c (pthread_functions): Add initializers for new elements.
74
75         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
76         __pthread_cleanup_pop_restore aliases.
77         * pthreadP.h: Add prototypes.
78
79         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
80         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
81         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
82         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
83         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
84         * pthreadP.h: Adjust prototypes and callers.
85
86 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
87
88         * Makefile (tests): Add tst-cancel7.
89         (tst-cancel7-ARGS): New variable.
90         * tst-cancel7.c: New file.
91
92         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
93         around gcc defficiencies.
94         * old_pthread_cond_signal.c: Likewise.
95         * old_pthread_cond_timedwait.c: Likewise.
96         * old_pthread_cond_wait.c: Likewise.
97
98         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
99
100 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
101
102         * Makefile (tests): Add tst-cond7.
103         * tst-cond7.c: New file.
104
105         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
106         (condvar_cleanup): Get condvar address from the right place.
107
108         * atomic.h: Correct definitions of atomic_full_barrier,
109         atomic_read_barrier, atomic_write_barrier.
110
111         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
112         race-free.
113         * old_pthread_cond_signal.c: Likewise.
114         * old_pthread_cond_timedwait.c: Likewise.
115         * old_pthread_cond_wait.c: Likewise.
116
117 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
118
119         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
120
121 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
122
123         * pthreadP.h (pthread_cond_2_0_t): New type.
124         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
125         Use new type for the 2.0 condvar function prototypes.
126         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
127         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
128         parameter.
129         * old_pthread_cond_destroy.c: Likewise.
130         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
131         * old_pthread_cond_signal.c: Likewise.
132         * old_pthread_cond_timedwait.c: Likewise.
133         * old_pthread_cond_wait.c: Likewise.
134
135         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
136         (__pthread_cond_wait): Don't save cancellation mode and seq value
137         in same location.
138
139         * herrno.c (__h_errno_location): Don't define as weak.
140
141 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
142
143         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
144         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
145         and pthread_cond_wait.
146         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
147         Renamed to...
148         (__pthread_cond_broadcast_2_0): ... this.
149         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
150         Renamed to...
151         (__pthread_cond_destroy_2_0): ... this.
152         * old_pthread_cond_init.c (__old_pthread_cond_init):
153         Renamed to...
154         (__pthread_cond_init_2_0): ... this.
155         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
156         Renamed to...
157         (__pthread_cond_signal_2_0): ... this.
158         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
159         Renamed to...
160         (__pthread_cond_wait_2_0): ... this.
161         * pthread_cond_destroy.c: Include shlib-compat.h.
162         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
163         * pthread_cond_init.c: Include shlib-compat.h.
164         (pthread_cond_init): Change strong_alias into versioned_symbol.
165         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
166         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
167         fields.
168         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
169         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
170         __pthread_cond_wait_2_0): New prototypes.
171         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
172         __old_pthread_cond_init, __old_pthread_cond_signal,
173         __old_pthread_cond_wait): Removed.
174         * init.c: Include shlib-compat.h.
175         (pthread_functions): Guard ptr___pthread_attr_init_2_0
176         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
177         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
178         ptr___pthread_cond_*_2_0 fields.
179         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
180         pthread_cond_*@GLIBC_2.0 compatibility symbols.
181
182         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
183         LIBC_SIGACTION was not yet defined.
184         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
185         [!defined LIBC_SIGACTION] (__sigaction): New function and
186         libc_hidden_weak.
187         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
188         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
189
190 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
191
192         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
193
194 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
195
196         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
197         New, larger type definition.
198         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
199         implementation.
200         * Versions [libpthread]: Add definitions for new pthread_cond_*
201         interfaces for version GLIBC_2.3.2.
202         * pthread_cond_init.c: Update initialization for new type definition.
203         * Makefile (libpthread-routines): Remove pthread_cond_wait,
204         pthread_cond_timedwait, pthread_cond_signal, and
205         pthread_cond_broadcast.  Add old_pthread_cond_init,
206         old_pthread_cond_destroy, old_pthread_cond_wait,
207         old_pthread_cond_timedwait, old_pthread_cond_signal, and
208         old_pthread_cond_broadcast.
209         * old_pthread_cond_broadcast.c: New file.
210         * old_pthread_cond_destroy.c: New file.
211         * old_pthread_cond_init.c: New file.
212         * old_pthread_cond_signal.c: New file.
213         * old_pthread_cond_timedwait.c: New file.
214         * old_pthread_cond_wait.c: New file.
215         * pthreadP.h: Add prototypes for the compatibility interfaces.
216
217         * pthread_cond_destroy.c: Don't include <errno.h>.
218
219 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
220
221         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
222         unnecessary zero offset when addressing MUTEX.
223
224 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
225
226         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
227         __register_atfork.
228         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
229         for __register_atfork.
230
231 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
232
233         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
234         instead of ASSEMBLER test macro.
235
236         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
237         __libc_current_sigrtmax): Add libc_hidden_def.
238
239         * sysdeps/pthread/list.h: Remove assert.h include.
240
241 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
242
243         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
244         __pthread_initialize_minimal_internal not
245         __pthread_initialize_minimal.
246
247 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
248
249         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
250         __pthread_initialize_minimal as hidden.
251
252         * init.c (__pthread_initialize_minimal_internal): Don't mark as
253         constructor.
254
255 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
256
257         * Makefile ($(inst_libdir)/libpthread.so): Depend on
258         $(common-objpfx)format.lds, include that into the output script.
259         Fix comment.
260         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
261
262 2002-12-28  Andreas Jaeger  <aj@suse.de>
263
264         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
265         nsec resolution changes.
266         (xstat64_conv): Likewise.
267         (xstat32_conv): Likewise.
268         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
269         struct kernel_stat.
270         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
271         structs stat and stat64.
272         * time/time.h (__timespec_defined): Define for __USE_MISC.
273         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
274
275 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
276
277         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
278         argument.
279         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
280         (pthread_exit): Use strong_alias to avoid warnings.
281         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
282         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
283         ptr___pthread_attr_init_2_*.
284         * init.c (pthread_functions): Adjust.
285
286 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
287
288         * forward.c: Make all functions available by default again.  It
289         caused too much trouble.
290
291         * pt-siglongjmp.c: Removed.
292
293 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
294
295         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
296         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
297         * sysdeps/i386/Makefile: New file.
298         * sysdeps/i386/tcb-offsets.sym: New file.
299         * sysdeps/pthread/tcb-offsets.h: New file.
300         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
301         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
302
303         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
304         __register_atfork...
305         (GLIBC_2.3.2): ...here.
306
307 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
308
309         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
310         pthread_attr_setstackaddr with __attribute_deprecated__.
311
312 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
313
314         * pt-system.c (system): Remove cancellation handling.
315         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
316         cancellation routines.
317
318 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
319
320         * descr.h: Include <dl-sysdep.h>.
321         (struct pthread): Move header.data.list to the back of the struct.
322         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
323         (MULTIPLE_THREADS_OFFSET): Adjust offset.
324         (SYSINFO_OFFSEET): Likewise.
325
326 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
327
328         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
329         Define.
330         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
331         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
332         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
333         (USE_DL_SYSINFO): Undef.
334
335 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
336
337         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
338         $(common-objpfx)libc.so.
339         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
340         it is bigger than pipe buffer size even on arches with bigger
341         page size.
342         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
343
344 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
345
346         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
347         correct errno access for case that USE___THREAD is not defined.
348
349 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
350
351         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
352         Patch by Marijn Ros <marijn@mad.scientist.com>.
353
354 2002-12-22  Roland McGrath  <roland@redhat.com>
355
356         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
357
358 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
359
360         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
361
362 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
363
364         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
365         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
366         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
367
368         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
369         of int $0x80.
370         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
371         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
372         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
373         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
374         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
375         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
376         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
377         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
378
379         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
380         sysenter.
381         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
382
383         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
384
385         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
386         in new TCB.
387         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
388         that sysinfo is properly initialized.
389         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
390         to 1 only for ld.so.
391
392         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
393         RTLD_CORRECT_DYNAMIC_WEAK.
394
395 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
396
397         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
398         Use return 0 as 6th argument to FORWARD4.
399         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
400
401 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
402
403         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
404         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
405         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
406         (INIT_SYSINFO): New #define.
407         (TLS_TP_INIT): Use INIT_SYSINFO.
408         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
409         At test to make sure SYSINFO_OFFSET value is correct.
410         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
411
412 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
413
414         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
415         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
416         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
417         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
418         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
419         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
420         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
421
422 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
423
424         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
425         macro instead of using int $0x80 directly.
426
427         * sysdeps/pthread/bits/stdio-lock.h: New file.
428         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
429         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
430         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
431         * Makefile (routines): Add libc-lowlevelmutex.
432
433         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
434         __i686.get_pc_thunk.dx.
435
436 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
437
438         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
439         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
440         ($(objpfx)tst-cancel-wrappers.out): New rule.
441         * tst-cancel-wrappers.sh: New test.
442         * tst-locale1.c: Include signal.h.
443         (uselocale): Test static linking of __libc_current_sigrt*.
444
445 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
446
447         * Makefile (tests): Add tst-cancel6.
448         * tst-cancel6.c: New file
449
450 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
451
452         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
453         Define meaningfully for assembler as well.
454         * pthreadP.h (struct pthread_functions): Remove
455         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
456         and ptr_pthread_attr_init_2_1 fields.
457         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
458         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
459         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
460         (FORWARD3): Define using FORWARD4.
461         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
462         versions.
463         * pt-system.c: Remove duplicate stdlib.h include.
464
465 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
466
467         * sem_init.c: Define sem_init@GLIBC_2.0.
468         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
469         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
470
471         * flockfile.c: Moved to...
472         * sysdeps/pthread/flockfile.c: ...here.  New file.
473         * funlockfile.c: Moved to...
474         * sysdeps/pthread/funlockfile.c: ...here.  New file.
475         * ftrylockfile.c: Moved to...
476         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
477
478 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
479
480         * libc-cancellation.c: Guard both function with
481         #if !defined NOT_IN_libc.
482         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
483         automatically provided pthread wrappers.
484         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
485         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
486         nor in libpthread.
487         * pt-open.c: Removed.
488         * pt-fcntl.c: Removed.
489         * pt-fsync.c: Removed.
490         * pt-lseek.c: Removed.
491         * pt-msgrcv.c: Removed.
492         * pt-msgsnd.c: Removed.
493         * pt-msync.c: Removed.
494         * pt-nanosleep.c: Removed.
495         * pt-open64.c: Removed.
496         * pt-pause.c: Removed.
497         * pt-pread.c: Removed.
498         * pt-pread64.c: Removed.
499         * pt-pwrite.c: Removed.
500         * pt-pwrite64.c: Removed.
501         * pt-read.c: Removed.
502         * pt-recv.c: Removed.
503         * pt-recvfrom.c: Removed.
504         * pt-recvmsg.c: Removed.
505         * pt-send.c: Removed.
506         * pt-sendto.c: Removed.
507         * pt-sigtimedwait.c: Removed.
508         * pt-sigwait.c: Removed.
509         * pt-wait.c: Removed.
510         * pt-waitpid.c: Removed.
511         * pt-write.c: Removed.
512         * pt-accept.c: Removed.
513         * pt-close.c: Removed.
514         * pt-connect.c: Removed.
515         * pt-lseek64.c: Removed.
516         * pt-sendmsg.c: Removed.
517         * pt-tcdrain.c: Removed.
518
519 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
520
521         * init.c (__pthread_initialize_minimal_internal): Renamed from
522         __pthread_initialize_minimal.  Make old name an alias.  This
523         converts a normal relocation into a relative relocation.
524
525         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
526
527         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
528         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
529         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
530         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
531         pt-sigwaitinfo, pt-waitid, and pt-writev.
532         * pt-creat.c: Removed.
533         * pt-poll.c: Removed.
534         * pt-pselect.c: Removed.
535         * pt-readv.c: Removed.
536         * pt-select.c: Removed.
537         * pt-sigpause.c: Removed.
538         * pt-sigsuspend.c: Removed.
539         * pt-sigwaitinfo.c: Removed.
540         * pt-waitid.c: Removed.
541         * pt-writev.c: Removed.
542
543         * init.c (pthread_functions): New variable.
544         (__pthread_initialize_minimal): Pass pointer to pthread_functions
545         (or NULL) to __libc_pthread_init.
546         * forward.c: Rewrite to use __libc:pthread_functions array to get
547         function addresses.
548         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
549         prototype.
550         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
551         Take new parameter.  Copy content of variable pointed to by it
552         to __libc_pthread_init.
553
554         * pthreadP.h (struct pthread_functions): New type.
555         (__libc_pthread_init): Declare.
556
557         * pthread_attr_destroy.c: Add namespace protected alias.
558         * pthread_attr_getdetachstate.c: Likewise.
559         * pthread_attr_getinheritsched.c: Likewise.
560         * pthread_attr_getschedparam.c: Likewise.
561         * pthread_attr_getschedpolicy.c: Likewise.
562         * pthread_attr_getscope.c: Likewise.
563         * pthread_attr_setdetachstate.c: Likewise.
564         * pthread_attr_setinheritsched.c: Likewise.
565         * pthread_attr_setschedparam.c: Likewise.
566         * pthread_attr_setschedpolicy.c: Likewise.
567         * pthread_attr_setscope.c: Likewise.
568         * pthread_cond_broadcast.c: Likewise.
569         * pthread_cond_destroy.c: Likewise.
570         * pthread_cond_init.c: Likewise.
571         * pthread_cond_signal.c: Likewise.
572         * pthread_cond_wait.c: Likewise.
573         * pthread_condattr_destroy.c: Likewise.
574         * pthread_condattr_init.c: Likewise.
575         * pthread_equal.c: Likewise.
576         * pthread_exit.c: Likewise.
577         * pthread_getschedparam.c: Likewise.
578         * pthread_self.c: Likewise.
579         * pthread_setcancelstate.c: Likewise.
580         * pthread_setschedparam.c: Likewise.
581         * pthread_mutex_destroy.c: Likewise.
582         * pthread_mutex_init.c: Likewise.
583         * pthreadP.h: Add prototypes for the aliases.
584
585         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
586         multiple_threads member in correct TCB to 1.
587
588         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
589         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
590         member of thread decriptor, otherwise return unconditionally 1.
591
592 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
593
594         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
595         regular Linux version.  Remove file.
596         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
597         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
598         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
599         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
600         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
601         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
602         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
603         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
604         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
605         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
606         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
607         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
608         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
609         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
610         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
611         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
612         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
613         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
614         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
615         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
616         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
617         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
618         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
619         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
620         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
621         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
622         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
623         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
624         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
625         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
626
627 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
628
629         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
630         * sysdeps/unix/sysv/linux/open.c: Removed.
631         * sysdeps/unix/sysv/linux/fsync.c: Removed.
632         * sysdeps/unix/sysv/linux/lseek.c: Removed.
633         * sysdeps/unix/sysv/linux/msync.c: Removed.
634         * sysdeps/unix/sysv/linux/read.c: Removed.
635         * sysdeps/unix/sysv/linux/close.c: Removed.
636         * sysdeps/unix/sysv/linux/creat.c: Removed.
637         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
638         * sysdeps/unix/sysv/linux/pause.c: Removed.
639         * sysdeps/unix/sysv/linux/select.c: Removed.
640         * sysdeps/unix/sysv/linux/write.c: Removed.
641
642 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
643
644         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
645         element in TCB to see whether locking is needed.
646
647         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
648         MULTIPLE_THREADS_OFFSET value is correct.
649
650         * sysdeps/unix/sysv/linux/close.c: New file.
651         * sysdeps/unix/sysv/linux/connect.S: New file.
652         * sysdeps/unix/sysv/linux/creat.c: New file.
653         * sysdeps/unix/sysv/linux/fsync.c: New file.
654         * sysdeps/unix/sysv/linux/llseek.c: New file.
655         * sysdeps/unix/sysv/linux/lseek.c: New file.
656         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
657         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
658         * sysdeps/unix/sysv/linux/msync.c: New file.
659         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
660         * sysdeps/unix/sysv/linux/open.c: New file.
661         * sysdeps/unix/sysv/linux/open64.c: New file.
662         * sysdeps/unix/sysv/linux/pause.c: New file.
663         * sysdeps/unix/sysv/linux/poll.c: New file.
664         * sysdeps/unix/sysv/linux/pread.c: New file.
665         * sysdeps/unix/sysv/linux/pread64.c: New file.
666         * sysdeps/unix/sysv/linux/pselect.c: New file.
667         * sysdeps/unix/sysv/linux/pwrite.c: New file.
668         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
669         * sysdeps/unix/sysv/linux/readv.c: New file.
670         * sysdeps/unix/sysv/linux/recv.S: New file.
671         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
672         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
673         * sysdeps/unix/sysv/linux/select.c: New file.
674         * sysdeps/unix/sysv/linux/send.S: New file.
675         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
676         * sysdeps/unix/sysv/linux/sendto.S: New file.
677         * sysdeps/unix/sysv/linux/sigpause.c: New file.
678         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
679         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
680         * sysdeps/unix/sysv/linux/sigwait.c: New file.
681         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
682         * sysdeps/unix/sysv/linux/system.c: New file.
683         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
684         * sysdeps/unix/sysv/linux/wait.c: New file.
685         * sysdeps/unix/sysv/linux/waitid.c: New file.
686         * sysdeps/unix/sysv/linux/waitpid.c: New file.
687         * sysdeps/unix/sysv/linux/writev.c: New file.
688         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
689
690         * pt-readv.c: Fix comment.
691
692 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
693
694         * tst-cleanup1.c: Include stdlib.h.
695
696         * tst-cancel5.c: New test.
697         * Makefile (tests): Add tst-cancel5.
698         (tst-cancel5): Link against libc.so libpthread.so in that order.
699
700 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
701
702         * forward.c (test_loaded): Prevent recursive calls.
703
704         * Makefile (routines): Add libc-cancellation.
705         * libc-cancellation.c: New file.
706         * descr.h (struct pthread): Add multiple_threads field.
707         * allocatestack.c (allocate_stack): Initialize multiple_header field of
708         new thread descriptor to 1.
709         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
710         Initialize multiple_thread field after successful thread creation.
711         * cancellation.c (__do_cancel): Move to pthreadP.h.
712         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
713         (__pthread_disable_asynccancel): Add internal_function attribute.
714         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
715         * pthread_setcancelstate.c: Likewise.
716         * pthread_setcanceltype.c: Likewise.
717         * pthread_exit.c: Likewise.
718         * pthreadP.h (CANCELLATION_P): Likewise.
719         (__do_cancel): Define as static inline.
720         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
721         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
722         declarations.
723         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
724         fields.  Define MULTIPLE_THREADS_OFFSET.
725         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
726         declaration.
727         * sysdeps/unix/sysv/linux/accept.S: New file.
728         * sysdeps/unix/sysv/linux/read.c: New file.
729         * sysdeps/unix/sysv/linux/write.c: New file.
730         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
731         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
732         initialization of __libc_locking_needed.
733         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
734         __libc_locking_needed, use multiple_threads field in TCB.
735         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
736
737 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
738
739         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
740         version.
741         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
742
743         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
744         access to __libc_locking_needed for PIC.
745
746 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
747
748         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
749         declare for libc.so.
750         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
751         expression.
752         (__libc_lock_lock): Put into statement expression.
753         (__libc_lock_unlock): Remove trailing semicolon.
754         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
755
756 2002-12-12  Roland McGrath  <roland@redhat.com>
757
758         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
759         "m" constraint to refer to __libc_locking_needed.  Declare it here.
760
761 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
762
763         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
764         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
765         Initialize __libc_locking_needed.
766         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
767         instead of __register_pthread_fork_handler.
768         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
769         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
770         fork-gen with libc_pthread_init.
771         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
772         of __register_pthread_fork_handler.
773         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
774         of __register_pthread_fork_handler.
775         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
776         __libc_locking_needed to determine whether lock prefix can be avoided.
777         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
778
779 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
780
781         * Makefile (tests): Add tst-cleanup1.
782         * tst-cleanup1.c: New file.
783         * cancellation.c (__cleanup_thread): Removed.
784         (__do_cancel): Remove call to __cleanup_thread.
785         * pthreadP.h: Remove __cleanup_thread prorotype.
786
787         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
788         Remember function and argument even if cancellation handler
789         function is not available.
790         (__libc_cleanup_region_end): Execute registered function directly if
791         pthread functions are not available.
792         (__libc_cleanup_end): Likewise.
793
794         * init.c (__pthread_initialize_minimal): Fix initialization in
795         static lib by preventing gcc from being too clever.
796
797 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
798
799         * init.c (__pthread_initialize_minimal): Remove unneccesary
800         sigaddset call.
801
802         * Makefile (tests): We can run tst-locale2 now.
803
804 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
805
806         * Versions: Remove duplicated sigwait entry.
807
808 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
809
810         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
811         inside libpthread.
812
813         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
814
815         * pthreadP.h: Declare __pthread_enable_asynccancel and
816         __pthread_disable_asynccancel.
817         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
818         (CANCEL_RESET): Use __pthread_disable_asynccancel.
819         * cancellation.c (__pthread_enable_asynccancel): New function.
820         (__pthread_disable_asynccancel): New function.
821         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
822         * pt-close.c: Likewise.
823         * pt-connect.c: Likewise.
824         * pt-creat.c: Likewise.
825         * pt-fcntl.c: Likewise.
826         * pt-fsync.c: Likewise.
827         * pt-lseek.c: Likewise.
828         * pt-lseek64.c: Likewise.
829         * pt-msgrcv.c: Likewise.
830         * pt-msgsnd.c: Likewise.
831         * pt-msync.c: Likewise.
832         * pt-nanosleep.c: Likewise.
833         * pt-open.c: Likewise.
834         * pt-open64.c: Likewise.
835         * pt-pause.c: Likewise.
836         * pt-poll.c: Likewise.
837         * pt-pread.c: Likewise.
838         * pt-pread64.c: Likewise.
839         * pt-pselect.c: Likewise.
840         * pt-pwrite.c: Likewise.
841         * pt-pwrite64.c: Likewise.
842         * pt-read.c: Likewise.
843         * pt-readv.c: Likewise.
844         * pt-recv.c: Likewise.
845         * pt-recvfrom.c: Likewise.
846         * pt-recvmsg.c: Likewise.
847         * pt-select.c: Likewise.
848         * pt-send.c: Likewise.
849         * pt-sendmsg.c: Likewise.
850         * pt-sendto.c: Likewise.
851         * pt-sigpause.c: Likewise.
852         * pt-sigsuspend.c: Likewise.
853         * pt-sigtimedwait.c: Likewise.
854         * pt-sigwait.c: Likewise.
855         * pt-sigwaitinfo.c: Likewise.
856         * pt-system.c: Likewise.
857         * pt-tcdrain.c: Likewise.
858         * pt-wait.c: Likewise.
859         * pt-waitid.c: Likewise.
860         * pt-waitpid.c: Likewise.
861         * pt-write.c: Likewise.
862         * pt-writev.c: Likewise.
863         * pthread_join.c: Likewise.
864         * pthread_timedjoin.c: Likewise.
865
866         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
867         (__xpg_sigpause): New function.
868         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
869
870 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
871
872         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
873
874         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
875         _GI_pthread_cleanup_pop to pthreadP.h.
876
877         * ftrylockfile.c: Use _IO_lock_trylock instead of
878         pthread_mutex_trylock.
879
880         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
881         (CANCEL_RESET): Likewise.
882         (__pthread_setcanceltype_): Declare.
883         (__pthread_mutex_lock_internal): Declare.
884         (__pthread_mutex_unlock_internal): Declare.
885         (__pthread_once_internal): Declare.
886         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
887         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
888
889         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
890         and pthread_mutex_unlock.
891         * pthread_cond_wait.c: Likewise.
892         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
893         * pthread_mutex_unlock.c: Likewise.
894
895         * pthread_setcanceltype.c: Add additional alias
896         __pthread_setcanceltype.
897
898         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
899         * sem_open.c (sem_open): Likewise.
900         Use __libc_open, __libc_write, and __libc_close instead of
901         open, write, and close respectively.
902
903         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
904         Rewrite as statement expression since it must return a value.
905
906         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
907         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
908         __pthread_kill.
909
910         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
911         alias __pthread_once_internal.
912
913         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
914
915 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
916
917         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
918         * tst-stdio1.c: New file.
919         * tst-stdio2.c: New file.
920
921         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
922
923         * Makefile (tests): Comment out tst-locale2 for now.
924         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
925
926         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
927         -D_IO_MTSAFE_IO.
928         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
929         Use _IO_lock_init instead of explicit assignment.
930
931         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
932         Define __libc_lock_* and __libc_lock_recursive macros with
933         lowlevellock macros, not pthread mutexes.
934
935         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
936         of pthread_mutex_lock.
937         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
938         instead of pthread_mutex_unlock.
939
940 2002-12-06  Roland McGrath  <roland@redhat.com>
941
942         * allocatestack.c (__stack_user): Use uninitialized defn.
943         * init.c (__pthread_initialize_minimal): Initialize it here.
944
945 2002-12-05  Roland McGrath  <roland@redhat.com>
946
947         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
948         string.
949         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
950
951         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
952         missing & here too.
953
954 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
955
956         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
957         lowlevellock.
958         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
959         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
960         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
961         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
962         for __libc_lock_* macros.
963         * Makefile (routines): Add libc-lowlevellock.
964
965 2002-10-09  Roland McGrath  <roland@redhat.com>
966
967         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
968         Under [__PIC__], call the function via the pointer fetched for
969         comparison rather than a call by name that uses the PLT.
970         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
971         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
972         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
973         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
974         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
975
976 2002-12-04  Roland McGrath  <roland@redhat.com>
977
978         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
979
980         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
981         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
982
983         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
984
985 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
986
987         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
988         a completely opaque, non-integer type.
989         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
990
991 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
992
993         * sysdeps/i386/tls.h: Include stdlib.h.
994         * sysdeps/x86_64/tls.h: Likewise.
995
996 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
997
998         * Makefile (tests): Add tst-locale2.
999         (tests-static): Likewise.
1000         * tst-locale2.c: New file.
1001
1002         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
1003         volatile and add memory clobbers to lock operations.
1004
1005 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
1006
1007         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
1008         * sysdeps/i386/i486/bits/atomic.h: New file.
1009         * sysdeps/i386/i586/bits/atomic.h: New file.
1010         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
1011         include i486 version.
1012         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
1013         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
1014         Patch by Marijn Ros <marijn@mad.scientist.com>.
1015
1016         * allocatestack.c (get_cached_stack): Don't crash if we first
1017         found a stack with a larger size then needed.
1018         Reported by Hui Huang <hui.huang@sun.com>.
1019
1020         * Makefile (tests): Add tst-sysconf.
1021         * tst-sysconf.c: New file.
1022
1023         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
1024         PTHREAD_THREADS_MAX.
1025
1026 2002-12-02  Roland McGrath  <roland@redhat.com>
1027
1028         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
1029         Declare using hidden_proto instead of attribute_hidden, so there are
1030         non-.hidden static symbols for gdb to find.
1031         (__pthread_keys): Likewise.
1032         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
1033         * allocatestack.c (__stack_user): Likewise.
1034         * pthread_create.c (__pthread_keys): Likewise.
1035         (__nptl_threads_events, __nptl_last_event): Make these static instead
1036         of hidden.
1037         * pthread_key_create.c (__pthread_pthread_keys_max,
1038         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
1039
1040 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
1041
1042         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
1043         statically.
1044         * tst-locale1.c: New file.
1045
1046         * pthread_cond_timedwait.c: Include <stdlib.h>.
1047
1048         * Makefile (tests): Add tst-fork2 and tst-fork3.
1049         * tst-fork2.c: New file.
1050         * tst-fork3.c: New file.
1051
1052 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
1053
1054         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
1055
1056         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
1057         require it to 200112L.
1058
1059         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
1060         instruction only if HAVE_CMOV is defined.
1061         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
1062
1063         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
1064
1065         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
1066
1067         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
1068
1069         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
1070
1071 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
1072
1073         * sysdeps/x86_64/bits/atomic.h: New file.
1074
1075         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
1076         16-bit operations.
1077
1078         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
1079         possible since gettid cannot fail.
1080
1081         * sysdeps/x86_64/pthreaddef.h: New file.
1082
1083         * sysdeps/i386/pthreaddef.h (gettid): Removed.
1084
1085         * sysdeps/x86_64/pthread_spin_init.c: New file.
1086         * sysdeps/x86_64/pthread_spin_lock.c: New file.
1087         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
1088         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
1089
1090         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
1091         Add missing lock prefix.  Minute optimization.
1092
1093         * tst-spin2.c (main): Also check successful trylock call.
1094
1095         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
1096         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
1097
1098         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
1099         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
1100
1101         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
1102         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
1103         value in case of an error.  Add support for INTERNAL_SYSCALL.
1104
1105         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
1106         value in case of an error.
1107
1108         * sysdeps/x86_64/tls.h: New file.
1109
1110 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
1111
1112         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
1113         takes the array member name and the index as parameters.
1114         (THREAD_SETMEM_NC): Likewise.
1115         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
1116         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
1117         interfaces.
1118
1119         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
1120         to decide which code to use.
1121         (THREAD_SETMEM_NC): Likewise.
1122
1123         * allocatestack.c (queue_stack): Don't remove stack from list here.
1124         Do it in the caller.  Correct condition to prematurely terminate
1125         loop to free stacks.
1126         (__deallocate_stack): Remove stack from list here.
1127
1128 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
1129
1130         * Makefile (tests): Add tst-stack1.
1131         * tst-stack1.c: New file.
1132
1133         * allocatestack.c (allocate_stack): Initialize the TCB on a user
1134         provided stack.
1135
1136         * pthread_attr_getstack.c: Return bottom of the thread area.
1137
1138 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
1139
1140         * Makefile (libpthread-routines): Add pt-allocrtsig and
1141         pthread_kill_other_threads.
1142         * pt-allocrtsig.c: New file.
1143         * pthread_kill_other_threads.c: New file.
1144         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
1145         all three functions.
1146         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
1147         allocrtsig.
1148         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
1149         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
1150         and __libc_allocate_rtsig_private.
1151         * Versions (libpthread): Export pthread_kill_other_threads_np,
1152         __libc_current_sigrtmin, and __libc_current_sigrtmax.
1153
1154 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
1155
1156         * allocatestack.c (allocate_stack): stackaddr in attribute points to
1157         the end of the stack.  Adjust computations.
1158         When mprotect call fails dequeue stack and free it.
1159         * pthread_attr_setstack.c: Store top of the stack in stackaddr
1160         attribute.
1161         * pthread_getattr_np.c: Likewise.
1162
1163         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
1164         surprises.
1165
1166 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
1167
1168         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
1169         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
1170
1171 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
1172
1173         * pthread_getspecific.c: Optimize access to first 2nd-level array.
1174         * pthread_setspecific.c: Likewise.
1175
1176 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
1177
1178         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
1179         definitions.  Get them from the official place.
1180         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
1181
1182         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
1183         Use new CLONE_ flags in clone() calls.
1184
1185         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
1186         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
1187
1188         * Versions: Add pthread_* functions for libc.
1189         * forward.c: New file.
1190
1191         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
1192         errno-loc.
1193         * herrno.c: New file.
1194         * res.c: New file.
1195
1196         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
1197         sem_trywait, and sem_timedwait.  Add herrno and res.
1198         * sem_init.c: Don't initialize lock and waiters members.
1199         * sem_open.c: Likewise.
1200         * sem_post.c: Removed.
1201         * sem_wait.c: Removed.
1202         * sem_trywait.c: Removed.
1203         * sem_timedwait.c: Removed.
1204         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
1205         Includes full implementations of sem_post, sem_wait, sem_trywait,
1206         and sem_timedwait.
1207         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
1208         for new implementation.
1209         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
1210         and waiters fields.
1211
1212         * tst-sem3.c: Improve error message.
1213         * tst-signal3.c: Likewise.
1214
1215         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
1216         to tell the kernel about the termination futex and to initialize tid
1217         member.  Don't initialize main_thread.
1218         * descr.h (struct pthread): Remove main_thread member.
1219         * cancelllation.c (__do_cancel): Remove code handling main thread.
1220         The main thread is not special anymore.
1221
1222         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
1223         size of the stacks to stack_cache_actsize.
1224
1225         * pt-readv.c: Add missing "defined".
1226         * pt-sigwait.c: Likewise.
1227         * pt-writev.c: Likewise.
1228
1229 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
1230
1231         * Versions: Export __connect from libpthread.
1232         Patch by Luca Barbieri <ldb@ldb.ods.org>.
1233
1234         * Makefile (libpthread-routines): Add pt-raise.
1235         * sysdeps/unix/sysv/linux/raise.c: New file.
1236         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
1237         * sysdeps/generic/pt-raise.c: New file.
1238
1239         * pthread_cond_init.c: Initialize all data elements of the condvar
1240         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
1241
1242         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
1243         * pthread_create.c: Likewise.
1244
1245         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
1246         * tst-key1.c: New file.
1247         * tst-key2.c: New file.
1248         * tst-key3.c: New file.
1249
1250         * Versions: Export pthread_detach for version GLIBC_2.0.
1251         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
1252
1253 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
1254
1255         * pthread_key_create.c: Terminate search after an unused key was found.
1256         Patch by Luca Barbieri <ldb@ldb.ods.org>.
1257
1258         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
1259         Patch by Luca Barbieri <ldb@ldb.ods.org>.
1260
1261 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
1262
1263         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
1264         dynamic lookup for errno in PIC.
1265
1266         * allocatestack.c (get_cached_stack): Rearrange code slightly to
1267         release the stack lock as soon as possible.
1268         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
1269         the static TLS block.
1270         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
1271
1272         * cancellation.c: Renamed from cancelation.c.
1273         * Makefile: Adjust accordingly.
1274         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
1275         * cleanup_defer.c: Use CANCELLATION_P.
1276         * pthread_testcancel.c: Likewise.
1277         * descr.h: Fix spelling in comments.
1278         * init.c: Likewise.
1279         * pthread_getattr_np.c: Likewise.
1280         * pthread_getschedparam.c: Likewise.
1281         * pthread_setschedparam.c: Likewise.
1282         * Versions: Likewise.
1283
1284         * pt-pselect.c: New file.
1285         * Makefile (libpthread-routines): Add pt-pselect.
1286         * Versions: Add pselect.
1287
1288         * tst-cancel4.c: New file.
1289         * Makefile (tests): Add tst-cancel4.
1290
1291 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
1292
1293         * pthread_mutex_lock.c: Always record lock ownership.
1294         * pthread_mutex_timedlock.c: Likewise.
1295         * pthread_mutex_trylock.c: Likewise.
1296
1297         * pt-readv.c: New file.
1298         * pt-writev.c: New file.
1299         * pt-creat.c: New file.
1300         * pt-msgrcv.c: New file.
1301         * pt-msgsnd.c: New file.
1302         * pt-poll.c: New file.
1303         * pt-select.c: New file.
1304         * pt-sigpause.c: New file.
1305         * pt-sigsuspend.c: New file.
1306         * pt-sigwait.c: New file.
1307         * pt-sigwaitinfo.c: New file.
1308         * pt-waitid.c: New file.
1309         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
1310         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
1311         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
1312         * Versions: Add all the new functions.
1313
1314         * tst-exit1.c: New file.
1315         * Makefile (tests): Add tst-exit1.
1316
1317         * sem_timedwait.c: Minor optimization for more optimal fastpath.
1318
1319 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
1320
1321         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
1322
1323         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
1324         call.  pthread_join is an official cancellation point.
1325         * pthread_timedjoin.c: Likewise.
1326
1327         * pthread_cond_wait.c: Revert order in which internal lock are dropped
1328         and the condvar's mutex are retrieved.
1329         * pthread_cond_timedwait.c: Likewise.
1330         Reported by dice@saros.East.Sun.COM.
1331
1332 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
1333
1334         * pthreadP.h: Cut out all type definitions and move them...
1335         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
1336         * pthreadP.h: Include <internaltypes.h>.
1337
1338         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
1339         performance tweaks.
1340
1341         * sem_trywait.c: Shuffle #includes around to get right order.
1342         * sem_timedwait.c: Likewise.
1343         * sem_post.c: Likewise.
1344         * sem_wait.c: Likewise.
1345
1346         * nptl 0.3 released.
1347
1348         * Makefile (tests): Add tst-signal3.
1349         * tst-signal3.c: New file.
1350
1351 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
1352
1353         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
1354         the asms modify the sem object.
1355         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
1356
1357         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
1358         the actual members.
1359         * pthreadP.h (struct sem): New type.  Actual semaphore type.
1360         * semaphoreP.h: Include pthreadP.h.
1361         * sem_getvalue.c: Adjust to sem_t change.
1362         * sem_init.c: Likewise.
1363         * sem_open.c: Likewise.
1364         * sem_post.c: Likewise.
1365         * sem_timedwait.c: Likewise.
1366         * sem_trywait.c: Likewise.
1367         * sem_wait.c: Likewise.
1368
1369 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
1370
1371         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
1372         * tst-basic2.c: New file.
1373         * tst-exec1.c: New file.
1374         * tst-exec2.c: New file.
1375         * tst-exec3.c: New file.
1376
1377         * tst-fork1.c: Remove extra */.
1378
1379         * nptl 0.2 released.  The API for IA-32 is complete.