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