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