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