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