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