[BZ #2978]
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2
3         * sysdeps/pthread/gai_misc.h: New file.
4
5 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
6
7         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
8         file.  Don't use sysctl.
9         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
10         overwrite the file if this is likely not true.
11
12 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
13
14         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
15         * Makefile (tests): Add tst-getpid3.
16         * tst-getpid3.c: New file.
17
18 2006-07-30  Roland McGrath  <roland@redhat.com>
19
20         * Makefile (libpthread-routines): Add ptw-sigsuspend.
21
22         * sysdeps/unix/sysv/linux/i386/not-cancel.h
23         (pause_not_cancel): New macro.
24         (nanosleep_not_cancel): New macro.
25         (sigsuspend_not_cancel): New macro.
26         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
27         nanosleep_not_cancel macro from <not-cancel.h>.
28         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
29         macro from <not-cancel.h>.
30
31 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
32             Jakub Jelinek  <jakub@redhat.com>
33
34         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
35         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
36         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
37         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
38         * pthread_mutex_init.c: Add support for priority inheritance mutex.
39         * pthread_mutex_lock.c: Likewise.
40         * pthread_mutex_timedlock.c: Likewise.
41         * pthread_mutex_trylock.c: Likewise.
42         * pthread_mutex_unlock.c: Likewise.
43         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
44         all mutexes.
45         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
46         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
47         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
48         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
49         pthread-pi-defines.sym.
50         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
51         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
52         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
53         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
54         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
55         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
56         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
57         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
58         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
59         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
60         _POSIX_THREAD_PRIO_INHERIT to 200112L.
61         * tst-mutex1.c: Adjust to allow use in PI mutex test.
62         * tst-mutex2.c: Likewise.
63         * tst-mutex3.c: Likewise.
64         * tst-mutex4.c: Likewise.
65         * tst-mutex5.c: Likewise.
66         * tst-mutex6.c: Likewise.
67         * tst-mutex7.c: Likewise.
68         * tst-mutex7a.c: Likewise.
69         * tst-mutex8.c: Likewise.
70         * tst-mutex9.c: Likewise.
71         * tst-robust1.c: Likewise.
72         * tst-robust7.c: Likewise.
73         * tst-robust8.c: Likewise.
74         * tst-mutexpi1.c: New file.
75         * tst-mutexpi2.c: New file.
76         * tst-mutexpi3.c: New file.
77         * tst-mutexpi4.c: New file.
78         * tst-mutexpi5.c: New file.
79         * tst-mutexpi6.c: New file.
80         * tst-mutexpi7.c: New file.
81         * tst-mutexpi7a.c: New file.
82         * tst-mutexpi8.c: New file.
83         * tst-mutexpi9.c: New file.
84         * tst-robust1.c: New file.
85         * tst-robust2.c: New file.
86         * tst-robust3.c: New file.
87         * tst-robust4.c: New file.
88         * tst-robust5.c: New file.
89         * tst-robust6.c: New file.
90         * tst-robust7.c: New file.
91         * tst-robust8.c: New file.
92         * Makefile (tests): Add the new tests.
93
94         * pthread_create.c (start_thread): Add some casts to avoid warnings.
95         * pthread_mutex_destroy.c: Remove unneeded label.
96
97 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
98
99         * pthread_mutex_init.c (__pthread_mutex_init): Move some
100         computations to compile time.
101
102 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
103
104         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
105
106 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
107
108         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
109
110 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
111
112         * pthread_key_create.c (__pthread_key_create): Do away with
113         __pthread_keys_lock.
114
115         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
116         (__kernel_cpumask_size): Mark as hidden.
117         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
118
119         * sem_open.c (__sem_mappings_lock): Mark as hidden.
120         * semaphoreP.h (__sem_mappings_lock): Likewise.
121
122 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
123
124         * pthread_atfork.c: Mark __dso_handle as hidden.
125
126 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
127
128         [BZ #2644]
129         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
130         the reload problem.  Change the one path in pthread_cancel_init
131         which causes the problem.  Force gcc to reload.  Simplify callers.
132         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
133         (_Unwind_GetBSP): Undo last patch.
134
135 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
136
137         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
138         function pointer is reloaded after pthread_cancel_init calls.
139
140         [BZ #2644]
141         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
142         pointers are reloaded after pthread_cancel_init calls.
143
144 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
145
146         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
147         __always_inline.
148
149 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
150
151         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
152         Allocate new object which is passed to timer_sigev_thread so that
153         the timer can be deleted before the new thread is scheduled.
154
155 2006-04-26  Roland McGrath  <roland@redhat.com>
156
157         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
158
159 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
160
161         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
162         suffix for conditional jumps.
163         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
164         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
165         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
166         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
167         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
168         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
169
170         * init.c (sigcancel_handler): Compare with correct PID even if the
171         thread is in the middle of a fork call.
172         (sighandler_setxid): Likewise.
173         Reported by Suzuki K P <suzuki@in.ibm.com> .
174
175 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
176
177         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
178
179 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
180
181         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
182         fails [Coverity CID 105].
183
184 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
185
186         * sysdeps/pthread/pthread.h: Add nonnull attributes.
187
188 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
189
190         [BZ #2505]
191         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
192         Define __lll_rel_instr using lwsync.
193
194 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
195
196         * allocatestack.c (allocate_stack): Always initialize robust_head.
197         * descr.h: Define struct robust_list_head.
198         (struct pthread): Use robust_list_head in robust mutex list definition.
199         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
200         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
201         (__pthread_initialize_minimal_internal): Register robust_list with
202         the kernel.
203         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
204         Declare __set_robust_list_avail.
205         * pthread_create.c (start_thread): Register robust_list of new thread.
206         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
207         waiters.
208         * pthread_mutex_destroy.c: For robust mutexes don't look at the
209         number of users, it's unreliable.
210         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
211         set_robust_list syscall is available.
212         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
213         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
214         Set robust_head.list_op_pending before trying to lock a robust mutex.
215         * pthread_mutex_timedlock.c: Likewise.
216         * pthread_mutex_trylock.c: Likewise.
217         * pthread_mutex_unlock.c: Likewise for unlocking.
218         * Makefile (tests): Add tst-robust8.
219         * tst-robust8.c: New file.
220
221 2006-03-08  Andreas Schwab  <schwab@suse.de>
222
223         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
224         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
225
226 2006-03-05  Roland McGrath  <roland@redhat.com>
227
228         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
229         and $config_os doesn't match *linux*.
230
231 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
232
233         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
234         Use __syscall_error.
235         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
236         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
237         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
238         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
239         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
240         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
241
242 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
243
244         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
245
246 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
247
248         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
249         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
250         mutex.
251         (__lll_robust_timedlock_wait): Likewise.
252         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
253         (__lll_robust_lock_wait): Likewise.
254         (__lll_robust_timedlock_wait): Likewise.
255         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
256         (__lll_robust_lock_wait): Likewise.
257         (__lll_robust_timedlock_wait): Likewise.
258
259 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
260
261         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
262         lll_robust_mutex_trylock, lll_robust_mutex_lock,
263         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
264         lll_robust_mutex_unlock): Define.
265         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
266
267 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
268
269         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
270         instead of <clone.S>.
271
272 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
273
274         * Makefile (libpthread-routines): Add
275         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
276         and pthread_mutex_[sg]etprioceiling.
277         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
278         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
279         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
280         pthread_mutex_setprioceiling.
281         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
282         PTHREAD_PRIO_PROTECT): New enum values.
283         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
284         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
285         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
286         prototypes.
287         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
288         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
289         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
290         Define.
291         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
292         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
293         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
294         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
295         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
296         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
297         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
298         protocol mutexes.
299         * pthread_mutex_getprioceiling.c: New file.
300         * pthread_mutex_setprioceiling.c: New file.
301         * pthread_mutexattr_getprioceiling.c: New file.
302         * pthread_mutexattr_setprioceiling.c: New file.
303         * pthread_mutexattr_getprotocol.c: New file.
304         * pthread_mutexattr_setprotocol.c: New file.
305
306 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
307
308         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
309
310 2006-02-27  Roland McGrath  <roland@redhat.com>
311
312         * sysdeps/pthread/Subdirs: List nptl here too.
313         * configure (libc_add_on_canonical): New variable.
314
315         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
316
317         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
318         self to get main source tree's file.
319         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
320         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
321         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
322         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
323         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
324         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
325         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
326         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
327         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
328         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
329         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
330         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
331         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
332
333         * Makefile: Use $(sysdirs) in vpath directive.
334
335         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
336         (CPPFLAGS-timer_routines.c): Likewise.
337
338         * Makeconfig (includes): Variable removed.
339
340 2006-02-26  Roland McGrath  <roland@redhat.com>
341
342         * sysdeps/generic/pt-raise.c: Moved to ...
343         * pt-raise.c: ... here.
344         * sysdeps/generic/lowlevellock.h: Moved to ...
345         * lowlevellock.h: ... here.
346
347 2006-02-23  Roland McGrath  <roland@redhat.com>
348
349         * descr.h (struct pthread): Add final member `end_padding'.
350         (PTHREAD_STRUCT_END_PADDING): Use it.
351
352 2006-02-20  Roland McGrath  <roland@redhat.com>
353
354         * sysdeps/mips: Directory removed, saved in ports repository.
355         * sysdeps/unix/sysv/linux/mips: Likewise.
356
357 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
358
359         * tst-robust1.c: Add second mutex to check that the mutex list is
360         handled correctly.
361
362 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
363
364         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
365         lll_robust_mutex_trylock, lll_robust_mutex_lock,
366         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
367         lll_robust_mutex_unlock): New macros.
368         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
369         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
370         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
371         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
372         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
373
374 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
375
376         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
377         definitions.
378         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
379
380 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
381
382         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
383         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
384         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
385         (lll_robust_mutex_unlock): Likewise.
386
387 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
388
389         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
390         Set robust_list.__next rather than robust_list.
391         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
392         (__pthread_list_t): New typedef.
393         (pthread_mutex_t): Replace __next and __prev fields with __list.
394         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
395         (__pthread_list_t): New typedef.
396         (pthread_mutex_t): Replace __next and __prev fields with __list.
397         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
398         (__pthread_list_t, __pthread_slist_t): New typedefs.
399         (pthread_mutex_t): Replace __next and __prev fields with __list.
400         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
401         (__pthread_list_t, __pthread_slist_t): New typedefs.
402         (pthread_mutex_t): Replace __next and __prev fields with __list.
403         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
404         (__pthread_list_t, __pthread_slist_t): New typedefs.
405         (pthread_mutex_t): Replace __next and __prev fields with __list.
406         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
407         (__pthread_slist_t): New typedef.
408         (pthread_mutex_t): Replace __next field with __list.
409
410 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
411
412         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
413         PTHREAD_MUTEX_OWNERDEAD.
414         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
415         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
416         * Makefile (libpthread-routines): Add lowlevelrobustlock.
417         * pthread_create.c (start_thread): Very much simplify robust_list loop.
418         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
419         to PTHREAD_MUTEX_INCONSISTENT.
420         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
421         * pthread_mutex_lock.c: Reimplement robust mutex handling.
422         * pthread_mutex_trylock.c: Likewise.
423         * pthread_mutex_timedlock.c: Likewise.
424         * pthread_mutex_unlock.c: Likewise.
425         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
426         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
427         lowlevelrobustlock.sym.
428         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
429         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
430         definitions.
431         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
432         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
433         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
434         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
435         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
436
437 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
438
439         * allocatestack.c (allocate_stack): Initialize robust_list.
440         * init.c (__pthread_initialize_minimal_internal): Likewise.
441         * descr.h (struct xid_command): Pretty printing.
442         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
443         robust_list.  Adjust macros.
444         * pthread_create.c (start_thread): Adjust robust_list handling.
445         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
446         but the owner for all robust mutex types.
447         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
448         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
449         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
450         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
451
452         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
453         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
454
455 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
456
457         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
458         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
459
460 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
461
462         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
463         Return status.
464         (lll_futex_timed_wait): Define.
465
466 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
467
468         * tst-cancel4.c: Test ppoll.
469
470 2006-01-18  Andreas Jaeger  <aj@suse.de>
471
472         [BZ #2167]
473         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
474         (pthread_mutex_t): Follow changes for other archs.  Based on patch
475         by Jim Gifford <patches@jg555.com>.
476
477 2006-01-13  Richard Henderson  <rth@redhat.com>
478
479         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
480
481 2006-01-10  Roland McGrath  <roland@redhat.com>
482
483         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
484         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
485         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
486         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
487         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
488         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
489         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
490         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
491         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
492         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
493
494 2006-01-09  Roland McGrath  <roland@redhat.com>
495
496         * tst-initializers1-c89.c: New file.
497         * tst-initializers1-c99.c: New file.
498         * tst-initializers1-gnu89.c: New file.
499         * tst-initializers1-gnu99.c: New file.
500         * Makefile (tests): Add them.
501         (CFLAGS-tst-initializers1-c89.c): New variable.
502         (CFLAGS-tst-initializers1-c99.c): New variable.
503         (CFLAGS-tst-initializers1-gnu89.c): New variable.
504         (CFLAGS-tst-initializers1-gnu99.c): New variable.
505
506         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
507         Use __extension__ on anonymous union definition.
508         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
509         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
510         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
511         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
512         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
513
514 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
515
516         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
517         Don't give the union a name because it changes the mangled name.
518         Instead name the struct for __data.
519         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
520         Likewise.
521         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
522         Likewise.
523
524 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
525
526         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
527         stack bias to mc_ftp field.
528
529 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
530
531         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
532         being too clever and reloading the futex value where it shouldn't.
533
534 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
535
536         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
537         correct type.
538
539 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
540
541         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
542         Add cfi directives.
543
544 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
545
546         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
547         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
548         rename in tcbhead_t.
549
550         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
551         Don't give the union a name because it changes the mangled name.
552         Instead name the struct for __data.
553         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
554         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
555         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
556         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
557         * pthread_create.c (start_thread): Adjust robust mutex free loop.
558         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
559
560 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
561
562         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
563         Return status.
564         (lll_futex_timed_wait): Define.
565         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
566         * sysdeps/pthread/aio_misc.h: New file.
567
568 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
569
570         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
571
572 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
573
574         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
575         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
576         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
577
578 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
579
580         * tst-cancel24.cc: Use C headers instead of C++ headers.
581
582 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
583
584         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
585         sparc-linux configured glibc.
586         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
587         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
588         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
589         atomic_compare_and_exchange_val_24_acq instead of
590         atomic_compare_and_exchange_val_acq.
591         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
592         instead of atomic_exchange_rel.
593         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
594         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
595         file.
596         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
597         file.
598         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
599         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
600         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
601         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
602         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
603         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
604         New file.
605         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
606         New file.
607         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
608         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
609         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
610         file.
611         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
612         file.
613         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
614
615 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
616
617         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
618         mutex initializers.
619
620 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
621
622         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
623         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
624         THREAD_COPY_POINTER_GUARD): Define.
625         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
626         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
627
628 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
629
630         * version.c: Update copyright year.
631
632 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
633
634         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
635         .eh_frame section, use cfi_* directives.
636         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
637
638 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
639
640         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
641         now.
642
643 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
644
645         * sysdeps/pthread/sigaction.c: Removed.
646         * sigaction.c: New file.
647         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
648
649 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
650
651         * Makefile (tests): Add tst-signal7.
652         * tst-signal7.c: New file.
653
654 2005-12-27  Roland McGrath  <roland@redhat.com>
655
656         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
657         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
658         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
659         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
660         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
661         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
662         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
663         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
664         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
665         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
666         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
667
668 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
669
670         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
671         and __prev field to pthread_mutex_t.
672         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
673         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
674         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
675         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
676         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
677         to pthread_mutex_t.
678
679 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
680
681         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
682         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
683         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
684         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
685         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
686         and PTHREAD_MUTEXATTR_FLAG_BITS.
687         * descr.h (struct pthread): Add robust_list field and define
688         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
689         * pthread_mutexattr_getrobust.c: New file.
690         * pthread_mutexattr_setrobust.c: New file.
691         * pthread_mutex_consistent.c: New file.
692         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
693         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
694         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
695         Adjust pthread_mutex_t initializers.
696         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
697         field to pthread_mutex_t.
698         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
699         and __prev field to pthread_mutex_t.
700         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
701         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
702         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
703         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
704         * pthread_mutexattr_gettype.c: Likewise.
705         * pthread_mutexattr_setpshared.c: Likewise.
706         * pthread_mutexattr_settype.c: Likewise.
707         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
708         Initialize mutex kind according to robust flag.
709         * pthread_mutex_lock.c: Implement local robust mutex.
710         * pthread_mutex_timedlock.c: Likewise.
711         * pthread_mutex_trylock.c: Likewise.
712         * pthread_mutex_unlock.c: Likewise.
713         * pthread_create.c (start_thread): Mark robust mutexes which remained
714         locked as dead.
715         * tst-robust1.c: New file.
716         * tst-robust2.c: New file.
717         * tst-robust3.c: New file.
718         * tst-robust4.c: New file.
719         * tst-robust5.c: New file.
720         * tst-robust6.c: New file.
721         * tst-robust7.c: New file.
722         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
723         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
724         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
725         tst-robust5, tst-robust6, and tst-robust7.
726
727         * tst-typesizes.c: New file.
728         * Makefile (tests): Add tst-typesizes.
729
730         * tst-once3.c: More debug output.
731
732 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
733
734         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
735         missing after last change.
736
737         * version.c: Update copyright year.
738
739 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
740
741         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
742         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
743         * pthread_mutex_trylock.c: Likewise.
744         * pthread_mutex_timedlock.c: Likewise.
745         * pthread_mutex_unlock.c: Likewise.
746
747 2005-12-22  Roland McGrath  <roland@redhat.com>
748
749         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
750         so that #include_next's search location is not reset to the -I..
751         directory where <nptl/...> can be found.
752
753 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
754
755         [BZ #1913]
756         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
757         Fix unwind info.  Remove useless branch prediction prefix.
758         * tst-cancel24.cc: New file.
759         * Makefile: Add rules to build and run tst-cancel24.
760
761 2005-12-21  Roland McGrath  <roland@redhat.com>
762
763         * libc-cancellation.c: Use <> rather than "" #includes.
764         * pt-cleanup.c: Likewise.
765         * pthread_create.c: Likewise.
766         * pthread_join.c: Likewise.
767         * pthread_timedjoin.c: Likewise.
768         * pthread_tryjoin.c: Likewise.
769         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
770         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
771         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
772         * unwind.c: Likewise.
773
774 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
775
776         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
777         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
778         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
779         THREAD_COPY_POINTER_GUARD): Define.
780
781 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
782
783         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
784         rather than one.
785         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
786         THREAD_COPY_POINTER_GUARD): Define.
787         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
788         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
789         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
790         THREAD_COPY_POINTER_GUARD): Define.
791         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
792         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
793         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
794         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
795         Use PTR_DEMANGLE for B0 if defined.
796
797 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
798
799         * pthread_create.c (__pthread_create_2_1): Use
800         THREAD_COPY_POINTER_GUARD if available.
801         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
802         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
803         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
804         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
805         * sysdeps/x86_64/tls.h: Likewise.
806
807 2005-12-15  Roland McGrath  <roland@redhat.com>
808
809         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
810
811 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
812
813         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
814         sysdeps/generic.
815         * errno-loc.c: New file.
816
817 2005-12-12  Roland McGrath  <roland@redhat.com>
818
819         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
820         adjustments before choosing stack size.  Update minimum stack size
821         calculation to match allocate_stack change.
822
823 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
824
825         * allocatestack.c (allocate_stack): Don't demand that there is an
826         additional full page available on the stack beside guard, TLS, the
827         minimum stack.
828
829 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
830
831         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
832         (__cleanup_fct_attribute): Use __regparm__ not regparm.
833
834         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
835         compiling 32-bit code we must define __cleanup_fct_attribute.
836
837 005-11-24  Jakub Jelinek  <jakub@redhat.com>
838
839         [BZ #1920]
840         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
841         __attribute__ instead of __attribute.
842         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
843         (__cleanup_fct_attribute): Likewise.
844
845 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
846
847         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
848         a write barrier before writing libgcc_s_getcfa.
849
850 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
851
852         * sysdeps/unix/sysv/linux/configure: Removed.
853
854 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
855
856         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
857         optional init_array/fini_array support.
858
859 2005-10-24  Roland McGrath  <roland@redhat.com>
860
861         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
862         versioned_symbol use.
863
864 2005-10-16  Roland McGrath  <roland@redhat.com>
865
866         * init.c (__pthread_initialize_minimal_internal): Even when using a
867         compile-time default stack size, apply the minimum that allocate_stack
868         will require, and round up to page size.
869
870 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
871
872         * Makefile ($(test-modules)): Remove static pattern rule.
873
874 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
875             Ulrich Drepper  <drepper@redhat.com>
876
877         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
878         alignment in callback function.
879         * Makefile: Add rules to build and run tst-align3.
880         * tst-align3.c: New file.
881
882 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
883
884         * allocatestack.c (setxid_signal_thread): Add
885         INTERNAL_SYSCALL_DECL (err).
886
887 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
888
889         * allocatestack.c (setxid_signal_thread): Need to use
890         atomic_compare_and_exchange_bool_acq.
891
892 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
893             Jakub Jelinek  <jakub@redhat.com>
894
895         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
896         CANCEL_RESTMASK.
897         (struct pthread): Move specific_used field to avoid padding.
898         Add setxid_futex field.
899         * init.c (sighandler_setxid): Reset setxid flag and release the
900         setxid futex.
901         * allocatestack.c (setxid_signal_thread): New function.  Broken
902         out of the bodies of the two loops in __nptl_setxid.  For undetached
903         threads check whether they are exiting and if yes, don't send a signal.
904         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
905         * pthread_create.c (start_thread): For undetached threads, check
906         whether setxid bit is set.  If yes, wait until signal has been
907         processed.
908
909         * allocatestack.c (STACK_VARIABLES): Initialize them.
910         * pthread_create.c (__pthread_create_2_1): Initialize pd.
911
912 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
913
914         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
915         waiters, awake all waiters on the associated mutex.
916
917 2005-09-22  Roland McGrath  <roland@redhat.com>
918
919         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
920         ../sysdeps/x86_64/hp-timing.h).
921
922 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
923
924         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
925         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
926         (lll_futex_wake_unlock): Define.
927         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
928         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
929         (lll_futex_wake_unlock): Define.
930         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
931         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
932         (lll_futex_wake_unlock): Define.
933         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
934         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
935         (lll_futex_wake_unlock): Define.
936         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
937         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
938         (lll_futex_wake_unlock): Define.
939         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
940         lll_futex_wake_unlock.
941         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
942         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
943         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
944         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
945         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
946         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
947
948 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
949
950         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
951         Fix typo in register name.
952
953 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
954
955         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
956         Use __sigfillset.  Document that sigfillset does the right thing wrt
957         to SIGSETXID.
958
959 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
960
961         [BZ #1102]
962         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
963         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
964         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
965         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
966         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
967         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
968         in the structure.
969         * Makefile (tests): Add tst-initializers1.
970         (CFLAGS-tst-initializers1.c): Set.
971         * tst-initializers1.c: New test.
972
973 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
974
975         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
976         Make sure __flags are located at offset 48 from the start of the
977         structure.
978
979 2005-07-02  Roland McGrath  <roland@redhat.com>
980
981         * Makeconfig: Comment fix.
982
983 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
984
985         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
986         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
987         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
988         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
989         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
990         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
991         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
992         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
993         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
994         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
995
996 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
997
998         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
999         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1000         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
1001         fields.
1002         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1003         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
1004         field.  Put in sysinfo field unconditionally.
1005         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1006         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
1007         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1008         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
1009         fields.
1010         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1011         * pthread_create.c (__pthread_create_2_1): Use
1012         THREAD_COPY_STACK_GUARD macro.
1013         * Makefile: Add rules to build and run tst-stackguard1{,-static}
1014         tests.
1015         * tst-stackguard1.c: New file.
1016         * tst-stackguard1-static.c: New file.
1017
1018 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
1019
1020         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1021         Invoke CGOTSETUP and CGOTRESTORE.
1022         (CGOTSETUP, CGOTRESTORE): Define.
1023
1024 2005-05-29  Richard Henderson  <rth@redhat.com>
1025
1026         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
1027         (tf_write, tf_writev): Use it.
1028         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
1029         the system minimum.
1030
1031 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
1032
1033         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1034         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
1035         __librt_*_asynccancel@local.
1036
1037 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
1038
1039         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
1040         all occurrences of JUMPTARGET.  Instead append @local to labels.
1041
1042 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
1043
1044         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
1045         size/alignment of struct pthread rather than tcbhead_t.
1046         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
1047         Likewise.
1048         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
1049         Likewise.
1050         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
1051         Likewise.
1052
1053 2005-05-19  Richard Henderson  <rth@redhat.com>
1054
1055         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
1056         __sync_val_compare_and_swap, not explicit _si variant.
1057         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
1058
1059 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
1060
1061         [BZ #915]
1062         * sysdeps/pthread/pthread.h: Avoid empty initializers.
1063
1064 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
1065
1066         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
1067         .eh_frame section, use cfi_* directives.
1068
1069 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
1070
1071         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
1072         of "" includes.
1073
1074 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
1075
1076         [BZ #1075]
1077         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
1078         aio_write blocks.
1079
1080 2005-04-27  Roland McGrath  <roland@redhat.com>
1081
1082         * Makefile (tests): Remove tst-clock2.
1083
1084         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
1085         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
1086         translating to the kernel clockid_t for our own process/thread clock.
1087
1088         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
1089
1090 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
1091
1092         * old_pthread_cond_init.c: Include <errno.h>.
1093         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
1094         process shared or uses clock other than CLOCK_REALTIME.
1095         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
1096
1097 2005-04-13  David S. Miller  <davem@davemloft.net>
1098
1099         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
1100         * sysdeps/sparc/sparc64/clone.S: New file.
1101
1102 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
1103
1104         [BZ #1102]
1105         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
1106         __inline instead of inline.
1107         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
1108
1109 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
1110
1111         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
1112         functionally equivalent, but shorter instructions.
1113         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1114         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1115         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1116         Likewise.
1117         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1118         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1119         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1120         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1121         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1122         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
1123         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1124         Likewise.
1125         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1126         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1127         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1128         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1129         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1130
1131 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
1132
1133         * sysdeps/mips/Makefile: New file.
1134         * sysdeps/mips/nptl-sysdep.S: New file.
1135         * sysdeps/mips/tcb-offsets.sym: New file.
1136         * sysdeps/mips/pthread_spin_lock.S: New file.
1137         * sysdeps/mips/pthread_spin_trylock.S: New file.
1138         * sysdeps/mips/pthreaddef.h: New file.
1139         * sysdeps/mips/tls.h: New file.
1140         * sysdeps/mips/jmpbuf-unwind.h: New file.
1141         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
1142         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
1143         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
1144         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
1145         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
1146         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
1147         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
1148         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
1149         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
1150         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
1151
1152 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
1153
1154         [BZ #1112]
1155         * pthread_create.c (__pthread_create_2_1): Rename syscall error
1156         variable to scerr.
1157
1158 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
1159
1160         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
1161
1162 2005-02-25  Roland McGrath  <roland@redhat.com>
1163
1164         * alloca_cutoff.c: Correct license text.
1165         * tst-unload.c: Likewise.
1166         * sysdeps/pthread/allocalim.h: Likewise.
1167         * sysdeps/pthread/pt-initfini.c: Likewise.
1168         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1169         * sysdeps/pthread/bits/sigthread.h: Likewise.
1170         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
1171         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
1172
1173 2005-02-16  Roland McGrath  <roland@redhat.com>
1174
1175         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1176         Use unsigned int * for ptr_nthreads.
1177
1178 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
1179
1180         [BZ #721]
1181         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
1182         gcc4.
1183
1184 2005-02-07  Richard Henderson  <rth@redhat.com>
1185
1186         [BZ #787]
1187         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
1188         argument.
1189
1190 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
1191
1192         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
1193         order of arguments in invocation of atomic_add_zero.
1194
1195 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
1196
1197         [BZ #737]
1198         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
1199         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
1200         at least gotntpoff relocation and addition.
1201         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1202         Likewise.
1203         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
1204         Likewise.
1205         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
1206         Likewise.
1207
1208 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
1209
1210         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
1211         entry for static tls deallocation fix.
1212         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
1213         also contains information whether the memory pointed to is static
1214         TLS or not.
1215         * sysdeps/i386/tls.h: Likewise.
1216         * sysdeps/ia64/tls.h: Likewise.
1217         * sysdeps/powerpc/tls.h: Likewise.
1218         * sysdeps/s390/tls.h: Likewise.
1219         * sysdeps/sh/tls.h: Likewise.
1220         * sysdeps/sparc/tls.h: Likewise.
1221         * sysdeps/x86_64/tls.h: Likewise.
1222
1223 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
1224
1225         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
1226
1227 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
1228
1229         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
1230         %esp.
1231         * Makefile (tests): Add tst-align2.
1232         * tst-align2.c: New test.
1233         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
1234         -mpreferred-stack-boundary=4.
1235
1236 2004-12-18  Roland McGrath  <roland@redhat.com>
1237
1238         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
1239         New file removed withdrawn for the moment.
1240
1241 2004-12-17  Richard Henderson  <rth@redhat.com>
1242
1243         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
1244         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
1245
1246 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
1247
1248         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
1249         Increased PTHREAD_STACK_MIN.
1250
1251         * tst-context1.c (stacks): Use bigger stack size.
1252
1253 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
1254
1255         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
1256         * sysdeps/sparc/tcb-offsets.sym: Add TID.
1257
1258 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
1259
1260         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
1261         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
1262         * sysdeps/s390/tcb-offsets.sym (TID): Add.
1263
1264 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
1265
1266         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
1267
1268 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
1269
1270         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
1271         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
1272
1273         * tst-getpid1.c: If child crashes, report this first.  Print which
1274         signal.
1275
1276 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
1277
1278         * init.c (__pthread_initialize_minimal_internal): Also unblock
1279         SIGSETXID.
1280
1281 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
1282
1283         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
1284         _POSIX_THREAD_CPUTIME): Define to 0.
1285         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
1286         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
1287         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
1288         __timer_signal_thread_tclk): Remove.
1289         (init_module): Remove their initialization.
1290         (thread_cleanup): Remove their cleanup assertions.
1291         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
1292         __timer_signal_thread_tclk): Remove.
1293         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
1294         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
1295         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
1296
1297 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
1298
1299         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
1300         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
1301
1302         * Makefile (tests): Add tst-getpid2.
1303         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
1304         (do_test): Use it.  Use __clone2 instead of clone on ia64.
1305         * tst-getpid2.c: New test.
1306
1307 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1308
1309         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
1310
1311 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
1312
1313         * Makefile (tests): Add tst-getpid1.
1314         * tst-getpid1.c: New file.
1315         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
1316         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
1317
1318 2004-12-02  Roland McGrath  <roland@redhat.com>
1319
1320         * Makefile (libpthread-nonshared): Variable removed.
1321         ($(objpfx)libpthread_nonshared.a): Target removed.
1322         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
1323         These are now handled by generic magic from
1324         libpthread-static-only-routines being set.
1325
1326 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
1327
1328         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
1329         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
1330         _POSIX_THREAD_PRIO_PROTECT): Define.
1331         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1332         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1333         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1334
1335 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
1336
1337         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
1338         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
1339         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
1340         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
1341         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1342         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1343         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1344
1345 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
1346
1347         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
1348
1349         * Makefile (libpthread-routines): Add pthread_setschedprio.
1350         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
1351         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
1352         * pthread_setschedprio.c: New file.
1353
1354 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
1355
1356         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
1357         * pthread_cancel.c (pthread_create): Likewise.
1358
1359         * Makefile (libpthread-routines): Add vars.
1360         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
1361         * init.c (__default_stacksize, __is_smp): Remove.
1362         * vars.c: New file.
1363         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
1364         and define a wrapper macro.
1365         (PTHREAD_STATIC_FN_REQUIRE): Define.
1366         * allocatestack.c (__find_thread_by_id): Undefine.
1367         * pthread_create (__pthread_keys): Remove.
1368         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
1369         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
1370         PTHREAD_STATIC_FN_REQUIRE.
1371
1372 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1373
1374         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
1375         parameter to REGISTER macro.
1376
1377 2004-11-17  Roland McGrath  <roland@redhat.com>
1378
1379         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
1380         Make sure SIGCANCEL is blocked as well.
1381
1382 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
1383
1384         * sysdeps/pthread/setxid.h: New file.
1385         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
1386         (struct xid_command): Add forward decl.
1387         (struct pthread_functions): Change return type of __nptl_setxid hook
1388         to int.
1389         * pthreadP.h (__nptl_setxid): Change return type to int.
1390         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
1391         calling thread, return its return value and set errno on failure.
1392         * descr.h (struct xid_command): Change id type to long array.
1393
1394         * Makefile: Add rules to build and test tst-setuid1 and
1395         tst-setuid1-static.
1396         * tst-setuid1.c: New test.
1397         * tst-setuid1-static.c: New test.
1398
1399 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
1400
1401         * Makefile (tests): Add tst-exit3.
1402         * tst-exit3.c: New test.
1403
1404 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
1405
1406         * Makefile (tests): Add tst-exit2.
1407         * tst-exit2.c: New file.
1408
1409 2004-11-09  Roland McGrath  <roland@redhat.com>
1410
1411         [BZ #530]
1412         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
1413         here, before calling clone.
1414         * pthread_create.c (start_thread): Don't do it here.
1415
1416 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
1417
1418         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
1419
1420 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
1421
1422         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1423         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
1424         assembler warning.
1425
1426 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
1427
1428         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
1429         if sched_priority is not between minprio and maxprio.
1430
1431 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1432
1433         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1434         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
1435
1436         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1437         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
1438
1439 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
1440
1441         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
1442         not-cancelable I/O functions.
1443
1444 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1445
1446         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1447         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
1448         make sure 2 is stored in the futex and we looked at the old value.
1449         Fix a few other problems to return the correct value.
1450
1451 2004-10-14  Richard Henderson  <rth@redhat.com>
1452
1453         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
1454         make gcc4 happy.
1455
1456 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
1457
1458         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
1459         of pthread-functions.h and pthreaddef.h.
1460         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
1461
1462         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1463         Change __data.__nwaiters from int to unsigned int.
1464
1465         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
1466         sysconf (_SC_THREAD_CPUTIME) returns negative value.
1467
1468         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
1469         before return type.
1470
1471         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
1472         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
1473
1474 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
1475
1476         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
1477         test fails, remove message queue.
1478         (tf_msgsnd): Likewise.
1479
1480 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
1481
1482         * tst-clock1.c: Change #ifdef to #if defined.
1483         * tst-clock2.c: Likewise.
1484         * tst-cond11.c: Likewise.
1485
1486         * sysdeps/pthread/timer_create.c (timer_create): Use
1487         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
1488         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
1489         THREAD_CPUTIME.
1490
1491 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
1492
1493         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
1494         _POSIX_THREAD_CPUTIME): Define to 0.
1495
1496 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
1497
1498         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
1499         and _POSIX_THREAD_CPUTIME to zero.
1500         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1501         * tst-barrier2.c: Fix testing for POSIX feature.
1502         * tst-clock1.c: Likewise.
1503         * tst-clock2.c: Likewise.
1504         * tst-cond11.c: Likewise.
1505         * tst-cond4.c: Likewise.
1506         * tst-cond6.c: Likewise.
1507         * tst-flock2.c: Likewise.
1508         * tst-mutex4.c: Likewise.
1509         * tst-mutex9.c: Likewise.
1510         * tst-rwlock12.c: Likewise.
1511         * tst-rwlock4.c: Likewise.
1512         * tst-signal1.c: Likewise.
1513         * tst-spin2.c: Likewise.
1514         * sysdeps/pthread/posix-timer.h: Likewise.
1515         * sysdeps/pthread/timer_create.c: Likewise.
1516         * sysdeps/pthread/timer_routines.c: Likewise.
1517
1518 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
1519
1520         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1521         (__lll_mutex_timedlock_wait): Address futex correctly.
1522
1523         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1524         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
1525         make sure 2 is stored in the futex and we looked at the old value.
1526         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1527         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
1528         which might very well made the code not working at all before.
1529         [BZ #417]
1530
1531 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
1532
1533         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
1534         allow SIGSETXID to be sent.
1535         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
1536         for SIGSETXID to be defined.
1537         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
1538         SIGSETXID cannot be blocked.
1539
1540         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1541         Add __extension__ to long long types.
1542         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1543         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1544         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1545         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1546         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1547         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1548         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1549
1550 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
1551
1552         * descr.h (struct pthread): Add stopped_start field.
1553         * sysdeps/pthread/createthread.c (create_thread): Set
1554         start_stopped flag in descriptor for new thread appropriately.
1555         * pthread_create.c (start_thread): Only take lock to be stopped on
1556         startup if stopped_start flag says so.
1557
1558 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
1559
1560         * pthread_create.c (__pthread_create_2_1): Remember whether thread
1561         is created detached and if yes, do not try to free the stack in case
1562         the thread creation failed.
1563         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
1564         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
1565         case there has been no error.  [BZ #405]
1566
1567         * pthread_create.c (start_thread): Don't wait for scheduler data
1568         etc to be set at the beginning of the function.  The cancellation
1569         infrastructure must have been set up.  And enable async
1570         cancellation before potentially going to sleep.  [BZ #401]
1571
1572 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
1573
1574         * Versions: Remove exports for pthread_set*id_np functions.
1575         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
1576         for now.
1577         * Makefile: Don't build pthread_set*id code for now.
1578
1579 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
1580
1581         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
1582         internal use.
1583         * allocatestack.c (__nptl_setxid): New function.
1584         * descr.h (struct xid_command): Define type.
1585         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
1586         (sighandler_setxid): New function.
1587         (__pthread_initialize_minimal): Register sighandler_setxid for
1588         SIGCANCEL.
1589         * pt-allocrtsig.c: Update comment.
1590         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
1591         Declare __nptl_setxid.
1592         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
1593         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
1594         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1595         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1596         and pthread_setresuid_np.
1597         * pthread_setgid_np.c: New file.
1598         * pthread_setuid_np.c: New file.
1599         * pthread_setegid_np.c: New file.
1600         * pthread_seteuid_np.c: New file.
1601         * pthread_setregid_np.c: New file.
1602         * pthread_setreuid_np.c: New file.
1603         * pthread_setresgid_np.c: New file.
1604         * pthread_setresuid_np.c: New file.
1605         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
1606         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1607         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1608         and pthread_setresuid_np.
1609         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
1610         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
1611         pthread_setregid, and pthread_setresgid.
1612
1613 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
1614
1615         * allocatestack.c (allocate_stack): Return EAGAIN instead of
1616         ENOMEM when out of memory.
1617
1618 2004-09-10  Roland McGrath  <roland@redhat.com>
1619
1620         [BZ #379]
1621         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
1622         code, since we don't try to use the broken CLONE_STOPPED any more.
1623         * pthread_create.c (start_thread): Likewise.
1624
1625 2004-09-15  Richard Henderson  <rth@redhat.com>
1626
1627         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
1628
1629 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
1630
1631         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
1632         (__libc_unwind_longjmp): Delete macro and declare as function.
1633         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
1634         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
1635         nptl directory.
1636         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
1637         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
1638         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
1639
1640 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
1641
1642         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
1643         for __USE_XOPEN2K.
1644         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
1645         types also for __USE_XOPEN2K.
1646         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1647         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1648         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1649         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1650         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1651         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1652         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1653         [BZ #320]
1654
1655 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
1656
1657         * sysdeps/pthread/pthread.h
1658         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
1659         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
1660         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
1661         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
1662         [BZ #375]
1663
1664 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
1665
1666         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
1667         PSEUDO to be used with . prefix.
1668
1669         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
1670         Use atomic_increment instead of atomic_exchange_and_add.
1671         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
1672         Likewise.
1673         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
1674         Likewise.
1675         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1676         Likewise.
1677
1678         * allocatestack.c (allocate_stack): Use atomic_increment_val
1679         instead of atomic_exchange_and_add.
1680         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
1681         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1682         Likewise.
1683         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1684         Likewise.
1685
1686         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
1687         the initialization function might throw.
1688
1689 2005-09-05  Richard Henderson  <rth@redhat.com>
1690
1691         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1692         Move definition inside libpthread, libc, librt check.  Provide
1693         definition for rtld.
1694
1695 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
1696
1697         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
1698         * sysdeps/i386/jmpbuf-unwind.h: Likewise
1699         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
1700         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
1701         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
1702         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
1703         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
1704         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
1705         * unwind.c: Use it.
1706
1707         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1708         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
1709         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1710         Likewise.
1711         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1712         Decrement __nwaiters.  If pthread_cond_destroy has been called and
1713         this is the last waiter, signal pthread_cond_destroy caller and
1714         avoid using the pthread_cond_t structure after unlock.
1715         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1716         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1717         Read clock type from the least significant bits of __nwaiters instead
1718         of __clock.
1719         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1720         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
1721
1722 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
1723
1724         [BZ #342]
1725         * Makefile (tests): Add tst-cond20 and tst-cond21.
1726         * tst-cond20.c: New test.
1727         * tst-cond21.c: New test.
1728         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1729         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
1730         it unsigned int.
1731         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1732         Likewise.
1733         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1734         (pthread_cond_t): Likewise.
1735         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1736         Likewise.
1737         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1738         Likewise.
1739         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1740         Likewise.
1741         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
1742         (cond_nwaiters): New.
1743         (clock_bits): New.
1744         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
1745         if there are waiters not signalled yet.
1746         Wait until all already signalled waiters wake up.
1747         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
1748         __nwaiters.  If pthread_cond_destroy has been called and this is the
1749         last waiter, signal pthread_cond_destroy caller and avoid using
1750         the pthread_cond_t structure after unlock.
1751         (__pthread_cond_wait): Increment __nwaiters in the beginning,
1752         decrement it when leaving.  If pthread_cond_destroy has been called
1753         and this is the last waiter, signal pthread_cond_destroy caller.
1754         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1755         Likewise.  Read clock type from the least significant bits of
1756         __nwaiters instead of __clock.
1757         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
1758         whether clock ID can be encoded in COND_CLOCK_BITS bits.
1759         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
1760         clock type just from the last COND_CLOCK_BITS bits of value.
1761         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
1762         instead of __clock, just from second bit of condattr's value.
1763
1764 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
1765
1766         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
1767         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
1768         != 64.
1769         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1770
1771 2004-08-15  Roland McGrath  <roland@frob.com>
1772
1773         * pthread_atfork.c: Update copyright terms including special exception
1774         for these trivial files, which are statically linked into executables
1775         that use dynamic linking for the significant library code.
1776
1777 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
1778
1779         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
1780         pthread_rwlock_rdlock.
1781         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
1782         Decrease __nr_readers_queued after reacquiring lock.
1783         * sysdeps/pthread/pthread_rwlock_timedrdlock
1784         (pthread_rwlock_timedrdlock): Likewise.
1785         Reported by Bob Cook <bobcook47@hotmail.com>.
1786
1787 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
1788
1789         * tst-rwlock14.c (tf): Read main thread handle from *ARG
1790         before pthread_barrier_wait.
1791
1792 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
1793
1794         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1795         Remove unnecessary exception handling data.
1796
1797 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
1798
1799         [BZ #284]
1800         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
1801         instead of clockid_t.
1802
1803 2004-07-21  Roland McGrath  <roland@redhat.com>
1804
1805         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
1806
1807 2004-07-19  Roland McGrath  <roland@redhat.com>
1808
1809         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
1810
1811 2004-07-02  Roland McGrath  <roland@redhat.com>
1812
1813         * configure: Don't exit.
1814
1815 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1816
1817         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1818         (__pthread_cond_timedwait): Check for invalid nanosecond in
1819         timeout value.
1820
1821 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
1822
1823         * Makefile: Add rules to build and run tst-fini1.
1824         * tst-fini1.c: New file.
1825         * tst-fini1mod.c: New file.
1826
1827 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
1828
1829         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
1830         if no cancellation support is needed.
1831         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1832         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1833         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1834         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1835         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1836         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1837         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1838         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1839         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1840
1841         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
1842         only if not already defined.
1843
1844 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
1845
1846         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
1847         constraint "m" instead of "0" for futex.
1848
1849         * shlib-versions: Add powerpc64-.*-linux.*.
1850
1851 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
1852
1853         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
1854         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
1855         for valid tv_nsec.
1856         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
1857         1 billion and 64-bit tv_nsec which is valid when truncated to 32
1858         bits.
1859
1860 2004-06-29  Roland McGrath  <roland@redhat.com>
1861
1862         * Banner: NPTL no longer has its own version number.
1863         * Makefile (nptl-version): Variable removed.
1864         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
1865         using $(version), the glibc version number.
1866
1867 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1868
1869         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
1870         Fix branch offset for a PLT entry.
1871         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
1872         Likewise.
1873         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1874         Likewise.
1875         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
1876         Likewise.
1877         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
1878         Likewise.
1879
1880 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1881
1882         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
1883         unconditionally.
1884
1885 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1886
1887         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1888         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
1889         instead of tv_sec.
1890         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
1891         (pthread_rwlock_timedrdlock): Likewise.
1892
1893 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
1894
1895         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1896         Set __r7 to val, not mutex.
1897
1898 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
1899
1900         * Makefile: Add rules to build tst-rwlock14.
1901         * tst-rwlock14.c: New file.
1902
1903 2004-06-24  Boris Hu  <boris.hu@intel.com>
1904
1905         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
1906         check.
1907         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1908
1909 2004-06-19  Andreas Jaeger  <aj@suse.de>
1910
1911         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
1912         assembler in last patch.
1913
1914 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
1915
1916         * sysdeps/pthread/pthread_cond_timedwait.c
1917         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
1918         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1919         (__pthread_cond_timedwait): Check for invalid nanosecond in
1920         timeout value.
1921         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1922         * tst-cond19.c: New file.
1923         * Makefile: Add rules to build and run tst-cond19.
1924
1925 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
1926
1927         * tst-context1.c (GUARD_PATTERN): Defined.
1928         (tst_context_t): Define struct containing ucontext_t & guard words.
1929         (ctx): Declare as an array of tst_context_t.
1930         (fct): Verify uc_link & guard words are still valid.
1931         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
1932
1933 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1934
1935         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1936         Add __data.__futex field, reshuffle __data.__clock.
1937         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
1938         (__pthread_cond_signal): Increment __futex at the same time as
1939         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1940         address of low 32-bits of __wakeup_seq to futex syscall.
1941         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
1942         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1943         releasing internal lock to FUTEX_WAIT.
1944         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1945         (__pthread_cond_timedwait): Likewise.
1946         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1947         (FUTEX_CMP_REQUEUE): Define.
1948         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1949         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1950         Pass __futex value from before the unlock and __futex address instead
1951         of address of low 32-bits of __wakeup_seq to futex syscall.
1952         Fallback to FUTEX_WAKE all on any errors.
1953
1954 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
1955
1956         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
1957         comment typo.
1958         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
1959         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
1960         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
1961         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
1962         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
1963
1964 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1965
1966         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
1967         Add memory clobber to inline assembly.
1968         (__lll_mutex_trylock): Likewise.
1969         (__lll_mutex_cond_trylock): Likewise.
1970
1971 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1972
1973         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1974         Pass val argument as 6th system call argument in %r7.
1975
1976 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1977
1978         * Makefile (tests): Add tst-cond16.
1979         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
1980         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
1981         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1982         Add __data.__futex field, reshuffle __data.__clock.
1983         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
1984         (__pthread_cond_signal): Increment __futex at the same time as
1985         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1986         address of low 32-bits of __wakeup_seq to futex syscall.
1987         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
1988         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1989         releasing internal lock to FUTEX_WAIT.
1990         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
1991         (__pthread_cond_timedwait): Likewise.
1992         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
1993         (FUTEX_CMP_REQUEUE): Define.
1994         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1995         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1996         Pass __futex value from before the unlock and __futex address instead
1997         of address of low 32-bits of __wakeup_seq to futex syscall.
1998         Fallback to FUTEX_WAKE all on any errors.
1999         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
2000         Define.
2001         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
2002         internally.  Return non-zero if error, zero if success.
2003         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
2004         Add __data.__futex field, reshuffle __data.__clock.
2005         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
2006         Define.
2007         (lll_futex_requeue): Add val argument, return 1 unconditionally
2008         for the time being.
2009         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2010         Add __data.__futex field, reshuffle __data.__clock.
2011         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
2012         Define.
2013         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
2014         internally.  Return non-zero if error, zero if success.
2015         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2016         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
2017         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
2018         Define.
2019         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
2020         internally.  Return non-zero if error, zero if success.
2021         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
2022         Add __data.__futex field, reshuffle __data.__clock.
2023         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
2024         Define.
2025         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
2026         internally.  Return non-zero if error, zero if success.
2027         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
2028         Add __data.__futex field, reshuffle __data.__clock.
2029         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
2030         Add __data.__futex field, reshuffle __data.__clock.
2031         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
2032         Increment __futex at the same time as __wakeup_seq or __total_seq.
2033         Pass address of __futex instead of address of low 32-bits of
2034         __wakeup_seq to futex syscall.
2035         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2036         Pass __futex value from before releasing internal lock
2037         to FUTEX_WAIT.
2038         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2039         Likewise.  Avoid unnecessary shadowing of variables.
2040         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
2041         Set __futex to 2 * __total_seq.  Pass __futex value from before the
2042         unlock and __futex address instead of address of low 32-bits of
2043         __wakeup_seq to futex_requeue macro, adjust for new return value
2044         meaning.
2045         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
2046         (__pthread_cond_signal): Increment __futex at the same time as
2047         __wakeup_seq or __total_seq.  Pass address of __futex instead of
2048         address of low 32-bits of __wakeup_seq to futex syscall.
2049         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2050         (__pthread_cond_wait): Likewise.  Pass __futex value from before
2051         releasing internal lock to FUTEX_WAIT.
2052         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2053         (__pthread_cond_timedwait): Likewise.
2054         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2055         (FUTEX_CMP_REQUEUE): Define.
2056         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
2057         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
2058         Pass __futex value from before the unlock and __futex address instead
2059         of address of low 32-bits of __wakeup_seq to futex syscall.
2060         Fallback to FUTEX_WAKE all on any errors.
2061
2062 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2063
2064         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
2065         Add nop to align the end of critical section.
2066         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
2067
2068 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2069
2070         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2071         Add __broadcast_seq field.
2072         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
2073         all waiters as woken with woken_seq and bump broadcast counter.
2074         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
2075         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
2076         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2077         Comment typo fixes.  Avoid returning -ETIMEDOUT.
2078
2079 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
2080
2081         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2082         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
2083         Reported by Kaz Kojima.
2084
2085 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
2086
2087         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
2088
2089 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
2090
2091         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
2092         __broadcast_seq with bc_seq after acquiring internal lock instead of
2093         before it.
2094
2095 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
2096
2097         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
2098         compilation.
2099         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2100         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
2101         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
2102         (pthread_cond_t): Add __data.__broadcast_seq field.
2103         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2104         (FRAME_SIZE): Define.
2105         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
2106         Comment typo fixes.
2107         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
2108         Define.
2109         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
2110         typo fixes.
2111         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2112         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
2113         fixes.
2114
2115 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
2116
2117         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
2118         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
2119         Add __broadcast_seq field.
2120         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2121         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2122         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2123         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2124         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2125         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
2126         all waiters as woken with woken_seq and bump broadcast counter.
2127         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
2128         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
2129         __broadcast_seq field.
2130         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2131         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2132         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
2133         * pthread_cond_init.c: Initialize __broadcast_seq field.
2134         * Makefile (tests): Add tst-cond17 and tst-cond18.
2135         Add .NOTPARALLEL goal.
2136         * tst-cond16.c: New file.  From Jakub.
2137         * tst-cond17.c: New file.  From Jakub.
2138         * tst-cond18.c: New file.  From Jakub.
2139
2140 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
2141
2142         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
2143         unwind info.
2144
2145         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
2146         Parametrize frame size.  Correct some unwind info.
2147         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2148
2149 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
2150
2151         * tst-stack3.c: Note testing functionality beyond POSIX.
2152
2153 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
2154
2155         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
2156         Change conditional from ifdef to if.
2157
2158 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
2159
2160         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
2161         SYSDEP_CANCEL_ERROR): Define.
2162         (PSEUDO): Use it.
2163
2164 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
2165
2166         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
2167
2168 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
2169
2170         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
2171
2172 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2173
2174         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
2175         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2176         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
2177         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2178
2179 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
2180
2181         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
2182         thread has all signals blocked.
2183
2184 2004-04-18  Andreas Jaeger  <aj@suse.de>
2185
2186         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
2187         (SEM_VALUE_MAX): Add missing brace.
2188
2189 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
2190
2191         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
2192         in rt subdir.
2193         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
2194         * sysdeps/pthread/tst-mqueue8x.c: New test.
2195         * tst-cancel4.c: Update comment about message queues.
2196
2197         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
2198         return it_value { 0, 0 }.
2199         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
2200         like SIGEV_SIGNAL.
2201         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
2202         assertion for SIGEV_NONE.
2203         (thread_attr_compare): Compare all attributes, not just a partial
2204         subset.
2205
2206 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
2207
2208         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
2209
2210 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
2211
2212         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
2213         Just use a plain number.
2214         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
2215         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2216         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2217         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2218         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2219         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2220         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2221
2222 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2223
2224         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
2225         frame info.
2226         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2227
2228 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
2229
2230         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
2231         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
2232         of calling sigwaitinfo.
2233
2234 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
2235
2236         * allocatestack.c (allocate_stack): Set reported_guardsize
2237         unconditionally.
2238         * pthread_getattr_np.c (pthread_getattr_np): Use
2239         reported_guardsize instead of guardsize.
2240         * descr.h (struct pthread): Add reported_guardsize field.
2241
2242 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
2243
2244         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
2245
2246 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
2247
2248         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
2249
2250 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
2251
2252         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
2253         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
2254         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
2255         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
2256         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
2257         Define.
2258         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
2259         (_POSIX_MESSAGE_PASSING): Define.
2260         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
2261         (_POSIX_MESSAGE_PASSING): Define.
2262         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
2263         (_POSIX_MESSAGE_PASSING): Define.
2264
2265 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
2266
2267         * tst-context1.c (fct): Check whether correct stack is used.
2268
2269 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
2270
2271         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
2272         matching constraints for asm mem parameters.
2273
2274         * tst-clock2.c (tf): Don't define unless needed.
2275
2276 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
2277
2278         * Makefile (link-libc-static): Use $(static-gnulib) instead of
2279         $(gnulib).
2280
2281 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
2282
2283         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
2284         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
2285         * pthreadP.h: Declare __nptl_deallocate_tsd.
2286         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
2287         Adjust caller.
2288
2289         * Makefile (tests): Add tst-tsd5.
2290         * tst-tsd5.c: New file.
2291
2292 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
2293
2294         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2295         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
2296         is SHLIB_COMPAT check.
2297         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
2298         (__pthread_attr_getaffinity_old): Likewise.
2299         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2300         (__pthread_getaffinity_old): Likewise.
2301         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2302         (__pthread_setaffinity_old): Likewise.
2303
2304 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
2305
2306         * allocatestack.c (_make_stacks_executable): Call
2307         _dl_make_stack_executable first.
2308
2309 2004-03-24  Roland McGrath  <roland@redhat.com>
2310
2311         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
2312         constraint instead of "0".
2313
2314 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
2315
2316         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2317         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
2318
2319         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
2320         code to avoid warning.
2321
2322 2004-03-24  Andreas Jaeger  <aj@suse.de>
2323
2324         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2325         (__pthread_attr_setaffinity_old): Remove const.
2326
2327 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
2328
2329         * sysdeps/unix/sysv/linux/smp.h: New file.
2330         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
2331         * init.c: Define __is_smp.
2332         (__pthread_initialize_minimal_internal): Call is_smp_system to
2333         initialize __is_smp.
2334         * pthreadP.h: Declare __is_smp.
2335         Define MAX_ADAPTIVE_COUNT is necessary.
2336         * pthread_mutex_init.c: Add comment regarding __spins field.
2337         * pthread_mutex_lock.c: Implement adaptive mutex type.
2338         * pthread_mutex_timedlock.c: Likewise.
2339         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2340         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2341         Add __spins field.
2342         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2343         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2344         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2345         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2346         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2347         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2348         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2349         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
2350         lll_mutex_cond_trylock.
2351         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2352         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2353         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2354         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2355         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2356         Define BUSY_WAIT_NOP.
2357         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2358         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2359
2360         * tst-mutex5.c: Add support for testing adaptive mutexes.
2361         * tst-mutex7.c: Likewise.
2362         * tst-mutex5a.c: New file.
2363         * tst-mutex7a.c: New file.
2364         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
2365
2366         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2367         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
2368         vgettimeofday call might destroy the content.
2369
2370         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
2371         @pause in the loop.
2372
2373         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
2374         No need to restrict type of ret.  Make it int.  Add comment.
2375
2376         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
2377         Remove unnecessary setne instruction.
2378
2379 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
2380
2381         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2382         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
2383         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
2384         If realloc fails, break out of the loop.
2385
2386 2004-03-20  Andreas Jaeger  <aj@suse.de>
2387
2388         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2389         (__pthread_setaffinity_old): Fix interface.
2390         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2391         (__pthread_getaffinity_old): Likewise.
2392
2393         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2394         (__pthread_setaffinity_new): Remove duplicate declaration.
2395
2396 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2397
2398         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
2399         the return value to a safe register.
2400         (CDISABLE): Set the function argument correctly.
2401
2402 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2403
2404         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
2405         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
2406         Rewrite so that only one locked memory operation per round is needed.
2407         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
2408         (pthread_barrier_wait): After wakeup, release lock only when the
2409         last thread stopped using the barrier object.
2410         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
2411         (__pthread_cond_wait): Don't store mutex address if the current
2412         value is ~0l.  Add correct cleanup support and unwind info.
2413         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2414         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
2415         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
2416         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
2417         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
2418         Add correct cleanup support and unwind info.
2419         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
2420         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
2421         information for syscall wrappers.
2422
2423 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
2424
2425         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2426         cpusetsize field, remove next.
2427         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
2428         parameter for size of the CPU set.
2429         (pthread_setaffinity_np): Likewise.
2430         (pthread_attr_getaffinity_np): Likewise.
2431         (pthread_attr_setaffinity_np): Likewise.
2432         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
2433         interface change, keep compatibility code.
2434         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2435         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
2436         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
2437         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
2438         __pthread_getaffinity_np.
2439         * Versions: Add version for changed interfaces.
2440         * tst-attr3.c: Adjust test for interface change.
2441         * pthread_getattr_np.c: Query the kernel about the affinity mask with
2442         increasing buffer sizes.
2443         * pthread_attr_destroy.c: Remove unused list handling.
2444         * pthread_attr_init.c: Likewise.
2445
2446 2004-03-17  Roland McGrath  <roland@redhat.com>
2447
2448         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
2449         first argument to clock_getres so we ever enable kernel timers.
2450
2451 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
2452
2453         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
2454
2455 2004-03-12  Richard Henderson  <rth@redhat.com>
2456
2457         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
2458         oldvalue from CENABLE to CDISABLE.
2459
2460 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
2461
2462         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
2463         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2464         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2465         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2466
2467 2004-03-11  Richard Henderson  <rth@redhat.com>
2468
2469         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
2470         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
2471         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
2472
2473 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
2474
2475         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
2476         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
2477         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
2478
2479 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
2480
2481         * forward.c (__pthread_cond_broadcast_2_0,
2482         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
2483         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
2484         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
2485
2486 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2487
2488         * sysdeps/sh/tcb-offsets.sym: Add PID.
2489         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
2490         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
2491
2492 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
2493
2494         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
2495         include <sysdep-cancel.h>, vfork is no cancellation point.
2496         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
2497         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
2498         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
2499
2500 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
2501
2502         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
2503         libc_hidden_def.
2504         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
2505         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
2506         Likewise.
2507         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
2508         Likewise.
2509         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
2510         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
2511         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
2512         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
2513         of DO_CALL_VIA_BREAK.  Work around a gas problem.
2514
2515         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
2516         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
2517         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
2518         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
2519         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
2520         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
2521
2522         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
2523         a local register for saving old PID.  Negate PID in parent upon exit.
2524
2525         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
2526         tcb-offsets.h.
2527         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2528         before syscall, set to the old value in the parent afterwards.
2529         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
2530         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
2531         tcb-offsets.h.
2532         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2533         before syscall, set to the old value in the parent afterwards.
2534         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
2535         * sysdeps/s390/tcb-offsets.sym: Add PID.
2536
2537         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
2538         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
2539         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
2540         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
2541         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
2542         * sysdeps/sparc/tcb-offsets.sym: Add PID.
2543
2544 2004-03-10  Andreas Schwab  <schwab@suse.de>
2545
2546         * sysdeps/ia64/tcb-offsets.sym: Add PID.
2547         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
2548         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
2549
2550 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
2551
2552         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
2553         * tst-cancel21.c (do_one_test): Likewise.
2554         Reported by Gordon Jin <gordon.jin@intel.com>.
2555
2556 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
2557
2558         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
2559         if non-zero and set to INT_MIN if zero.
2560         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
2561         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
2562         (SAVE_PID, RESTORE_PID): Define.
2563         (__vfork): Use it.
2564         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
2565         Use relative path to avoid including NPTL i386/vfork.S.
2566         (SAVE_PID, RESTORE_PID): Define.
2567         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
2568         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
2569         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
2570         tst-vfork2x.
2571         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
2572         * tst-vfork1.c: New test.
2573         * tst-vfork2.c: New test.
2574         * tst-vfork1x.c: New test.
2575         * tst-vfork2x.c: New test.
2576
2577 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
2578
2579         * sysdeps/i386/tcb-offsets.sym: Add PID.
2580         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2581         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
2582         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
2583
2584 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
2585
2586         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
2587
2588 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2589
2590         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2591         _rtld_global_ro.
2592
2593 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
2594
2595         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2596         _rtld_global_ro.
2597
2598         * tst-once4.c: Remove unnecessary macro definition.
2599
2600         * tst-mutex7.c (do_test): Limit thread stack size.
2601         * tst-once2.c (do_test): Likewise.
2602         * tst-tls3.c (do_test): Likewise.
2603         * tst-tls1.c (do_test): Likewise.
2604         * tst-signal3.c (do_test): Likewise.
2605         * tst-kill6.c (do_test): Likewise.
2606         * tst-key4.c (do_test): Likewise.
2607         * tst-join4.c (do_test): Likewise.
2608         * tst-fork1.c (do_test): Likewise.
2609         * tst-context1.c (do_test): Likewise.
2610         * tst-cond2.c (do_test): Likewise.
2611         * tst-cond10.c (do_test): Likewise.
2612         * tst-clock2.c (do_test): Likewise.
2613         * tst-cancel10.c (do_test): Likewise.
2614         * tst-basic2.c (do_test): Likewise.
2615         * tst-barrier4.c (do_test): Likewise.
2616
2617 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
2618
2619         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
2620
2621 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
2622
2623         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2624         (__pthread_cond_timedwait): Optimize wakeup test.
2625         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2626         (__pthread_cond_wait): Likewise.
2627         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2628         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2629         Likewise.
2630
2631 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
2632
2633         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2634         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
2635         the atomic instruction needed.
2636         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2637         (__lll_mutex_lock_wait): Likewise.
2638
2639 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
2640
2641         * Makefile (tests): Add tst-cond14 and tst-cond15.
2642         * tst-cond14.c: New file.
2643         * tst-cond15.c: New file.
2644
2645 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
2646
2647         * sysdeps/pthread/createthread.c (create_thread): Remove use of
2648         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
2649         needs to be implemented differently to be useful.
2650
2651 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
2652
2653         * pthread_attr_setschedparam.c: Don't test priority against limits
2654         here.  Set ATTR_FLAG_SCHED_SET flag.
2655         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
2656         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
2657         from parent thread to child.  If attribute is used and scheduling
2658         parameters are not inherited, copy parameters from attribute or
2659         compute them.  Check priority value.
2660         * pthread_getschedparam.c: If the parameters aren't known yet get
2661         them from the kernel.
2662         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
2663         ATTR_FLAG_POLICY_SET flag for thread.
2664         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
2665         and ATTR_FLAG_POLICY_SET.
2666
2667         * sysdeps/pthread/createthread.c: Use tgkill if possible.
2668
2669         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
2670         fail if stack address hasn't been set.  Just return 0.
2671
2672 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
2673
2674         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
2675         libpthread for the files in this list.
2676         (CFLAGS-tst-unload): Removed.
2677         * tst-unload.c (do_test): Don't use complete path for
2678         LIBPHREAD_SO.
2679
2680         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
2681         tst-_res1mod2.
2682
2683 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
2684
2685         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2686         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
2687         operation per round is needed.
2688         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2689         (__lll_mutex_lock_wait): Likewise.
2690
2691 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
2692
2693         * tst-cancel9.c (cleanup): Don't print to stderr.
2694
2695 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2696
2697         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
2698
2699 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
2700
2701         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2702         (__syscall_error_handler2): Call CDISABLE.
2703         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2704         (__syscall_error_handler2): Call CDISABLE.
2705
2706         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2707         Release lock before the loop, don't reacquire it.
2708
2709         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
2710
2711 2004-02-19  Andreas Schwab  <schwab@suse.de>
2712
2713         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2714         Fix last change.
2715
2716 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
2717
2718         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
2719         (pthread_barrier_wait): After wakeup, release lock only when the
2720         last thread stopped using the barrier object.
2721         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
2722         (pthread_barrier_wait): Likewise.
2723         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2724         Likewise.
2725         * Makefile (tests): Add tst-barrier4.
2726         * tst-barrier4.c: New file.
2727
2728         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2729         (__pthread_cond_timedwait): Perform timeout test while holding
2730         internal lock to prevent wakeup race.
2731         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2732         * sysdeps/pthread/pthread_cond_timedwait.c
2733         (__pthread_cond_timedwait): Likewise.
2734         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2735         (__pthread_cond_timedwait): Likewise.
2736
2737 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
2738
2739         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
2740         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
2741         * Makefile (tests): Add tst-rwlock13.
2742         * tst-rwlock13.c: New test.
2743
2744 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
2745
2746         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2747         (__condvar_tw_cleanup): Little optimization.
2748         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2749
2750 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
2751
2752         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
2753         libpthread as "lib" parameter to SHLIB_COMPAT.
2754         (__novmx_siglongjmp): Fix typo in function name.
2755         (__novmx_longjmp): Fix typo in function name.
2756
2757 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2758
2759         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
2760         __builtin_expect.
2761
2762         * sysdeps/generic/pt-longjmp.c: Moved to...
2763         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
2764
2765 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
2766
2767         * Makefile (libpthread-routines): Add pt-cleanup.
2768         * pt-longjmp.c: Removed.
2769         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
2770         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
2771         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
2772         Version longjmp, siglongjmp for GLIBC_2.3.4.
2773         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
2774
2775 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2776
2777         * sysdeps/pthread/pthread_cond_timedwait.c
2778         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
2779         Reuse code.  Add __builtin_expects.
2780
2781         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2782         (__pthread_cond_timedwait): Get internal lock in case timeout has
2783         passed before the futex syscall.
2784         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2785
2786 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
2787
2788         * allocatestack.c: Pretty printing.
2789
2790         * sysdeps/pthread/createthread.c (create_thread): Don't add
2791         CLONE_DETACHED bit if it is not necessary.
2792
2793 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
2794
2795         * pthread_getattr_np.c: Include ldsodefs.h.
2796
2797 2004-01-16  Richard Henderson  <rth@redhat.com>
2798
2799         * allocatestack.c: Don't declare __libc_stack_end.
2800         * init.c (__pthread_initialize_minimal_internal): Likewise.
2801         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
2802
2803 2004-01-15  Richard Henderson  <rth@redhat.com>
2804
2805         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
2806         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
2807         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
2808         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
2809         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
2810         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
2811         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
2812         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
2813
2814 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
2815
2816         * init.c (pthread_functions): Make array const.
2817
2818 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
2819
2820         * allocatestack.c (__make_stacks_executable): Change interface.
2821         Check parameters.  Pass parameter on to libc counterpart.
2822         * pthreadP.h: Change declaration.
2823
2824 2004-01-13  Richard Henderson  <rth@redhat.com>
2825
2826         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
2827         prototype form.
2828         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
2829         Likewise.
2830
2831         * sysdeps/alpha/Makefile: New file.
2832         * sysdeps/alpha/tcb-offsets.sym: New file.
2833         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2834         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
2835
2836         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
2837         on powerpc version.
2838
2839 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
2840
2841         * Makefile (tests): Add tst-backtrace1.
2842         * tst-backtrace1.c: New test.
2843
2844 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
2845
2846         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
2847         register as second parameter to the REGISTER macro.
2848         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
2849         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
2850         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
2851         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
2852         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
2853         of thread register as second parameter to REGISTER macro in 64 case.
2854
2855 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
2856
2857         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
2858         (CFLAGS-getpid.o): Defined.
2859         (CFLAGS-getpid.os): Defined.
2860
2861 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
2862
2863         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
2864         returned for main thread does not overlap with any other VMA.
2865         Patch by Jakub Jelinek.
2866
2867 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
2868
2869         * tst-raise1.c: Include stdio.h.
2870
2871 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
2872
2873         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
2874         setting with __ASSUME_TGKILL || defined __NR_tgkill.
2875         If pid is 0, set it to selftid.
2876         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
2877         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
2878         != 0, return self->tid without doing a syscall.
2879         * descr.h (struct pthread): Move pid field after tid.
2880
2881         * Makefile (tests): Add tst-raise1.
2882         * tst-raise1.c: New file.
2883
2884 2003-12-23  Roland McGrath  <roland@redhat.com>
2885
2886         * tst-oddstacklimit.c: New file.
2887         * Makefile (tests): Add it.
2888         (tst-oddstacklimit-ENV): New variable.
2889
2890         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
2891         value up to page size for __default_stacksize.
2892
2893 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
2894
2895         * Makefile (tests): Add tst-eintr5.
2896         * tst-eintr5.c: New file.
2897
2898         * eintr.c (eintr_source): Prevent sending signal to self.
2899
2900         * tst-eintr2.c (tf1): Improve error message.
2901
2902 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
2903
2904         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
2905         * sysdeps/unix/sysv/linux/getpid.c: New file.
2906         * pthread_cancel.c: Add comment explaining use of PID field.
2907         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2908         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
2909         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
2910         temporarily to signal the field must not be relied on and updated
2911         by getpid().
2912         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
2913         temporarily negative.
2914         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2915
2916 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
2917
2918         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
2919         (eintr_source): If ARG != NULL, use pthread_kill.
2920         * tst-eintr1.c: Adjust for this change.
2921         * tst-eintr2.c: Likewise.
2922         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
2923         * tst-eintr3.c: New file.
2924         * tst-eintr4.c: New file.
2925
2926 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
2927
2928         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
2929         if CANCELSTATE_BITMASK is set.
2930         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
2931         Likewise.
2932
2933         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
2934         (tests-reverse): Add tst-cancel23.
2935         * tst-cancel22.c: New test.
2936         * tst-cancel23.c: New test.
2937
2938 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
2939
2940         * tst-eintr1.c: Better error messages.
2941
2942         * Makefile (tests): Add tst-eintr2.
2943         * tst-eintr2.c: New file.
2944
2945 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
2946
2947         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
2948         (CFLAGS-tst-cancelx21.c): Set.
2949         * tst-cancel21.c: New test.
2950         * tst-cancelx21.c: New test.
2951
2952         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
2953         comparison operand.
2954         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
2955         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
2956         * pt-longjmp.c: Include jmpbuf-unwind.h.
2957         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
2958         _JMPBUF_UNWINDS.  Adjust compared pointers.
2959         * init.c (__pthread_initialize_minimal_internal): Initialize
2960         pd->stackblock_size.
2961         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
2962         * sysdeps/alpha/jmpbuf-unwind.h: New file.
2963         * sysdeps/i386/jmpbuf-unwind.h: New file.
2964         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
2965         * sysdeps/s390/jmpbuf-unwind.h: New file.
2966         * sysdeps/sh/jmpbuf-unwind.h: New file.
2967         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
2968         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
2969         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
2970         (_JMPBUF_CFA_UNWINDS): Remove.
2971         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
2972
2973 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
2974
2975         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
2976         (CFLAGS-tst-cancelx20.c): Set.
2977         * tst-cancel20.c: New test.
2978         * tst-cancelx20.c: New test.
2979
2980 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
2981
2982         * init.c (__pthread_initialize_minimal_internal): Don't treat
2983         architectures with separate register stack special here when
2984         computing default stack size.
2985
2986 2003-12-17  Roland McGrath  <roland@redhat.com>
2987
2988         * Makefile (tst-cancelx7-ARGS): New variable.
2989         Reportd by Greg Schafer <gschafer@zip.com.au>.
2990
2991 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
2992
2993         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
2994         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
2995         (tst-stack3-ENV): Set.
2996         ($(objpfx)tst-stack3-mem): New.
2997         * tst-stack3.c: New test.
2998
2999 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
3000
3001         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
3002         Add unwind directives.  Drop unused .regstk directive.
3003         (_fini_EPILOG_BEGINS): Add unwind directives.
3004
3005 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
3006
3007         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3008         Assume parameter is a pointer.
3009         (lll_futex_wake): Likewise.
3010         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
3011         Likewise.
3012         (lll_futex_wake): Likewise.
3013         Reported by Boris Hu.
3014         * sysdeps/unix/sysv/linux/unregister-atfork.c
3015         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
3016
3017         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
3018
3019 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
3020
3021         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
3022         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
3023         __rtld_lock_initialize for ld.so lock.
3024         Patch in part by Adam Li <adam.li@intel.com>.
3025
3026 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
3027
3028         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
3029         in $(gnulib).  Also, remove stale comment.
3030
3031 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
3032
3033         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
3034         advantage of new syscall stub and optimize accordingly.
3035
3036         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
3037         from SYS_futex, to match expectations of
3038         sysdep.h:DO_INLINE_SYSCALL.
3039         (lll_futex_clobbers): Remove.
3040         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
3041         (lll_futex_wake): Likewise.
3042         (lll_futex_requeue): Likewise.
3043         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
3044         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
3045         Jelinek).
3046         (__lll_mutex_lock): Likewise.
3047         (__lll_mutex_cond_lock): Likewise.
3048         (__lll_mutex_timed_lock): Likewise.
3049         (__lll_mutex_unlock): Likewise.
3050         (__lll_mutex_unlock_force): Likewise.
3051
3052         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
3053         comes before the include of <sysdep.h>.
3054         (THREAD_SELF_SYSINFO): New macro.
3055         (THREAD_SYSINFO): Likewise.
3056         (INIT_SYSINFO): New macro.
3057         (TLS_INIT_TP): Call INIT_SYSINFO.
3058
3059         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
3060
3061         * sysdeps/pthread/createthread.c (create_thread): Use
3062         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
3063         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
3064         THREAD_SELF_SYSINFO instead of open code.
3065         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
3066         (THREAD_SYSINFO): Likewise.
3067
3068         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
3069
3070         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
3071
3072 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
3073
3074         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
3075         instead of .init.  Patch by David Mosberger.
3076
3077 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
3078
3079         * sysdeps/pthread/configure.in: Remove broken declaration in C
3080         cleanup handling check.
3081
3082 2003-11-30  Andreas Jaeger  <aj@suse.de>
3083
3084         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
3085         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
3086         Likewise.
3087
3088 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
3089
3090         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
3091         * pthread_attr_destroy.c: Include shlib-compat.h.
3092         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
3093         is set in iattr->flags.
3094         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
3095
3096 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
3097
3098         * Makefile (distribute): Add tst-cleanup4aux.c.
3099
3100         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
3101         include.
3102
3103 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
3104
3105         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
3106         pthread_cond_signal.
3107
3108         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
3109         store mutex address if the current value is ~0l.
3110         * sysdeps/pthread/pthread_cond_timedwait.c
3111         (__pthread_cond_timedwait): Likewise.
3112         * sysdeps/pthread/pthread_cond_broadcast.c
3113         (__pthread_cond_broadcast): Don't use requeue for pshared
3114         condvars.
3115
3116         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
3117         (__pthread_cond_wait): Don't store mutex address if the current
3118         value is ~0l.
3119         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
3120         (__pthread_cond_timedwait): Likewise.
3121         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
3122         (__pthread_cond_broadcast): Don't use requeue for pshared
3123         condvars.
3124
3125         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
3126         element with ~0l for pshared condvars, with NULL otherwise.
3127
3128         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
3129         (__pthread_cond_wait): Don't store mutex address if the current
3130         value is ~0l.
3131         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3132         (__pthread_cond_timedwait): Likewise.
3133         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
3134         (__pthread_cond_broadcast): Don't use requeue for pshared
3135         condvars.
3136
3137         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
3138         * tst-cond12.c: New file.
3139         * tst-cond13.c: New file.
3140
3141 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
3142
3143         * sysdeps/pthread/configure.in: Make missing forced unwind support
3144         fatal.
3145
3146 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
3147
3148         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
3149
3150 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
3151
3152         * Makefile: Add magic to clean up correctly.
3153
3154 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
3155
3156         * unwind.c (FRAME_LEFT): Define.
3157         (unwind_stop): Handle old style cleanups here.
3158         (__pthread_unwind): Handle old style cleanups only if
3159         !HAVE_FORCED_UNWIND.
3160         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
3161         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
3162         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
3163         ($(objpfx)tst-cleanupx4): Likewise.
3164         * tst-cleanup4.c: New test.
3165         * tst-cleanup4aux.c: New.
3166         * tst-cleanupx4.c: New test.
3167
3168 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
3169
3170         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
3171         lll_mutex_*lock macros to skip atomic operations on some archs.
3172
3173 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
3174
3175         * sysdeps/pthread/tst-timer.c (main): Initialize
3176         sigev2.sigev_value as well.
3177
3178 2003-10-15  Roland McGrath  <roland@redhat.com>
3179
3180         * sysdeps/pthread/configure.in: Barf if visibility attribute support
3181         is missing.
3182         * sysdeps/pthread/configure: Regenerated.
3183
3184 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3185
3186         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
3187         locking macros.  No distinction between normal and mutex locking
3188         anymore.
3189         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
3190         Merge bits from lowlevelmutex.S we still need.
3191         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
3192         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
3193         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
3194         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
3195         new mutex implementation.
3196         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
3197         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
3198         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3199         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3200         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
3201         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3202         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3203         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3204         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3205         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
3206         symbol for entry point to avoid cancellation.
3207
3208 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
3209
3210         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
3211         changes.
3212         (SAVE_OLDTYPE_0): Fix a typo.
3213
3214 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
3215
3216         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3217         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
3218
3219 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
3220
3221         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
3222         correct offset.
3223
3224 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
3225
3226         * Makefile (tests): Add tst-cancel19.
3227         * tst-cancel19.c: New test.
3228
3229 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
3230
3231         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
3232         restoring of the old cancellation type.
3233
3234 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
3235
3236         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
3237
3238 2003-09-27  Wolfram Gloger  <wg@malloc.de>
3239
3240         * sysdeps/pthread/malloc-machine.h: New file
3241
3242 2003-09-24  Roland McGrath  <roland@redhat.com>
3243
3244         * allocatestack.c (__make_stacks_executable): Don't ignore return
3245         value from _dl_make_stack_executable.
3246
3247 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
3248
3249         * allocatestack.c (__make_stacks_executable): Also change
3250         permission of the currently unused stacks.
3251
3252         * allocatestack.c (change_stack_perm): Split out from
3253         __make_stacks_executable.
3254         (allocate_stack): If the required permission changed between the time
3255         we started preparing the stack and queueing it, change the permission.
3256         (__make_stacks_executable): Call change_stack_perm.
3257
3258         * Makefile: Build tst-execstack-mod locally.
3259         * tst-execstack-mod.c: New file.
3260
3261 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
3262
3263         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
3264
3265 2003-09-23  Roland McGrath  <roland@redhat.com>
3266
3267         * tst-execstack.c: New file.
3268         * Makefile (tests): Add it.
3269         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
3270         (LDFLAGS-tst-execstack): New variable.
3271
3272         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
3273         whether to use PROT_EXEC for stack mmap.
3274         (__make_stacks_executable): New function.
3275         * pthreadP.h: Declare it.
3276         * init.c (__pthread_initialize_minimal_internal): Set
3277         GL(dl_make_stack_executable_hook) to that.
3278
3279 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
3280
3281         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
3282         recommendation from AMD re avoidance of lock prefix.
3283
3284 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
3285
3286         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
3287         lll_futex_timed_wait instead of lll_futex_wait.
3288         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
3289         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
3290         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
3291         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
3292         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
3293         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
3294         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
3295         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
3296         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
3297         Completely revamp the locking macros.  No distinction between
3298         normal and mutex locking anymore.
3299         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3300         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
3301         __lll_lock_timedwait): Fix prototypes.
3302         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
3303         __lll_lock_timedwait): Likewise.
3304         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
3305         macros, add __builtin_expect.
3306         (lll_mutex_timedlock): Likewise.  Fix return value.
3307         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
3308         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
3309         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
3310         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
3311         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
3312         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
3313         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
3314         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
3315
3316 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
3317
3318         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3319         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
3320         operation if possible.
3321
3322         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
3323         like jumping over the lock prefix.
3324
3325 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
3326
3327         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
3328         locking macros.  No distinction between normal and mutex locking
3329         anymore.
3330         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3331         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3332         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3333         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
3334         locking.  Merge bits from lowlevelmutex.S we still need.
3335         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3336         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
3337         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
3338         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
3339         * Makefile (routines): Remove libc-lowlevelmutex.
3340         (libpthread-rountines): Remove lowlevelmutex.
3341         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
3342         for new mutex implementation.
3343         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3344         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3345         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3346         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3347         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3348         Likewise.
3349         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3350         Likewise.
3351         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
3352         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3353         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
3354         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3355         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3356         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3357         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3358         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3359         Likewise.
3360         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3361         Likewise.
3362         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
3363         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3364         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3365         Don't use requeue.
3366         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3367         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
3368
3369 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
3370
3371         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
3372         in parameters of asm with output parameters.
3373
3374         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
3375         type of DECR parameter to int.
3376         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
3377
3378 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
3379
3380         * tst-attr3.c (tf, do_test): Print stack start/end/size and
3381         guardsize for each thread.
3382
3383 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
3384
3385         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
3386         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
3387         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
3388
3389         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
3390         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
3391         NULL.
3392         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
3393         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
3394         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
3395         (pthread_getaffinity_np): Add hidden_def.
3396
3397         * Makefile (tests): Add tst-attr3.
3398         * tst-attr3.c: New test.
3399
3400         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
3401
3402 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
3403
3404         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
3405         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
3406
3407 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
3408
3409         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
3410         * tst-align.c: Include tst-stack-align.h.
3411         (tf, do_test): Use TEST_STACK_ALIGN macro.
3412
3413 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
3414
3415         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
3416         variable.
3417
3418 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
3419
3420         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
3421         stack-related values for the initial thread.
3422
3423 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
3424
3425         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
3426
3427 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
3428
3429         * pthread_mutex_lock.c: Minor code rearrangements.
3430
3431 2003-09-05  Roland McGrath  <roland@redhat.com>
3432
3433         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
3434         Instead, include ../nptl_db/db_info.c to do its magic.
3435         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
3436         (__pthread_pthread_key_2ndlevel_size): Likewise.
3437         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
3438         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
3439         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
3440         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
3441         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
3442         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
3443         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
3444         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
3445         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
3446         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
3447         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
3448         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
3449         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
3450         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
3451         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
3452         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
3453         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
3454
3455 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
3456
3457         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
3458         of pthread_t to be compatible with LT.
3459         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3460         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3461         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3462         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3463         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3464         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3465         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3466
3467 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
3468
3469         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
3470
3471 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
3472
3473         * unwind-forcedunwind.c: Move to...
3474         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
3475         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
3476         * sysdeps/pthread/jmpbuf-unwind.h: New file.
3477         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
3478         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
3479         * unwind.c: Include jmpbuf-unwind.h.
3480         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
3481
3482 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
3483
3484         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
3485         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
3486         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
3487         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
3488         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
3489         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
3490         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
3491         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
3492         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
3493         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
3494         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
3495         function.
3496         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
3497         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
3498         * Makefile (tests): Add tst-stack2.
3499         * tst-stack2.c: New test.
3500         * tst-stack1.c: Include limits.h and sys/param.h.
3501         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
3502
3503         * pthread_condattr_setpshared.c: Include errno.h.
3504         (pthread_condattr_setpshared): Return EINVAL if pshared
3505         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
3506
3507         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
3508         defined symbol for entry point to avoid cancellation.
3509         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3510         Likewise.
3511         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3512         Likewise.
3513         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3514         Likewise.
3515         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
3516         Likewise.
3517         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3518         Likewise.
3519         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
3520         __close_nocancel, __read_nocancel, __write_nocancel,
3521         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
3522         libpthread.so or librt.so, define to corresponding function
3523         without _nocancel suffix.
3524         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
3525         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
3526         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
3527
3528         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
3529
3530 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
3531
3532         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
3533         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
3534
3535         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
3536         in subsections has a symbol associated with it.
3537
3538         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
3539         defined symbol for entry point to avoid cancellation.
3540         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
3541
3542 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3543
3544         * Makefile (tests): Add tst-tls5.
3545         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
3546         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
3547         ($(objpfx)tst-tls5): New.
3548         ($(objpfx)tst-tls6.out): Likewise.
3549         (tests): Depend on $(objpfx)tst-tls6.out.
3550         * tst-tls3.c: Include stdint.h and pthreaddef.h.
3551         (do_test): Check pthread_self () return value alignment.
3552         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
3553         (tf): Check pthread_self () return value alignment.
3554         * tst-tls5.c: New test.
3555         * tst-tls5.h: New.
3556         * tst-tls5mod.c: New.
3557         * tst-tls5moda.c: New.
3558         * tst-tls5modb.c: New.
3559         * tst-tls5modc.c: New.
3560         * tst-tls5modd.c: New.
3561         * tst-tls5mode.c: New.
3562         * tst-tls5modf.c: New.
3563         * tst-tls6.sh: New test.
3564
3565         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
3566         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
3567         * init.c (pthread_functions): Initialize them.
3568         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
3569         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
3570         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
3571         pthread_cond_timedwait@@GLIBC_2.3.2.
3572
3573 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3574
3575         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
3576         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
3577         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
3578         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
3579         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
3580         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
3581
3582         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
3583
3584         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
3585         _POSIX_THREAD_PRIORITY_SCHEDULING.
3586         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3587
3588 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
3589
3590         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
3591         nested function, use static inline function from libio.h.
3592         Code by Richard Henderson.
3593
3594         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
3595         weak.
3596
3597 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
3598
3599         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
3600         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
3601         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
3602         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
3603         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
3604         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
3605         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
3606         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
3607         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
3608         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
3609         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
3610         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
3611         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
3612         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
3613         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
3614         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
3615         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
3616         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
3617         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
3618         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
3619         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
3620         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
3621         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
3622         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
3623         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
3624         * sysdeps/sparc/tls.h: New file.
3625         * sysdeps/sparc/tcb-offsets.sym: New file.
3626         * sysdeps/sparc/Makefile: New file.
3627         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
3628         * init.c [__sparc__] (__NR_set_tid_address): Define.
3629
3630 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
3631
3632         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
3633         _IO_release_lock): Define.
3634
3635 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
3636
3637         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
3638         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
3639
3640 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
3641
3642         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
3643         (__pthread_cleanup_class): Add missing return types of member
3644         functions.
3645
3646 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
3647
3648         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3649         (lll_mutex_unlock_force): Add memory barrier between store and futex
3650         syscall.
3651
3652 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
3653
3654         * tst-cancel4.c (do_test): Also unlink tempfname and remove
3655         tempmsg in first loop.
3656
3657 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
3658
3659         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3660         _POSIX_THREAD_PRIORITY_SCHEDULING.
3661         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3662
3663 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3664
3665         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
3666         (__rtld_lock_default_lock_recursive,
3667         __rtld_lock_default_unlock_recursive): Define.
3668         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
3669         __rtld_lock_unlock_recursive): Define using
3670         GL(_dl_rtld_*lock_recursive).
3671         * init.c (__pthread_initialize_minimal_internal): Initialize
3672         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
3673         Lock GL(_dl_load_lock) the same number of times as
3674         GL(_dl_load_lock) using non-mt implementation was nested.
3675
3676         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
3677         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
3678
3679 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
3680
3681         * tst-cancel17.c (do_test): Make len2 maximum of page size and
3682         PIPE_BUF.
3683
3684 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3685
3686         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
3687
3688 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
3689
3690         * sysdeps/pthread/createthread.c (do_clone): Move error handling
3691         to first syscall error check.  Move syscall error check for tkill
3692         into __ASSUME_CLONE_STOPPED #ifdef.
3693
3694 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
3695
3696         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
3697         is not defined, do explicit synchronization.
3698         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
3699         is not defined also unlock pd->lock for non-debugging case in case
3700         it is necessary.
3701         * pthread_create.c (start_thread): Always get and release pd->lock
3702         if __ASSUME_CLONE_STOPPED is not defined.
3703         (start_thread_debug): Removed.  Adjust users.
3704         * allocatestack.c (allocate_stack): Always initialize lock if
3705         __ASSUME_CLONE_STOPPED is not defined.
3706         * Makefile (tests): Add tst-sched1.
3707         * tst-sched1.c: New file.
3708
3709         * sysdeps/pthread/createthread.c (do_clone): Only use
3710         sched_setschduler and pass correct parameters.
3711
3712 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3713
3714         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
3715         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
3716         PTHREAD_STACK_MIN in comments.
3717
3718 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3719
3720         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3721         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
3722         argument.
3723         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
3724         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
3725         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
3726         (__pthread_cleanup_upto): Fix prototype.
3727         (_longjmp_unwind): Adjust caller.
3728         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
3729         Change second argument to const struct pointer.
3730         * tst-sem8.c (main): Remove unused s2 and s3 variables.
3731         * tst-sem9.c (main): Likewise.
3732         * unwind.c: Include string.h for strlen prototype.
3733
3734 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
3735
3736         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3737         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
3738         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
3739         Define HAVE_CMOV.
3740         Patch by Nicholas Miell <nmiell@attbi.com>.
3741
3742 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
3743
3744         * init.c (__pthread_initialize_minimal_internal): Initialize
3745         GL(dl_init_static_tls).
3746         * pthreadP.h (__pthread_init_static_tls): New prototype.
3747         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
3748         New functions.
3749         * Makefile (tests): Add tst-tls4.
3750         (modules-names): Add tst-tls4moda and tst-tls4modb.
3751         ($(objpfx)tst-tls4): Link against libdl and libpthread.
3752         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
3753         tst-tls4modb.so.
3754         * tst-tls4.c: New file.
3755         * tst-tls4moda.c: New file.
3756         * tst-tls4modb.c: New file.
3757
3758 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
3759
3760         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
3761         before __timer_dealloc.
3762         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
3763         Don't call list_unlink.
3764
3765 2003-07-29  Roland McGrath  <roland@redhat.com>
3766
3767         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
3768
3769 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
3770
3771         * tst-cancel17.c (do_test): Check if aio_cancel failed.
3772         Don't reuse struct aiocb A if it failed.
3773         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
3774         not just one byte, as that does not block.
3775
3776 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
3777
3778         * sysdeps/pthread/unwind-resume.c: New file.
3779         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
3780         unwind-resume in csu subdir.
3781         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
3782         exceptions.
3783         (librt-sysdep_routines, librt-shared-only-routines): Add
3784         rt-unwind-resume.
3785         * sysdeps/pthread/rt-unwind-resume.c: New file.
3786         * unwind-forcedunwind.c: New file.
3787         * Makefile (libpthread-routines): Add unwind-forcedunwind.
3788         (libpthread-shared-only-routines): Likewise.
3789         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
3790         * pthreadP.h (pthread_cancel_init): New prototype.
3791         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
3792
3793         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
3794         attr argument const struct pthread_attr *.
3795
3796         * res.c (__res_state): Return __resp.
3797         * descr.h: Include resolv.h.
3798         (struct pthread): Add res field.
3799         * pthread_create.c: Include resolv.h.
3800         (start_thread): Initialize __resp.
3801         * Makefile (tests): Add tst-_res1.
3802         (module-names): Add tst-_res1mod1, tst-_res1mod2.
3803         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
3804         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
3805         libpthread.
3806         * tst-_res1.c: New file.
3807         * tst-_res1mod1.c: New file.
3808         * tst-_res1mod2.c: New file.
3809
3810 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
3811
3812         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
3813
3814         * Makefile: Define various *-no-z-defs variables for test DSOs
3815         which has undefined symbols.
3816
3817 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
3818
3819         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3820         Retry if the stwcx fails to store once_control.
3821
3822 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
3823
3824         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
3825         pthread_attr_setaffinity.
3826         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
3827         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
3828         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
3829         * pthread_attr_destroy.c: Free cpuset element if allocated.
3830         * pthread_create.c: Pass iattr as additional parameter to
3831         create_thread.
3832         * sysdeps/pthread/createthread.c: If attribute is provided and
3833         a new thread is created with affinity set or scheduling parameters,
3834         start thread with CLONE_STOPPED.
3835         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
3836         pthread_attr_setaffinity.
3837         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
3838         cpuset element.
3839
3840 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
3841
3842         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
3843
3844 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
3845
3846         * sysdeps/pthread/configure.in: Require CFI directives also for
3847         ppc and s390.
3848
3849 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
3850
3851         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3852         Add cfi directives.
3853
3854 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3855
3856         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
3857         CLEANUP_JMP_BUF.
3858         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
3859         registers as variables.  Call __pthread_mutex_unlock_usercnt.
3860         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3861         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
3862         not self pointer in __writer.  Compare with TID to determine
3863         deadlocks.
3864         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3865         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
3866         Likewise.
3867         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
3868         Likewise.
3869         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
3870         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
3871         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
3872         macros also when compiling librt.
3873
3874 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
3875
3876         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
3877         -fasynchronous-unwind-tables.
3878         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3879         (PSEUDO): Add cfi directives.
3880         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
3881         Likewise.
3882         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3883         Likewise.
3884
3885 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
3886
3887         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
3888         __pthread_unregister_cancel): Add prototypes and hidden_proto.
3889         * unwind.c (__pthread_unwind_next): Add hidden_def.
3890         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
3891         Likewise.
3892         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3893         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
3894         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3895         Likewise.
3896         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
3897         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
3898         Likewise.
3899         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
3900         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
3901         __pthread_unregister_cancel and __pthread_unwind_next.
3902
3903 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
3904
3905         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
3906         different symbol for the cancellation syscall wrapper and
3907         non-cancellation syscall wrapper.
3908         (PSEUDO_END): Define.
3909
3910 2003-07-05  Richard Henderson  <rth@redhat.com>
3911
3912         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
3913         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
3914         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3915         return actual return value from the syscall, not 0.
3916
3917 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
3918
3919         * descr.h (struct pthread): Add pid field.
3920         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
3921         (__reclaim_stacks): Likewise.
3922         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
3923         also check for PID of the signal source.
3924         (__pthread_initialize_minimal_internal): Also initialize pid field
3925         of initial thread's descriptor.
3926         * pthread_cancel.c: Use tgkill instead of tkill if possible.
3927         * sysdeps/unix/sysv/linux/fork.c: Likewise.
3928         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
3929         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
3930         * sysdeps/unix/sysv/linux/raise.c: Likewise.
3931
3932 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
3933
3934         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
3935         Fix use of parameter.
3936         (__libc_cleanup_pop): Likewise.
3937
3938 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
3939
3940         * init.c (sigcancel_handler): Change parameters to match handler
3941         for SA_SIGACTION.  Check signal number and code to recognize
3942         invalid invocations.
3943
3944 2003-07-03  Roland McGrath  <roland@redhat.com>
3945
3946         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
3947         Apply sizeof (struct pthread) bias to r13 value.
3948
3949 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
3950
3951         * sysdeps/pthread/configure.in: Require CFI directives.
3952
3953         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
3954         definition.
3955         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
3956         libpthread compilation.
3957         * unwind.c (__pthread_unwind): Add hidden_def.
3958         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
3959
3960 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3961
3962         * libc-cancellation.c (__libc_cleanup_routine): Define.
3963         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
3964         (__pthread_cleanup_pop): Define.
3965
3966 2003-07-01  Richard Henderson  <rth@redhat.com>
3967
3968         * sysdeps/alpha/elf/pt-initfini.c: New file.
3969         * sysdeps/alpha/pthread_spin_lock.S: New file.
3970         * sysdeps/alpha/pthread_spin_trylock.S: New file.
3971         * sysdeps/alpha/pthreaddef.h: New file.
3972         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
3973         * sysdeps/alpha/tls.h: New file.
3974         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
3975         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
3976         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
3977         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
3978         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
3979         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
3980         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
3981         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
3982         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
3983         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
3984
3985 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3986
3987         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
3988         cleanup support and unwind info.
3989
3990 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
3991
3992         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3993         Use correct cleanup handler registration.  Add unwind info.
3994         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
3995         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
3996         * tst-once3.c: Add cleanup handler and check it is called.
3997         * tst-once4.c: Likewise.
3998         * tst-oncex3.c: New file.
3999         * tst-oncex4.c: New file.
4000         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
4001
4002 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
4003
4004         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
4005
4006 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
4007
4008         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
4009         (tf_msgsnd): Likewise.
4010
4011         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
4012         premature returns a bit more.
4013
4014 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
4015
4016         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
4017         definition to the front.
4018
4019         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
4020         the cleanup functions to make the names unique.  Fix dwarf opcode
4021         un unwind table.
4022         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
4023         functions to make the names unique.  Fix CFA offset for two blocks.
4024
4025 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
4026
4027         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
4028         missing closing braces.
4029         Patch by Christophe Saout <christophe@saout.de>.
4030
4031 2003-06-24  Roland McGrath  <roland@redhat.com>
4032
4033         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
4034
4035 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
4036
4037         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
4038         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
4039
4040         * pthreadP.h: Declare __find_thread_by_id.
4041         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
4042         * pthread_clock_gettime.c: Allow using other thread's clock.
4043         * pthread_clock_settime.c: Likewise.
4044         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
4045         * Makefile: Add rules to build and run tst-clock2.
4046         * tst-clock2.c: New file.
4047
4048 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
4049
4050         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
4051         to use exception-based cleanup handler.
4052         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4053
4054         * tst-cond8.c (ch): Announce that we are done.
4055
4056         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
4057
4058         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
4059         Also test aio_suspend with timeout value.
4060
4061 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
4062
4063         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
4064         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
4065         attribute_hidden.
4066
4067         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
4068         (__pthread_mutex_lock_internal): Likewise.
4069         (__pthread_mutex_unlock_internal): Likewise.
4070         (__pthread_mutex_unlock_usercnt): Declare.
4071         * pthread_mutex_destroy.c: Always fail if used in any way.
4072         * pthread_mutex_init.c: Update comment.
4073         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
4074         * pthread_mutex_timedlock.c: Adjust __nusers.
4075         * pthread_mutex_trylock.c: Adjust __nusers.
4076         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
4077         and public interfaces are wrapper with pass additional parameter.
4078         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
4079         parameter zero.
4080         * tst-mutex8.c: New file.
4081         * Makefile (tests): Add tst-mutex8.
4082         * sysdeps/pthread/pthread_cond_timedwait.c: Call
4083         __pthread_mutex_unlock_usercnt.
4084         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4085         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4086         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4087         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4088         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4089         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
4090         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
4091         Add __nusers.
4092         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4093         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4094         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4095         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4096         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4097
4098         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
4099         * pthread_mutex_timedlock.c: Likewise.
4100         * pthread_mutex_trylock.c: Adjust __nusers.
4101         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
4102         * tst-mutex9.c: New file.
4103         * Makefile (tests): Add tst-mutex9.
4104         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
4105         * sysdeps/ia64/tls.h: Likewise.
4106         * sysdeps/powerpc/tls.h: Likewise.
4107         * sysdeps/s390/tls.h: Likewise.
4108         * sysdeps/sh/tls.h: Likewise.
4109         * sysdeps/x86_64/tls.h: Likewise.
4110         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
4111         Change type of __owner.
4112         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4113         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4114         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4115         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4116         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4117
4118 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
4119
4120         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
4121         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
4122
4123         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
4124         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
4125         instead of nr to lll_futex_wake.  Only set errno and return -1
4126         if err < 0.
4127
4128         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
4129         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
4130         return actual return value from the syscall, not 0.
4131
4132 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
4133
4134         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
4135         find a random value.
4136         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
4137         errno==EIDRM.
4138
4139         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
4140         compat_timer_settime.
4141         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
4142         compat_timer_gettime.
4143         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
4144         compat_timer_getoverrun.
4145         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
4146         compat_timer_delete.
4147
4148         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
4149         error-checking mutex detect busy mutexes.
4150
4151 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
4152
4153         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
4154         Add ax to clobber list.
4155         (lll_mutex_cond_lock): Likewise.
4156         (lll_mutex_unlock): Likewise.
4157         (lll_lock): Likewise.
4158         (lll_unlock): Likewise.
4159
4160         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
4161         * tst-cancel18.c: New file.
4162         * tst-cancelx18.c: New file.
4163
4164         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
4165         and tcdrain.
4166
4167         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
4168         * tst-cancel17.c: New file.
4169         * tst-cancelx17.c: New file.
4170
4171         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
4172         * sysdeps/unix/sysv/linux/sigwait.c: New file.
4173         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
4174
4175         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
4176
4177 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
4178
4179         * sysdeps/pthread/createthread.c (create_thread): Set
4180         header.multiple_threads unconditionally.
4181         * allocatestack.c (allocate_stack): Likewise.
4182         * descr.h (struct pthread): Add header.multiple_threads
4183         unconditionally.
4184         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
4185         Define for librt.  #error if neither libpthread, libc nor librt.
4186         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
4187         Likewise.
4188         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
4189         CDISABLE): Likewise.
4190         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
4191         CDISABLE): Likewise.
4192         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
4193         CDISABLE): Likewise.
4194         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
4195         CDISABLE): Likewise.  Access header.multiple_threads outside of
4196         libc and libpthread.
4197         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
4198         Likewise.
4199         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
4200         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
4201
4202 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
4203
4204         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
4205         Also test early cancellation before the thread reaches the cancellation
4206         point.
4207
4208         * Makefile: Compile forward.c with exceptions.
4209
4210         * sysdeps/unix/sysv/linux/sleep.c: New file.
4211
4212 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
4213
4214         * Makefile: Add CFLAGS definition to compile function wrappers
4215         duplicated from libc with exceptions.
4216         * tst-cancel4.c: Also check cancellation handlers.
4217
4218         * Makefile: Add rules to build and run tst-cancel16 and
4219         tst-cancelx16.  Add missing CFLAGS definitions.
4220         * tst-cancel16.c: New file.
4221         * tst-cancelx16.c: New file.
4222
4223 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
4224
4225         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4226         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
4227         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
4228         (DL_SYSINFO_IMPLEMENTATION): Likewise.
4229
4230         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
4231         (LIBC_CANCEL_RESET): Likewise.
4232         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
4233         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
4234         librt-cancellation.
4235         (CFLAGS-libcrt-cancellation.c): Define.
4236         * sysdeps/pthread/librt-cancellation.c: New file.
4237         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
4238         macros also when compiling librt.
4239         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4240         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4241         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4242         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4243         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4244         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4245         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4246
4247         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
4248         compat_timer_create.
4249
4250 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
4251
4252         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
4253
4254         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
4255         __register_atfork.
4256         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
4257         Add libc_hidden_def.
4258
4259 2003-06-13  Roland McGrath  <roland@redhat.com>
4260
4261         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
4262         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
4263
4264 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
4265
4266         * allocatestack.c (queue_stack): Always inline.
4267         * ptreadhP.h (__do_cancel): Likewise.
4268
4269 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
4270
4271         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
4272         a typo.
4273
4274 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
4275
4276         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4277         (__pthread_cond_signal): Remove incorrect second addition for
4278         cond_lock!=0.
4279
4280 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
4281
4282         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4283         (__pthread_cond_signal): Use correct futex pointer in
4284         __lll_mutex_lock_wait call.
4285
4286         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4287         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
4288
4289 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
4290
4291         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
4292         cancelable.
4293         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
4294         Likewise.
4295
4296         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
4297         hand-written CFI generation code.  Since ENTRY/END also initiated
4298         CFI frames this caused two CFI sets to be generated.
4299
4300 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
4301
4302         * cleanup_routine.c: New file.
4303         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
4304         * sysdeps/pthread/pthread.h: Add support for fully exception-based
4305         cleanup handling.
4306         * Makefile (libpthread-routines): Add cleanup_routine.
4307         Add more CFLAGS variables to compile with exceptions.  Add comments
4308         why which file needs unwind tables.
4309         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
4310         tests.
4311         * tst-cancelx1.c: New file.
4312         * tst-cancelx2.c: New file.
4313         * tst-cancelx3.c: New file.
4314         * tst-cancelx4.c: New file.
4315         * tst-cancelx5.c: New file.
4316         * tst-cancelx6.c: New file.
4317         * tst-cancelx7.c: New file.
4318         * tst-cancelx8.c: New file.
4319         * tst-cancelx9.c: New file.
4320         * tst-cancelx10.c: New file.
4321         * tst-cancelx11.c: New file.
4322         * tst-cancelx12.c: New file.
4323         * tst-cancelx13.c: New file.
4324         * tst-cancelx14.c: New file.
4325         * tst-cancelx15.c: New file.
4326         * tst-cleanupx0.c: New file.
4327         * tst-cleanupx0.expect: New file.
4328         * tst-cleanupx1.c: New file.
4329         * tst-cleanupx2.c: New file.
4330         * tst-cleanupx3.c: New file.
4331
4332         * tst-cleanup0.c: Make standard compliant.
4333         * tst-cleanup1.c: Likewise.
4334
4335         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
4336         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
4337         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4338         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
4339         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4340         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4341         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
4342         CLEANUP_JMP_BUF.
4343         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4344         * tst-cancel12.c: New file.
4345         * tst-cancel13.c: New file.
4346         * tst-cancel14.c: New file.
4347         * tst-cancel15.c: New file.
4348         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
4349         and tst-cancel15.
4350
4351         * tst-cancel1.c: Add some comments.
4352
4353         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
4354         timeout correctly.
4355
4356 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
4357
4358         * Makefile (CFLAGS-pthread_cancel.c): Define.
4359
4360 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
4361
4362         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
4363         Change type of __writer element to int.
4364         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4365         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4366         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4367         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4368         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4369         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
4370         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4371         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
4372         Compare with TID to determine deadlocks.
4373         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
4374         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4375         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
4376         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4377         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4378         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4379         Likewise.
4380         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4381         Likewise.
4382         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4383         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4384         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4385         Likewise.
4386         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4387         Likewise.
4388         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4389         * Makefile (tests): Add tst-rwlock12.
4390         * tst-rwlock12.c: New file.
4391
4392 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
4393
4394         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
4395         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
4396         Remove bogus hidden_proto.
4397         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
4398         Likewise.
4399         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
4400         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
4401         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
4402         ___lll_mutex_timedlock): Likewise.
4403
4404 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
4405
4406         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4407         (__pthread_cond_signal): Add some code to eventually handle
4408         cond_lock!=0.
4409
4410 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
4411
4412         * Makefile (tests): Add tst-exec4.
4413         (tst-exec4-ARGS): Define.
4414         * tst-exec4.c: New file.
4415
4416 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
4417
4418         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
4419         Also fail if tv_nsec < 0.
4420         (__lll_timedwait_tid): Likewise.
4421         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
4422         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
4423         Likewise.
4424         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
4425         Likewise.
4426         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
4427         Likewise.
4428         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
4429         Likewise.
4430         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
4431         Likewise.
4432         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
4433         Likewise.
4434
4435         * Makefile (tests): Add tst-sem8 and tst-sem9.
4436         * tst-sem8.c: New file.
4437         * tst-sem9.c: New file.
4438         * sem_open.c: Fix creation of in_use record if the file exists but
4439         no internal record.
4440
4441         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
4442         definitions.
4443
4444         * sysdeps/pthread/timer_create.c (timer_create): In case
4445         evp==NULL, assign timer ID to sival_ptr.
4446
4447         * descr.h (struct pthread_unwind_buf): Change type of prev element to
4448         struct pthread_unwind_buf *.
4449         (struct pthread): Likewise for cleanup_jmp_buf element.
4450
4451         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
4452         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
4453         * unwind.c (__pthread_unwind_next): Likewise.
4454
4455 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
4456
4457         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4458         (lll_futex_timed_wait): Use int for futex value parameter.
4459         (lll_futex_wake): Likewise.
4460         (lll_futex_requeue): Likewise.
4461
4462         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
4463         Replace one memory operation with one register operation.
4464
4465         * tst-join4.c (do_test): Fix error message.
4466
4467         * tst-rwlock6.c (do_test): Use correct format specifier.
4468
4469         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4470         (__lll_mutex_lock_wait): Replace one memory operation with one
4471         register operation.
4472         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
4473         (__lll_mutex_lock_wait): Likewise.
4474
4475         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4476         (__lll_mutex_cond_lock): Add one to value parameter of
4477         __lll_lock_wait to reflect reality in the futex syscall.
4478         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4479         (lll_mutex_cond_lock): Likewise.
4480
4481 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
4482
4483         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
4484         New function.
4485         (lll_mutex_cond_lock): Define.
4486
4487 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
4488
4489         * Makefile (tests): Add tst-signal6.
4490         * tst-signal6.c: New file.
4491
4492         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
4493         (__lll_mutex_unlock_force): New function
4494         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
4495
4496         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4497         (__lll_mutex_unlock_force): New function.
4498         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
4499
4500         * tst-rwlock7.c (do_test): Use correct format specifier.
4501
4502         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
4503         Find break parameter in correct asm argument.
4504
4505 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
4506
4507         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
4508         Remove out4.
4509         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
4510         error occured.
4511         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4512         Add __mutex.
4513         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
4514         lll_futex_requeue, lll_mutex_unlock_force): Define.
4515
4516 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
4517
4518         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4519         (pthread_cond_t): Add __mutex.
4520         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
4521         lll_futex_requeue, lll_mutex_unlock_force): Define.
4522
4523 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4524
4525         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
4526         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4527         Add __mutex field.
4528         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
4529         Define.
4530         (lll_futex_wait, lll_futex_wake): Define.
4531         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
4532         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
4533         FUTEX_REQUEUE instead of FUTEX_WAIT.
4534         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
4535         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
4536         mutex which was used in condvar structure.  Call
4537         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
4538         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
4539
4540         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
4541         include tcb-offsets.h.  Read wakeup value in locked region.
4542         Use the value of gbr register as THREAD_ID.
4543         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4544         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4545         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4546
4547         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
4548         macros.
4549
4550 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
4551
4552         * sysdeps/pthread/pthread_cond_broadcast.c
4553         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
4554
4555 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
4556
4557         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
4558         typo in register name.
4559         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
4560         correctly.  Actually use requeue.  Little optimization.
4561         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
4562         mutex address early.  Handle cancellation state as 32-bit value.
4563         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4564         Remove unnecessary label.
4565
4566 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
4567
4568         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
4569         instead of FUTEX_WAIT.
4570         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
4571         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4572         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4573         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4574         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4575         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
4576         used in condvar structure.  Call __pthread_mutex_cond_lock instead
4577         of __pthread_mutex_lock_internal.
4578         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4579         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4580         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4581         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
4582         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4583         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4584         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
4585         Add pthread_mutex_cond_lock.
4586         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
4587         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
4588         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
4589         lll_mutex_cond_lock.
4590         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
4591         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4592         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4593         Add __mutex field.
4594         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4595         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4596
4597         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
4598         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4599
4600         * pthreadP.h: Declare __pthread_mutex_cond_lock.
4601         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
4602         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
4603         macro don't define aliases.
4604
4605         * cancellation.c: Remove __pthread_enable_asynccancel_2.
4606         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
4607         * sysdeps/pthread/pthread_cond_timedwait.c: Use
4608         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
4609         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4610         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4611         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4612         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4613         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4614
4615 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
4616
4617         * sem_open.c: Fix one endless loop.  Implement correct semantics
4618         wrt opening the same semaphore more then once.
4619         * sem_close.c: Adjust for sem_open change.
4620         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
4621         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
4622         * Makefile (tests): Add tst-sem7.
4623         * tst-sem7.c: New file.
4624
4625 2003-05-16  Roland McGrath  <roland@redhat.com>
4626
4627         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
4628         uninitialized variable braino.
4629
4630 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
4631
4632         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
4633         test for syscall availability.
4634
4635         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
4636         __no_posix_timers to -1 if the syscalls don't exist.
4637
4638         * pthread_join.c (pthread_join): Set tid field of the joined
4639         thread to -1.  This isn't necessary but helps to recognize some
4640         error conditions with almost no cost.
4641
4642         * allocatestack.c (FREE_P): Also negative values indicate an
4643         unused stack.
4644
4645         * unwind.c: Include <unistd.h>.
4646
4647 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
4648
4649         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
4650
4651 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
4652
4653         * Makefile (crti-objs, crtn-objs): New variables.
4654         (omit-deps, extra-objs): Add crtn.
4655         ($(objpfx)libpthread.so): Depend on both crti and crtn
4656         and links to them in multidir.
4657         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
4658
4659 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
4660
4661         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4662         (lll_mutex_unlock): Use atomic_exchange_rel.
4663
4664 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
4665
4666         * cond-perf.c (cons): Add missing locking around setting of alldone.
4667
4668 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
4669
4670         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
4671         related macros.
4672         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4673
4674 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
4675
4676         * tst-sem6.c: New file.
4677         * Makefile (tests): Add tst-sem6.
4678
4679         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
4680         Use atomic_exchange_rel instead of atomic_exchange.
4681         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
4682         Likewise.
4683
4684         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
4685         code for lll_futex_wait and lll_futex_wake in static apps.  Use
4686         vsyscall is possible.
4687
4688         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
4689         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
4690         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
4691         pthread_setaffinity_np.
4692         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
4693         and pthread_setaffinity_np.
4694         * Makefile (libpthread-routines): Add pthread_getaffinity and
4695         pthread_setaffinity.
4696
4697         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
4698         use it in case mmap to allocate the stack fails.
4699         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
4700         ARCH_MAP_FLAGS here.
4701         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
4702         ARCH_RETRY_MMAP.
4703
4704 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
4705
4706         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
4707         handler implementation.  It is now lockless in fork().
4708         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
4709         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
4710         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
4711         declare the __fork_*_lists.
4712         (struct fork_handler): Include pointers to all three functions.
4713         Add next, refcntr and need_signal elements.
4714         (__fork_handlers): New declaration.
4715         (__register_atfork_malloc): Remove declaration.
4716         (HAVE_register_atfork_malloc): Remove definition.
4717         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
4718         __pthread_child_handler variable.
4719         (__libc_pthread_init): Use __register_atfork instead of explicitly
4720         adding to the list.
4721         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
4722         and lll_futex_wake.
4723         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4724
4725         * unwind.c (unwind_cleanup): Print error message and then abort.  This
4726         function must never be reached.
4727
4728         * cond-perf.c: New file.
4729
4730 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
4731
4732         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
4733
4734 2003-05-04  Roland McGrath  <roland@redhat.com>
4735
4736         * Makefile ($(objpfx)../libc.so): New target.
4737
4738 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
4739
4740         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4741         (pthread_condattr_t): Size is only an int, don't use long for
4742         alignment.
4743         (pthread_mutexattr_t): Likewise.
4744         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4745         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4746         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4747
4748 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
4749
4750         * sysdeps/i386/tls.h: Define THREAD_ID.
4751         * sysdeps/ia64/tls.h: Likewise.
4752         * sysdeps/powerpc/tls.h: Likewise.
4753         * sysdeps/s390/tls.h: Likewise.
4754         * sysdeps/sh/tls.h: Likewise.
4755         * sysdeps/x86_64/tls.h: Likewise.
4756         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
4757         record ownership.
4758         * pthread_mutex_timedlock.c: Likewise.
4759         * pthread_mutex_trylock.c: Likewise.
4760         * pthread_mutex_unlock.c: Likewise.
4761         * pthread_rwlock_trywrlock.c: Likewise.
4762         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
4763         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4764         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4765         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4766
4767         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
4768         flag.
4769
4770 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
4771
4772         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4773         (__SIZEOF_PTHREAD_COND_T): Define to 48.
4774         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
4775         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4776         Make __align long long instead of long.
4777         (pthread_rwlock_t): Formatting.
4778         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
4779         (pthread_rwlock_t): Formatting.
4780         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4781         (pthread_cond_t): Make __align long long instead of long.
4782         (pthread_rwlock_t): Move __flags field to the same position as in
4783         linuxthreads.
4784
4785 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
4786
4787         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
4788         * tst-rwlock7.c (do_test): Likewise.
4789
4790 2003-04-26  Roland McGrath  <roland@redhat.com>
4791
4792         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
4793
4794 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
4795
4796         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
4797         sizeof (struct pthread).
4798         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
4799         1 struct pthread.
4800         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
4801         to 0.
4802         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
4803         struct pthread.
4804         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
4805         to 32-bit bytes.
4806         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
4807         tcbp.
4808         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
4809         unneccessarily.
4810         (NO_TLS_OFFSET): Define.
4811         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
4812         add TLS_TCB_SIZE unnecessarily.
4813
4814 2003-04-22  Roland McGrath  <roland@redhat.com>
4815
4816         * Makeconfig (shared-thread-library): Reverse link order to work
4817         around linker bug.
4818
4819 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
4820
4821         * semaphore.h: Fix typo in comment.
4822
4823 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
4824
4825         * sysdeps/pthread/sigfillset.c: New file.
4826
4827         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
4828         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
4829         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
4830         * sysdeps/pthread/sigaction.c: Likewise.
4831         * sysdeps/pthread/sigprocmask.c: New file.
4832         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
4833         __SIGRTMIN+1.
4834         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4835         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
4836         in this case.
4837
4838 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
4839
4840         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4841         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
4842
4843         * sysdeps/unix/sysv/linux/unregister-atfork.c
4844         (__unregister_atfork): Don't free memory not allocated dynamically.
4845
4846         * semaphore.h: Remove __THROW marker from cancellation points.
4847         * nptl/sysdeps/pthread/pthread.h: Likewise.
4848
4849 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
4850
4851         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
4852         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
4853         __THROW.
4854
4855 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
4856
4857         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
4858
4859 2003-04-15  Roland McGrath  <roland@redhat.com>
4860
4861         * forward.c (__pthread_unwind): Tweak to avoid warning.
4862
4863 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
4864
4865         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
4866
4867 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
4868
4869         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
4870         overflow CFA advance instructions.
4871         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4872
4873 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
4874
4875         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
4876         * sysdeps/i386/pthread_spin_lock.c: Likewise.
4877         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
4878         defined.
4879
4880         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
4881         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
4882         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
4883         DW_CFA_advance_loc for .Laddl-.Lsubl.
4884
4885 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
4886
4887         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
4888         position-independent unwind data for static libraries.
4889         Add missing unwind info.  Add comments.
4890
4891         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
4892         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4893         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4894         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4895
4896 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
4897
4898         * Makefile: Make sure all cancellation points are compiled with
4899         exception and asynchronous unwind tables.
4900
4901         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
4902         which mishandles loading of global object addresses in PIC.
4903         (THREAD_SETMEM_NC): Likewise.
4904
4905 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4906
4907         * pthread.h: Define new data structure for cleanup buffer.  Declare
4908         new cleanup handler interfaces.
4909         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
4910         (struct pthread): Add cleanup_jmp_buf pointer.  Define
4911         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
4912         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
4913         it.  Declare old cleanup handler installation functions.
4914         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
4915         handling.
4916         * cleanup_defer.c: Likewise.
4917         * cleanup_compat.c: New file.  Old cleanup code.
4918         * cleanup_def_compat.c: New file.  Old cleanup code.
4919         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
4920         if own thread descriptor.
4921         * unwind.c: New file.
4922         * forward.c: Add __pthread_unwind.
4923         * init.c (pthread_functions): Add __pthread_unwind.
4924         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
4925         Add ptr___pthread_unwind.
4926         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
4927         and unwind function.
4928         * Makefile (libpthread-routines): Add cleanup_compat,
4929         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
4930         table generation if necessary.
4931         * version.c: Record whether unwind support is compiled in.
4932         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
4933         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
4934         handler interfaces.
4935         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
4936         complication to generate unwind information for syscall wrappers.
4937         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4938         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
4939         __cleanup_fct_attribute.
4940
4941         * Makefile: Add rules to build and run tst-cleanup0.
4942         * tst-cleanup0.c: New file.
4943         * tst-cleanup0.expect: New file.
4944
4945         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
4946         caller.  Optimize to avoid often unecessary local variable.
4947
4948 2003-04-11  Roland McGrath  <roland@redhat.com>
4949
4950         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
4951         sets variable `multidir'; include that.
4952         (generated): Add it.
4953         ($(objpfx)$(multidir)/crti.o): New target.
4954         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
4955
4956 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4957
4958         * tst-attr2.c (do_test): Add cast to avoid warning.
4959         * tst-mutex4.c (do_test): Likewise.
4960
4961 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
4962
4963         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
4964         in child.
4965
4966 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
4967
4968         * Makefile (tests): Add tst-detach1.
4969         * tst-detach1.c: New file.
4970
4971 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
4972
4973         * sysdeps/pthread/pthread.h: Remove duplicate
4974         pthread_cleanup_{push,pop} definitions.
4975
4976         * tst-barrier2.c: Eliminate warnings.
4977         * tst-cancel4.c: Likewise.
4978         * tst-cond4.c: Likewise.
4979         * tst-cond6.c: Likewise.
4980         * tst-detach1.c: Likewise.
4981         * tst-rwlock4.c: Likewise.
4982         * tst-rwlock6.c: Likewise.
4983         * tst-rwlock7.c: Likewise.
4984         * tst-sem3.c: Likewise.
4985         * tst-spin2.c: Likewise.
4986         * tst-umask1.c: Likewise.
4987
4988 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
4989
4990         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
4991
4992 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
4993
4994         * descr.h (struct pthread): Move cancelhandling member to the front.
4995
4996 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
4997
4998         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
4999         malloc_parent, and malloc_child statically.
5000         (__register_atfork_malloc): New function.
5001         (free_mem): Don't free any of the malloc_* variables on the list.
5002         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
5003         Define HAVE_register_atfork_malloc.
5004
5005 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
5006
5007         * sysdeps/pthread/createthread.c (create_thread): Add some more
5008         comments explaining when to set multiple_threads and when not.
5009
5010         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
5011         THREAD_ATOMIC_BIT_SET if not already defined.
5012         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
5013         THREAD_ATOMIC_BIT_SET:
5014         * sysdeps/x86_64/tls.h: Likewise.
5015         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
5016         THREAD_ATOMIC_CMPXCHG_VAL.
5017         (_pthread_cleanup_pop_restore): Likewise.
5018         * cancellation.c (__pthread_enable_asynccancel): Likewise.
5019         (__pthread_enable_asynccancel_2): Likewise.
5020         (__pthread_disable_asynccancel): Likewise.
5021         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
5022         (__libc_disable_asynccancel): Likewise.
5023         * init.c (sigcancel_handler): Likewise.
5024         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
5025         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
5026
5027 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
5028
5029         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
5030         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
5031         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
5032         * Makefile (tests): Add tst-cancel11.
5033         * tst-cancel11.c: New file.
5034
5035 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
5036
5037         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
5038         round, not the first.  Use specific_used flag instead of local
5039         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
5040         (__free_tcb): Don't call deallocate_tsd here.
5041         (start_thread): Call deallocate_tsd here.
5042         * pthread_setspecific.c: Set specific_used flag really only when
5043         needed.
5044         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
5045         * tst-tsd3.c: New file.
5046         * tst-tsd4.c: New file.
5047
5048 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
5049
5050         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
5051         Use atomic_exchange_and_add instead of __lll_add.
5052         (__lll_mutex_timedlock): Likewise.
5053         Patch by Ian Wienand.
5054
5055 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
5056
5057         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
5058         (SINGLE_THREAD_P): Fix typo.
5059         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
5060
5061 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
5062
5063         * Makefile (tests): Add tst-align.
5064         * tst-align.c: New file.
5065         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
5066
5067         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
5068         function correctly.
5069
5070         * tst-tsd2.c: Add casts to avoid warnings.
5071
5072 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
5073
5074         * descr.h (struct pthread): Move most often used elements to the front.
5075
5076 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
5077
5078         * Makefile (libpthread-routines): Add pthread_atfork.
5079         (libpthread-static-only-routines): Add pthread_atfork.
5080
5081 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5082
5083         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
5084         of TLS_DTV_AT_TP.
5085         (INSTALL_DTV): Add parens.
5086         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
5087         Use passed descr instead of THREAD_SELF.
5088         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
5089         (__lll_mutex_timedlock_wait): Correct expected value after
5090         spurious wakeup.
5091         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
5092         Release lock before waking up the waiters.
5093         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
5094         criteria.  Reorderstruct passed to cleanup handler.  Fix
5095         handling of cancellation and failung pthread_mutex_unlock call.
5096         Use __pthread_enable_asynccancel_2 instead of
5097         __pthread_enable_asynccancel.
5098         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5099         Return result of lock re-get if it fails.
5100         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
5101         for __pthread_cleanup_push.
5102         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
5103         completely broken rwlock implementation.
5104         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5105         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5106         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5107         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5108         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5109         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
5110         versioned_symbol macro.
5111         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
5112         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
5113
5114 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
5115
5116         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
5117         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
5118         and __helper_tid.
5119         (struct timer): Remove th and bar field.
5120         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
5121         debugging code.  Create only one helper thread.
5122         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
5123         helper thread.
5124         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
5125         Renamed.  Define statically.  Use thread info from siginfo.
5126         (__helper_once): New variable.
5127         (__helper_tid): New variable.
5128         (__reset_helper_control): New function.
5129         (__start_helper_thread): New function.
5130
5131         * pthread_create.c (start_thread): Don't use setjmp inside
5132         __builtin_expect to work around gcc bug.
5133
5134         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
5135         timer_delete syscall fails, but not with ENOSYS, set
5136         __no_posix_timers.
5137
5138         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
5139         (timer_settime): Fix typo.
5140         * sysdeps/unix/sysv/linux/timer_getoverr.c
5141         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
5142
5143 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
5144
5145         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
5146         offset of cleanupbuf.__prev.
5147
5148 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
5149
5150         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
5151         of included file.
5152
5153 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
5154
5155         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
5156         NULL provide default definition to syscall.
5157
5158 2003-03-25  Roland McGrath  <roland@redhat.com>
5159
5160         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
5161         (timer_id2ptr): Fix typo.
5162
5163 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
5164
5165         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
5166         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
5167         * sysdeps/ia64/pthreaddef.h: Likewise.
5168         * sysdeps/powerpc/pthreaddef.h: Likewise.
5169         * sysdeps/s390/pthreaddef.h: Likewise.
5170         * sysdeps/sh/pthreaddef.h: Likewise.
5171         * sysdeps/x86_64/pthreaddef.h: Likewise.
5172         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
5173         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
5174         being changed.
5175         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
5176         SIGTIMER is not unblocked.
5177         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
5178         RT signal taken.
5179         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
5180         be send.
5181         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
5182         pass pointer through as ID.
5183         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
5184         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
5185         * sysdeps/unix/sysv/linux/timer_create.c: New file.
5186         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
5187         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
5188         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
5189         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
5190         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
5191         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
5192         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
5193         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
5194         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
5195         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
5196         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
5197         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
5198         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
5199         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
5200         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
5201         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
5202         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
5203         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
5204         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
5205         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
5206         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
5207         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
5208         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
5209         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
5210         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
5211         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
5212         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
5213         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
5214         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
5215         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
5216
5217         * pthreadP.h: Remove FRAME_LEFT definition.
5218         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
5219         already left frame.  Programs which have this problem are not POSIX
5220         compliant.
5221         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
5222
5223 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
5224
5225         * sysdeps/pthread/tst-timer.c: Check return values of the
5226         functions we test.
5227
5228 2003-03-23  Roland McGrath  <roland@redhat.com>
5229
5230         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
5231         * tst-tls3mod.c: Likewise.
5232         * tst-tls1.c: Likewise.
5233         * tst-tls2.c: Likewise.
5234
5235         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
5236         undefined behavior.
5237
5238         * tst-join5.c (tf1, tf2): Add a cast.
5239
5240         * Makeconfig (includes): Append -I$(..)nptl to this variable.
5241
5242         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
5243         Don't test anything.
5244         * tst-cond4.c: Likewise.
5245         * tst-cond6.c: Likewise.
5246         * tst-flock2.c: Likewise.
5247         * tst-mutex4.c: Likewise.
5248         * tst-rwlock4.c: Likewise.
5249         * tst-signal1.c: Likewise.
5250         * tst-spin2.c: Likewise.
5251         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
5252
5253         * tst-mutex4.c: Use test-skeleton.c.
5254         * tst-spin2.c: Likewise.
5255         * tst-sysconf.c: Likewise.
5256         * tst-barrier2.c: Likewise.
5257         * tst-cond4.c: Likewise.
5258         * tst-cond6.c: Likewise.
5259         * tst-rwlock4.c: Likewise.
5260         * tst-unload.c: Likewise.
5261         * tst-flock2.c (do_test): Use return instead of exit.
5262
5263 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
5264
5265         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
5266
5267 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
5268
5269         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
5270         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
5271         instead of __lll_compare_and_swap.
5272         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
5273         Likewise.
5274         Removed definition if __lll_compare_and_swap.
5275
5276         * cancellation.c: Adjust for new form of compare&exchange macros.
5277         * cleanup_defer.c: Likewise.
5278         * init.c: Likewise.
5279         * libc-cancellation.c: Likewise.
5280         * old_pthread_cond_broadcast.c: Likewise.
5281         * old_pthread_cond_signal.c: Likewise.
5282         * old_pthread_cond_timedwait.c: Likewise.
5283         * old_pthread_cond_wait.c: Likewise.
5284         * pthread_cancel.c: Likewise.
5285         * pthread_create.c: Likewise.
5286         * pthread_detach.c: Likewise.
5287         * pthread_join.c: Likewise.
5288         * pthread_key_delete.c: Likewise.
5289         * pthread_setcancelstate.c: Likewise.
5290         * pthread_setcanceltype.c: Likewise.
5291         * pthread_timedjoin.c: Likewise.
5292         * pthread_tryjoin.c: Likewise.
5293         * sysdeps/pthread/createthread.c: Likewise.
5294
5295 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
5296
5297         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
5298         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
5299         definitions.  Replace uses with calls to atomic_* functions.
5300         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5301         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
5302         __lll_test_and_set calls with atomic_exchange_and_add and
5303         atomic_exchange calls respectively.
5304         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
5305         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
5306         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
5307         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
5308         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
5309         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
5310         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
5311
5312         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
5313         returns the old value.
5314
5315 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
5316
5317         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
5318         int for variable OLDVAL and correct inline assembler contraint.
5319         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
5320         type int for variable OLD.
5321
5322         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
5323         only for s390-32.
5324         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
5325         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
5326         instead of multiple_threads field in the TCB.
5327
5328 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
5329
5330         * sysdeps/i386/i686/bits/atomic.h: Removed.
5331         * sysdeps/i386/i586/bits/atomic.h: Removed.
5332         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
5333         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
5334         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
5335         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
5336         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
5337         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
5338         * atomic.h: Removed.  Moved to glibc.
5339
5340         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
5341         support for clock selection.
5342
5343         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
5344         signalling waiters.
5345
5346 2003-03-18  Roland McGrath  <roland@redhat.com>
5347
5348         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
5349         Add __lll_rel_instr first.  Add memory clobber.
5350         (lll_mutex_unlock): Use __lll_test_and_set.
5351         From Paul Mackerras <paulus@samba.org>.
5352
5353         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
5354         unconditionally.
5355         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
5356         (SINGLE_THREAD_P):  Add `header.' prefix.
5357         From Paul Mackerras <paulus@samba.org>.
5358
5359         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
5360         pthread_timedjoin_np to ...
5361         (libpthread: GLIBC_2.3.3): ... here.
5362         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
5363
5364         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5365         Avoid shadowing VAL variable.
5366
5367         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
5368         New macro.
5369
5370 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
5371
5372         * Makefile (tests): Add tst-cond11.
5373         * tst-cond11.c: New file.
5374
5375         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
5376         struct passed to cleanup handler to eliminate one more
5377         instruction.
5378         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5379
5380         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5381         (pthrad_cond_t): Replace __unused field with __clock.
5382
5383         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
5384         waken all waiters in cleanup handler.
5385         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5386         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5387
5388         * pthread_condattr_getclock.c: New file.
5389         * pthread_condattr_setclock.c: New file.
5390         * sysdeps/pthread/pthread.h: Declare these new functions.
5391         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
5392         * Makefile (libpthread-routines): Add the new functions.
5393         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
5394         Renamed field to value.  Document use of the bits.
5395         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
5396         change.
5397         * pthread_condattr_setpshared.c: Likewise.
5398         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
5399         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
5400         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5401         Add __clock field.
5402         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5403         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5404         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5405         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5406         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
5407         Implement clock selection.
5408         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5409         * pthread-errnos.sym: Add ENOSYS.
5410         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5411         _POSIX_CLOCK_SELECTION.
5412         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5413
5414         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
5415         invalid .size directive.
5416
5417 2003-03-17  Roland McGrath  <roland@redhat.com>
5418
5419         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
5420         Formatting tweaks.
5421
5422 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
5423
5424         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
5425         Use __lll_add instead of spelling it out.  Use protected symbol names.
5426         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
5427         Use __lll_add.
5428         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
5429         Renamed from lll_compare_and_swap.  Use new name where necessary.
5430         (__lll_add): Defined.
5431         (__lll_dec_if_positive): Defined.
5432         (__lll_test_and_set): Defined.
5433         * sysdeps/ia64/pthread_spin_init.c: Removed.
5434         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
5435         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
5436         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
5437         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
5438         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
5439         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
5440         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
5441         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
5442         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
5443         __sync_lock_release_si.
5444         Patch by Jakub Jelinek.
5445
5446         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
5447         Fix timeout handling.
5448         (__lll_timedwait_tid): Likewise.
5449         (lll_unlock_wake_cb): Wake up other waiters if necessary.
5450         Patch by Jakub Jelinek.
5451
5452         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
5453
5454 2003-03-17  Roland McGrath  <roland@redhat.com>
5455
5456         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
5457         * sysdeps/pthread/pthread_spin_init.c: New file.
5458         * sysdeps/pthread/pthread_spin_unlock.c: New file.
5459         * sysdeps/powerpc/Makefile: New file.
5460         * sysdeps/powerpc/pthread_spin_lock.c: New file.
5461         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
5462         * sysdeps/powerpc/pthreaddef.h: New file.
5463         * sysdeps/powerpc/tcb-offsets.sym: New file.
5464         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
5465         * sysdeps/powerpc/tls.h: New file.
5466         * sysdeps/powerpc/bits/atomic.h: New file.
5467         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
5468         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
5469         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
5470
5471         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
5472         * sysdeps/unix/sysv/linux/sem_post.c: New file.
5473         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
5474         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
5475         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
5476         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
5477         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
5478         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
5479         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
5480         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
5481         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
5482         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
5483         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
5484         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
5485         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
5486
5487         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
5488         not gettimeofday.
5489         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
5490         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
5491         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
5492         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
5493         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5494
5495 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
5496
5497         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
5498         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5499         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5500         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5501         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
5502
5503 2003-03-16  Roland McGrath  <roland@redhat.com>
5504
5505         * tst-fork4.c: Include <string.h>.
5506         * tst-signal2.c: Likewise.
5507         * tst-mutex5.c (do_test): exit -> return.
5508         * tst-mutex2.c: Include <stdlib.h>.
5509
5510 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
5511
5512         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
5513         (__lll_mutex_timedlock_wait): Correct expected value after
5514         spurious wakeup.  Otherwise we would never wait again.
5515
5516         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
5517         zone versus inline asm stupidity.  Use correct instructions.
5518
5519         * tst-rwlock6.c: Add some more status output.
5520
5521 2003-03-15  Roland McGrath  <roland@redhat.com>
5522
5523         * sysdeps/pthread/configure.in: New file.
5524         * sysdeps/pthread/configure: New file (generated).
5525
5526 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5527
5528         * allocatestack.c (allocate_stack): Store the exact stack size of
5529         user allocated stacks.
5530
5531 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
5532
5533         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
5534         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
5535         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5536         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
5537         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
5538         Use `header.' prefix.
5539         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5540
5541 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5542
5543         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
5544         __builtin_frame_address, use stack pointer.
5545
5546         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
5547         instead of __builtin_frame_pointer.
5548
5549 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5550
5551         * tst-basic1.c (do_test): Add cast to avoid warning.
5552         * tst-basic2.c (do_test): Likewise.
5553
5554         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
5555         amount of stack correction.
5556
5557         * tst-fork4.c: Use test-skeleton.c.
5558
5559 2003-03-14  Roland McGrath  <roland@redhat.com>
5560
5561         * init.c: Fix typo "#eli" for "#else".
5562
5563 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
5564
5565         * allocatestack.c (__stack_user): Use hidden_data_def.
5566         * pthread_create.c (__pthread_keys): Likewise.
5567
5568         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
5569
5570 2003-03-14  Roland McGrath  <roland@redhat.com>
5571
5572         * tst-fork4.c: New file.
5573         * Makefile (tests): Add it.
5574
5575         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
5576         we always define the padding space.
5577         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
5578         stopped supporting its own extensions fully.
5579         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
5580         struct also called `header', so `header.multiple_threads' is the field
5581         name to use on all machines.
5582         * allocatestack.c (allocate_stack): Use `header.' prefix.
5583         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5584         * pthread_create.c (__pthread_create_2_1): Likewise.
5585         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
5586         (THREAD_SELF): Likewise.
5587         * sysdeps/x86_64/tls.h: Likewise.
5588         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5589         (SINGLE_THREAD_P): Likewise.
5590         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5591         (SINGLE_THREAD_P): Likewise.
5592         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
5593         (SINGLE_THREAD_P): Likewise.
5594
5595         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
5596         value directly.
5597
5598 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5599
5600         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
5601         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
5602
5603         * pthread_create.c (start_thread): setjmp is expected to return 0.
5604
5605         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
5606         (THREAD_GETMEM_NC): Likewise.
5607
5608 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
5609
5610         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
5611         and the size of the stack which must be allocated is a multiple,
5612         allocate one more page.
5613         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
5614         MULTI_PAGE_ALIASING.
5615
5616 2003-03-13  Roland McGrath  <roland@redhat.com>
5617
5618         * pthread_create.c (start_thread): Set EXITING_BIT after the
5619         event-reporting (and destructors), not before.
5620
5621 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
5622
5623         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
5624         lll_futex_wake): Declare register variables as long int instead of
5625         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
5626         Make syscall arguments clobbered by the syscall.
5627         (lll_futex_wait): Define using lll_futex_timed_wait.
5628
5629         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
5630         to void *.
5631
5632         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
5633         PPID if [! NDEBUG].
5634
5635         * allocatestack.c (nptl_ncreated): Only declare if
5636         COLORING_INCREMENT != 0.
5637
5638         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
5639         (__libc_enable_asynccancel_2): Remove prototype.
5640
5641         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
5642         ctid to match kernel.
5643
5644 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5645
5646         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
5647         libc_multiple_threads.
5648         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
5649         __libc_multiple_threads to...
5650         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
5651
5652         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
5653         versioning.
5654         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5655         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5656
5657         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
5658         (__pthread_once_internal): Define.
5659
5660         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
5661         macros instead of .symver directly.
5662         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5663         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
5664
5665         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
5666         * sysdeps/x86_64/tcb-offsets.sym: New file.
5667         * sysdeps/x86_64/Makefile: New file.
5668
5669         * sysdeps/i386/tcb-offsets.sym: Add SELF.
5670         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
5671         to access own pthread_t in TCB.
5672         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5673         Likewise.
5674         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5675         Likewise.
5676         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5677
5678 2003-03-12  Roland McGrath  <roland@redhat.com>
5679
5680         * pthread-errnos.sym: New file.
5681         * Makefile (gen-as-const-headers): New variable, list that file.
5682         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
5683         header <pthread-errnos.h> instead of defining errno values here.
5684         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5685         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5686         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5687         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5688         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5689         Likewise.
5690         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5691         Likewise.
5692         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5693         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5694         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5695         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5696         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5697         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5698         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5699         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5700         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5701         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5702         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5703         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
5704         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
5705         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
5706         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
5707         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5708         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5709         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5710         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5711         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5712         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5713         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5714         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
5715         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
5716         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
5717         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5718         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5719
5720         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
5721         CLONE_CHILD_SETTID worked.
5722
5723 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5724
5725         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
5726         file.
5727         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
5728         file.
5729
5730         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5731         (pthread_cond_t): Add padding.
5732
5733         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
5734         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
5735         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
5736
5737         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
5738         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
5739         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
5740         (__pthread_rwlock_timedrdlock): Likewise.
5741         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
5742         (__pthread_rwlock_wrlock): Likewise.
5743         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
5744         (__pthread_rwlock_rdlock): Likewise.
5745
5746         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
5747
5748         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
5749         result of lock re-get if it fails.
5750
5751 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5752
5753         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
5754         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5755         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5756         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5757         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5758         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5759         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5760         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5761         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5762         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5763
5764         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
5765         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
5766
5767         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
5768         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
5769         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
5770         (create_thread): Likewise.
5771         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
5772         * init.c (__pthread_initialize_minimal_internal): Initialize
5773         __libc_multiple_threads_ptr if necessary.
5774         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
5775         __pthread_multiple_threads and __libc_multiple_threads_ptr.
5776         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
5777         __libc_multiple_threads.
5778         (__libc_pthread_init): Return pointer to __libc_pthread_init if
5779         necessary.
5780
5781         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
5782         (THREAD_SETMEM_NC): Likewise.
5783
5784         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
5785         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
5786         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
5787         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
5788
5789         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
5790         Eliminate one entire instruction.
5791
5792         * cancellation.c (__pthread_enable_asynccancel_2): New function.
5793         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
5794         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5795         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
5796         instead of __pthread_enable_asynccancel.
5797         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5798         (__pthread_cond_wait): Likewise.
5799         * sysdeps/pthread/pthread_cond_timedwait.c
5800         (__pthread_cond_timedwait): Likewise.
5801         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5802
5803         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5804         (__condvar_cleanup): Wake up all waiters in case we got signaled
5805         after being woken up but before disabling asynchronous
5806         cancellation.
5807         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5808         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5809         (__condvar_cleanup): Likewise.
5810
5811         * init.c (__NR_set_tid_address): If already defined, don't redefine.
5812         Make it an error if architecture has no #if case.  Add x86-64.
5813
5814         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
5815         pt-initfini.s generation.
5816
5817         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
5818         (TLS_INIT_TP): Fix typo.
5819
5820 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5821
5822         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
5823         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
5824
5825         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
5826         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
5827         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
5828         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
5829         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
5830         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5831         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5832         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5833
5834 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5835
5836         * sysdeps/pthread/pthread_cond_timedwait.c
5837         (__pthread_cond_timedwait): Return the result of the final
5838         locking.  If it succeeds, the regular function return value.
5839
5840         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
5841         Return result of the final locking.
5842         * version.c (__nptl_main): Work around problems with the strange
5843         INTERNAL_SYSCALL macro on ppc32.
5844         * init.c (__pthread_initialize_minimal_internal): Unblock
5845         SIGCANCEL in case the parent blocked it.
5846         Reported by Paul Mackerras <paulus@samba.org>.
5847
5848         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
5849         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
5850         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
5851
5852 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5853
5854         * sysdeps/pthread/pthread_cond_timedwait.c
5855         (__pthread_cond_timedwait): Unlock and fail if
5856         __pthread_mutex_unlock_internal failed.
5857
5858         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
5859         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
5860         Use ARCH_CLONE.
5861         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
5862         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
5863         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
5864         ALLOCATE_STACK): New macros.
5865         (TLS_TPADJ): New macro.
5866         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
5867         (allocate_stack): Handle TLS_DTV_AT_TP and
5868         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
5869         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
5870         Don't set PD->self.
5871         * init.c [__ia64__] (__NR_set_tid_address): Define.
5872
5873         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
5874         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
5875         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
5876         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
5877         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
5878         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
5879         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
5880         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
5881         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
5882         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
5883         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
5884         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
5885         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
5886         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
5887         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
5888         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
5889         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
5890         * sysdeps/ia64/bits/atomic.h: New file.
5891         * sysdeps/ia64/Makefile: New file.
5892         * sysdeps/ia64/pthread_spin_init.c: New file.
5893         * sysdeps/ia64/pthread_spin_lock.c: New file.
5894         * sysdeps/ia64/pthread_spin_trylock.c: New file.
5895         * sysdeps/ia64/pthread_spin_unlock.c: New file.
5896         * sysdeps/ia64/pthreaddef.h: New file.
5897         * sysdeps/ia64/tcb-offsets.sym: New file.
5898         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
5899         * sysdeps/ia64/tls.h: New file.
5900
5901         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
5902         to syscall instead of no arguments.
5903
5904 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
5905
5906         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
5907         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
5908         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
5909         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
5910
5911         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
5912         unused code.
5913
5914         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
5915
5916         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5917         lowlevelbarrier.sym.
5918         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
5919         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
5920         Include lowlevelbarrier.h and don't define offsets locally.
5921         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
5922
5923         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
5924         (__lll_mutex_lock_wait): Reverse order of first two parameters.
5925         (__lll_mutex_timedlock_wait): Likewise.
5926         (lll_mutex_lock): Adjust asm for that.
5927         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
5928         (lll_lock): Adjust asm for operand order change.
5929         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
5930         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
5931
5932         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
5933         Reverse order of parameters.
5934         (__lll_timedwait_tid): Remove regparms attribute.
5935         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
5936         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
5937
5938         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5939         (__lll_timedwait_tid): Remove one unnecessary instruction.
5940
5941         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
5942         __lll_mutex_timedlock_wait only for NOT_IN_libc.
5943         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
5944         lowlevelmutex.S.
5945
5946         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
5947         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
5948         for NOT_IN_libc.
5949         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
5950         lowlevellock.S.
5951
5952         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
5953         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
5954         for libc.so.
5955         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
5956         define LOCK here (if UP is not defined).  The actual code is in
5957         lowlevelmutex.S.
5958
5959         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
5960         LOCK is already defined.  Don't define lll_unlock_wake_cb and
5961         __lll_timedwait_tid for libc.so.
5962         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
5963         define LOCK here (if UP is not defined).  The actual code is in
5964         lowlevellock.S.
5965
5966         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
5967         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
5968         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
5969         instead of lowlevelsem.h.
5970         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5971         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5972         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5973
5974         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5975         lowlevelrwlock.sym.
5976         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
5977         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
5978         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
5979
5980         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
5981         register loading.
5982         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
5983         last changed.  D'oh.
5984
5985         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
5986
5987         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
5988         of __libc_locking_needed.
5989         (lll_trylock): Initialize %eax to zero.
5990
5991         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
5992         pthread_cond_t definition.
5993
5994 2003-03-10  Roland McGrath  <roland@redhat.com>
5995
5996         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
5997         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
5998         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
5999         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
6000         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
6001
6002         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
6003         Instead of setting PD->multiple_threads, set globals
6004         __pthread_multiple_threads and __libc_multiple_threads.
6005         * sysdeps/pthread/createthread.c (create_thread): Likewise.
6006         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
6007         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
6008
6009         * descr.h (struct pthread): Conditionalize first member on
6010         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
6011         containing an anonymous tcbhead_t.  Move `list' member out.
6012         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
6013         * allocatestack.c: Remove use of `header.data.' prefix.
6014         * pthread_create.c: Likewise.
6015         * init.c (__pthread_initialize_minimal_internal): Likewise.
6016         * sysdeps/pthread/createthread.c (create_thread): Likewise.
6017         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
6018         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
6019         * sysdeps/x86_64/tls.h: Likewise.
6020         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
6021         (SINGLE_THREAD_P): Likewise.
6022         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
6023         (SINGLE_THREAD_P): Likewise.
6024         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
6025         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
6026
6027 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
6028
6029         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
6030
6031         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
6032         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
6033
6034         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
6035         leftovers from the ia32 code.
6036
6037         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
6038         memory load.
6039         (clear_once_control): Don't load %esi.
6040
6041         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
6042         handling.
6043
6044         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
6045
6046         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
6047         * sysdeps/unix/sysv/linux/createthread.c: ...here.
6048
6049         * Makefile (tests): Add tst-cond10.
6050         * tst-cond10.c: New file.
6051
6052 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
6053
6054         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
6055         * tst-signal3.c (do_test): Likewise.
6056         * tst-sem5.c (do_test): Likewise.
6057         * tst-kill6.c (do_test): Likewise.
6058         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
6059
6060         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
6061         of inc/dec.
6062         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
6063         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
6064         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6065         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
6066         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6067         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6068         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6069         Likewise.
6070         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6071         Likewise.
6072         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6073         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6074         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6075         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6076         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6077         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
6078         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
6079         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
6080
6081         * allocatestack.c (allocate_stack): If mprotect() fails free the
6082         TLS memory.
6083
6084 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
6085
6086         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
6087
6088         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
6089         lll_wake_tid.  This was used only to work around kernel limits in
6090         the early days.
6091         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
6092         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
6093         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
6094         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
6095
6096         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
6097         (__pthread_initialize_minimal_internal): Change initialization of
6098         __static_tls_align_m1 appropriately.
6099         * pthreadP.h (__static_tls_align_m1): Renamed from
6100         __static_tls_align.
6101         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
6102         instead of __static_tls_align-1.
6103
6104 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
6105
6106         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
6107
6108         * pthread_create.c: Define __pthread_keys using nocommon
6109         attribute, not by placing it explicitly in bss.
6110         Remove DEFINE_DEALLOC definition.  Not needed anymore.
6111
6112         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
6113         Use it in mmap call to allocate stacks.
6114
6115         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
6116
6117         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
6118         result of the thread function.
6119
6120 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
6121
6122         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
6123         version is just fine.
6124
6125         * sysdeps/unix/sysv/linux/libc_pthread_init.c
6126         (__pthread_child_handler): Renamed from pthread_child_handler,
6127         exported, and marked hidden.  Change all users.
6128         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
6129         free __pthread_child_handler from child list.
6130
6131 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6132
6133         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
6134
6135         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6136         Fix handling of cancellation and failing pthread_mutex_unlock call.
6137         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
6138         (__pthread_cond_wait): Likewise.
6139
6140         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
6141         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
6142         lll_futex_timed_wait call.
6143         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
6144         (pthread_rwlock_timedwrlock): Likewise.
6145
6146         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6147         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
6148         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
6149
6150         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
6151         check of lll_futex_wake return value.
6152
6153 2003-03-03  Roland McGrath  <roland@redhat.com>
6154
6155         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
6156
6157         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6158         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
6159         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
6160
6161 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
6162
6163         * sysdeps/pthread/timer_create.c (timer_create): Return correct
6164         error for CPU clocks.
6165
6166         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6167         _POSIX_MONOTONIC_CLOCK.
6168         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6169
6170         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
6171         recent kernels.
6172
6173 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
6174
6175         * descr.h (struct pthread): Move cleanup field to the front.
6176
6177 2003-03-01  Roland McGrath  <roland@redhat.com>
6178
6179         * sem_open.c (sem_open): Braino fix.
6180
6181 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
6182
6183         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
6184         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
6185         __pthread_cleanup_pop functionality.
6186         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6187
6188         * descr.h (struct pthread): Move tid field to the front now that
6189         it is often used.
6190
6191         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
6192         (__lll_mutex_timedlock_wait): Remove.
6193         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
6194         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6195         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
6196         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6197         (lll_unlock_wake_cb): Don't save and restore %esi.
6198         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
6199         %esi.
6200         (__lll_timedwait_tid): Add alignment.
6201         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
6202         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
6203         %esi.
6204         (__lll_timedwait_tid): Removed.
6205         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6206         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
6207         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
6208         (pthread_barrier_wait): Don't save, load, and restore %esi for
6209         last thread.
6210         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6211         (__pthread_cond_signal): Don't save, load, and restore %esi.
6212         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
6213         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
6214         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
6215         Don't save, load, and restore %esi.
6216
6217 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
6218
6219         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
6220         Release lock before waking up the waiters.
6221
6222         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
6223
6224         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
6225         (reader_thread): Likewise.
6226
6227         * sysdeps/pthread/pthread_rwlock_unlock.c
6228         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
6229         to wake up readers if there are none.
6230
6231         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
6232         Release internal lock before wake threads.
6233
6234 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
6235
6236         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
6237         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
6238         predefined.
6239         * tst-rwlock9.c: Likewise.
6240         * tst-rwlock10.c: New file.
6241         * tst-rwlock11.c: New file.
6242
6243         * Makefile (tests): Add tst-dlsym1.
6244         * tst-dlsym1.c: New file.
6245
6246         * init.c (__pthread_initialize_minimal_internal): Set
6247         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
6248         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
6249
6250 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
6251
6252         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
6253
6254         * tst-cond2.c: Fix sychronization with child.
6255
6256         * tst-rwlock8.c (reader_thread): Remove unused variable.
6257
6258         * Makefile: Add rules to build and run tst-tls3.
6259         * tst-tls3.c: New file.
6260         * tst-tls3mod.c: New file.
6261
6262         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
6263         * tst-rwlock8.c: New file.
6264         * tst-rwlock9.c: New file.
6265         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
6266         complete broken rwlock implementation.
6267         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6268         Likewise.
6269         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6270         Likewise.
6271         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6272         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6273         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6274         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6275         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6276         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
6277         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6278
6279 2003-02-23  Roland McGrath  <roland@redhat.com>
6280
6281         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
6282
6283 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
6284
6285         * Makefile (tests): Add tst-context1.
6286         * tst-context1.c: New file.
6287
6288         * Makefile (tests): Add tst-tls1 and tst-tls2.
6289         * tst-tls1.c: New file.
6290         * tst-tls2.c: New file.
6291
6292         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
6293         for failed cmpxchg.
6294
6295         * pthread_create.c (start_thread): Set EXITING_BIT early.
6296
6297         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
6298         (THREAD_GETMEM_NC): Likewise.
6299
6300 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
6301
6302         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
6303         off 3 more bytes by using offset-less instructions when possible.
6304
6305         * Makefile: Add dependency for $(objpfx)version.d.
6306
6307         * eintr.c (eintr_source): Add unnecessary return but the compiler
6308         insists.
6309
6310         * tst-kill3.c: Include <unistd.h>.
6311
6312 2003-02-21  Roland McGrath  <roland@redhat.com>
6313
6314         * pthread_create.c (start_thread): Call __libc_thread_freeres.
6315
6316 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
6317
6318         * Makefile (tests): Add tst-eintr1.
6319         (distribute): Add eintr.c.
6320         * tst-eintr1.c: New file.
6321         * eintr.c: New file.
6322
6323         * pthread_cancel.c (pthread_cancel): Use tkill directly.
6324
6325         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
6326         Disallow sending SIGCANCEL.
6327
6328         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
6329         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
6330         * tst-kill1.c: New file.
6331         * tst-kill2.c: New file.
6332         * tst-kill3.c: New file.
6333         * tst-kill5.c: New file.
6334         * tst-kill6.c: New file.
6335         * tst-basic7.c: Renamed to...
6336         * tst-kill4.c: ...this.
6337
6338 2003-02-21  Roland McGrath  <roland@redhat.com>
6339
6340         * Makefile (install-lib-ldscripts): New variable.
6341
6342 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
6343
6344         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
6345         * pthread_cancel.c: Use INVALID_TD_P.
6346         * pthread_detach.c: Likewise.
6347         * pthread_getschedparam.c: Likewise.
6348         * pthread_setschedparam.c: Likewise.
6349         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6350         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6351         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
6352         * pthread_timedjoin.c: Likewise.
6353
6354         * tst-basic7.c: Include <signal.h>.
6355
6356         * pthread_join.c (pthread_join): Limited checking for invalid
6357         descriptors.
6358         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
6359
6360 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
6361
6362         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
6363         beginning of the loop.  Clear the entire first block of TSD.
6364         * Makefile (tests): Add tst-key4.
6365         * tst-key4.c: New file.
6366
6367 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
6368
6369         * Makefile (tests): Add tst-basic7.
6370         * tst-basic7.c: New file.
6371
6372         * pthread_create.c (deallocate_tsd): Mark as internal_function.
6373         Add some more __builtin_expect.
6374
6375         * pthreadP.h: Define dummy version of DEBUGGING_P.
6376
6377 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
6378
6379         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
6380         _POSIX_THREAD_PRIORITY_SCHEDULING.
6381         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
6382         _XOPEN_REALTIME_THREADS.
6383         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
6384
6385         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
6386         kernel returns EINVAL for PID <= 0, work around it.
6387
6388         * Makefile (tests): Add tst-signal5.
6389         * tst-signal5.c: New file.
6390
6391         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
6392         and LOGIN_NAME_MAX.
6393
6394         * tst-cancel1.c (tf): Block all signals.
6395
6396         * Makefile (tests): Add tst-basic6.
6397         * tst-basic6.c: New file.
6398
6399         * tst-basic1.c: Add test for process ID.
6400
6401         * Makefile (tests): Add tst-cancel10.
6402         * tst-cancel10.c: New file.
6403
6404         * Makefile (tests): Add tst-signal4.
6405         * tst-signal4.c: New file.
6406
6407         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
6408         __sigismember instead of sigismember.  Add __builtin_expect.
6409
6410 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
6411
6412         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
6413         pthread_setcancelstate, and pthread_rwlock_setpshared.
6414
6415         * tst-cancel7.c (do_test): Make sure the pid file exists before
6416         canceling the thread.
6417
6418         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
6419         pthread_rwlock_timedrdlock tests.
6420         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
6421         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6422         Check for invalid tv_nsec field.
6423         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6424         Likewise.
6425
6426         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
6427         recursive mutex of overflow.
6428
6429         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
6430
6431         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
6432         going into an endless loop.
6433         * Makefile (tests): Add tst-cancel9.
6434         * tst-cancel9.c: New file.
6435
6436         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
6437
6438 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
6439
6440         * tst-mutex5.c (do_test): Add more timedlock tests.
6441
6442         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
6443         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
6444
6445         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
6446         use INLINE_SYSCALL.  Error number is returned, not -1.
6447
6448         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
6449         and __deallocate_stack with internal_function.
6450         * pthread_create.c: Adjust definitions appropriately.
6451         * allocatestack.c: Likewise.
6452
6453         * pthread_join.c: Add one more __builtin_expect.
6454         * pthread_timedjoin.c: Likewise.
6455
6456         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
6457         not data of sequence number does not match.
6458         Add one __builtin_expect.
6459
6460         * Makefile (tests): Add tst-clock1.
6461         * tst-clock1.c: New file.
6462
6463         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
6464         negative arguments.
6465         * Makefile (tests): Add tst-basic5.
6466         * tst-basic5.c: New file.
6467
6468 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
6469
6470         * Makefile (tests): Add tst-basic4.
6471         * tst-basic4.c: New file.
6472
6473         * pthreadP.h: Add declaraction for __nptl_nthreads.
6474         * pthread_create.c: Define __nptl_nthreads
6475         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
6476         after thread is done.  If then zero, call exit(0).
6477         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6478         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
6479         * init.c (pthread_functions): Initialize ptr_nthreads.
6480         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
6481         (__reclaim_stacks): Decrement __nptl_nthreads.
6482         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
6483         Define.
6484         * Makefile (tests): Add tst-basic3.
6485         * tst-basic3.c: New file.
6486
6487         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
6488         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
6489         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
6490         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
6491         if asynchronous canceling is enabled.
6492         * pthread_join.c (pthread_join): When recognizing circular joins,
6493         take into account the other thread might be already canceled.
6494         * Makefile (tests): Add tst-join5.
6495         * tst-join5.c: New file.
6496
6497         * Makefile (tests): Add tst-join4.
6498         * tst-join4.c: New file.
6499
6500 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
6501
6502         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
6503
6504 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6505
6506         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
6507         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
6508         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
6509         warning.
6510         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
6511         to avoid warning.
6512         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
6513         error if lll_futex_wake failed.
6514
6515 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
6516
6517         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
6518         handling of cancellation and failung pthread_mutex_unlock call.
6519         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6520         * Makefile (tests): Add tst-cond8 and tst-cond9.
6521         * tst-cond8.c: New file.
6522         * tst-cond9.c: New file.
6523
6524         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
6525
6526         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
6527         non-standard initializers with __USE_GNU.
6528
6529         * Makefile (tests): Add tst-cleanup3.
6530         * tst-cleanup3.c: New file.
6531
6532 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
6533
6534         * Makefile (tests): Add tst-attr1 and tst-attr2.
6535         * tst-attr1.c: New file.
6536         * tst-attr2.c: New file.
6537
6538         * Makefile: Add rules to build and run tst-atfork2 test.
6539         * tst-atfork2.c: New file.
6540         * tst-atfork2mod.c: New file.
6541
6542         * sysdeps/unix/sysv/linux/unregister-atfork.c
6543         (__unregister_atfork): Free the memory allocated for the handlers
6544         after removing them from the lists.
6545
6546         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
6547         cleanup function.
6548
6549         * tst-atfork1.c (do_test): Wait for the child we forked.
6550         Report error in child.
6551
6552         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
6553
6554         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
6555
6556 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
6557
6558         * Makefile (tests): Add tst-cancel8.
6559         * tst-cancel8.c: New file.
6560
6561         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
6562         clearing of control variable.
6563         * Makefile (tests): Add tst-once3 and tst-once4.
6564         * tst-once3.c: New file.
6565         * tst-once4.c: New file.
6566
6567 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
6568
6569         * sysdeps/sh/Makefile: New file.
6570         * sysdeps/sh/bits/atomic.h: New file.
6571         * sysdeps/sh/pthread_spin_init.c: New file.
6572         * sysdeps/sh/pthread_spin_lock.c: New file.
6573         * sysdeps/sh/pthread_spin_trylock.S: New file.
6574         * sysdeps/sh/pthread_spin_unlock.S: New file.
6575         * sysdeps/sh/pthreaddef.h: New file.
6576         * sysdeps/sh/tcb-offsets.sym: New file.
6577         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
6578         * sysdeps/sh/tls.h: New file.
6579         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
6580         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
6581         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
6582         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
6583         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
6584         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
6585         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
6586         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
6587         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
6588         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
6589         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
6590         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
6591         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
6592         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
6593         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
6594         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
6595         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
6596         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
6597         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
6598         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
6599         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
6600         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
6601         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
6602         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
6603         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
6604         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
6605         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
6606         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
6607         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
6608         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
6609
6610 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
6611
6612         * tst-cond2.c: Rearrange code to not rely on behavior undefined
6613         according to POSIX.
6614
6615         * tst-basic2.c (do_test): Lock mutex before creating the thread.
6616
6617 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
6618
6619         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
6620         (TLS_GET_FS): New #define.
6621         (TLS_SET_FS): New #define.
6622         Correct value of __NR_set_thread_area.
6623
6624         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
6625
6626 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
6627
6628         * Makefile (tests): Add tst-popen1.
6629         * tst-popen1.c: New file.
6630
6631         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
6632         but inactive generalization.
6633         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6634         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6635         Minor optimization, remove one instruction.
6636         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6637
6638 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6639
6640         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
6641
6642 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6643
6644         * init.c (__NR_set_tid_address): Add #ifdef for s390.
6645         * sysdeps/pthread/pthread_barrier_wait.c: New file.
6646         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
6647         * sysdeps/pthread/pthread_cond_signal.c: New file.
6648         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
6649         * sysdeps/pthread/pthread_cond_wait.c: New file.
6650         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
6651         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
6652         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
6653         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
6654         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
6655         * sysdeps/s390/Makefile: New file.
6656         * sysdeps/s390/bits/atomic.h: New file.
6657         * sysdeps/s390/pthread_spin_init.c: New file.
6658         * sysdeps/s390/pthread_spin_lock.c: New file.
6659         * sysdeps/s390/pthread_spin_trylock.c: New file.
6660         * sysdeps/s390/pthread_spin_unlock.c: New file.
6661         * sysdeps/s390/pthreaddef.h: New file.
6662         * sysdeps/s390/tcb-offsets.sym: New file.
6663         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
6664         * sysdeps/s390/tls.h: New file.
6665         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
6666         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
6667         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
6668         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
6669         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
6670         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
6671         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6672         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
6673         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
6674         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
6675         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
6676         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
6677         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
6678         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
6679         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
6680         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
6681         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
6682         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
6683         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
6684         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
6685         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
6686         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6687         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
6688
6689 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
6690
6691         * atomic.h: Add a couple more default implementations.
6692         (atomic_compare_and_exchange_acq): Use
6693         __arch_compare_and_exchange_32_acq in return value definition.  It
6694         always exists.
6695         (atomic_bit_set): Renamed from atomic_set_bit.
6696         Add missing atomic_ prefixes.
6697
6698         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
6699         thread library is available, use correct value to mark initialized
6700         once variable.
6701
6702 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
6703
6704         * allocatestack.c (allocate_stack): Use __getpagesize instead of
6705         __sysconf to determine pagesize.
6706
6707         * pthread_create.c: Include <atomic.h>.
6708         * allocatestack.c (allocate_stack): Implement coloring of the
6709         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
6710         size minus one.  Adjust users.
6711         * sysdeps/i386/i686/Makefile: New file.
6712
6713 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
6714
6715         * allocatestack.c: Improve comment throughout the file.
6716
6717         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6718         (__lll_lock_wait): Add branch prediction.
6719         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
6720         (__lll_lock_wait): Likewise.
6721         (lll_unlock_wake_cb): Removed.
6722
6723 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
6724
6725         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
6726         _POSIX_THREAD_PRIORITY_SCHEDULING.
6727
6728 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
6729
6730         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6731         Fix return type of ptr___pthread_getspecific.
6732
6733 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
6734
6735         * Makefile (tests): Add tst-umask1.
6736         (tst-umask1-ARGS): Define.
6737         * tst-umask1.c: New file.
6738
6739 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
6740
6741         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
6742         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
6743         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
6744         pthread_rwlock_unlock.
6745         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
6746         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
6747         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
6748         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
6749         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6750         New file.
6751         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
6752         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6753         New file.
6754         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
6755         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
6756         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
6757         New file.
6758         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
6759         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
6760         New file.
6761         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
6762         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
6763         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
6764         New file.
6765         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
6766         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
6767         New file.
6768         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
6769
6770         * Makefile (libpthread-routines): Remove lowlevelcond and
6771         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
6772         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
6773         and pthread_cond_broadcast.
6774         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
6775         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
6776         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
6777         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
6778         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
6779         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
6780         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
6781         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
6782         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
6783         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
6784         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
6785         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
6786         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
6787         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
6788         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
6789         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
6790         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
6791         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
6792         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
6793         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
6794         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
6795         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
6796         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
6797         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
6798         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
6799         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
6800         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
6801         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
6802         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
6803         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
6804         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
6805
6806         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
6807         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
6808         of the code is moved to ...
6809         * sysdeps/pthread/createthread.c: ...here.  New file.
6810
6811 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
6812
6813         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
6814         (__new_sem_post): Clear %eax before returning.
6815         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
6816
6817         * Makefile (tests): Add tst-cleanup2.
6818         * tst-cleanup2.c: New file.
6819
6820         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6821         Interpret first parameter correctly.
6822
6823 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
6824
6825         * Makefile (headers): Add bits/semaphore.h.
6826
6827 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
6828
6829         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
6830         if not SHARED.
6831
6832 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
6833
6834         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
6835         must be used and mapping failed.
6836         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
6837
6838         * Makefile (CFLAGS-pthread_self.os): Define this, not
6839         CFLAGS-pthread_self.c.
6840
6841 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6842
6843         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
6844         lll_unlock_wake_cb.
6845
6846         * Makefile (libpthread-routines): Add version.  Add rules to build
6847         version.os and banner.h.
6848         * version.c: New file.
6849
6850 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
6851
6852         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
6853         the alias unconditional.
6854         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
6855
6856 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6857
6858         * Makefile (CFLAGS-pthread_self.c): New definition.
6859
6860 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6861
6862         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
6863         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
6864         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
6865         * init.c (__pthread_initialize_minimal_internal): Likewise.
6866
6867 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
6868
6869         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
6870
6871         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6872         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6873         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6874         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6875         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6876         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6877
6878 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6879
6880         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
6881         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
6882         * tst-cancel-wrappers.sh: Remove all exceptions.
6883
6884 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
6885
6886         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
6887         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
6888
6889         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
6890         Use __libc_pthread_functions array if SHARED.
6891
6892         * pthreadP.h: Move pthread_cond_2_0_t definition to...
6893         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
6894
6895         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
6896         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
6897         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
6898         __libc_ptf_call instead of __libc_maybe_call.
6899         (PTF): New #define.
6900         (__libc_cleanup_region_start): Wrap function name with PTF call.
6901         (__libc_cleanup_region_end): Likewise.
6902         (__libc_cleanup_end): Likewise.
6903
6904         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
6905         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
6906         * pthread_key_create.c: Add __pthread_key_create_internal alias.
6907         * pthreadP.h: Add prototypes.
6908
6909         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
6910         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
6911         __pthread_rwlock_unlock aliases.
6912         * pthreadP.h: Add prototypes for new aliases.
6913
6914         * pthreadP.h (struct pthead_functions): Moved to...
6915         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
6916         * init.c (pthread_functions): Add initializers for new elements.
6917
6918         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
6919         __pthread_cleanup_pop_restore aliases.
6920         * pthreadP.h: Add prototypes.
6921
6922         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
6923         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
6924         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
6925         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
6926         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
6927         * pthreadP.h: Adjust prototypes and callers.
6928
6929 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
6930
6931         * Makefile (tests): Add tst-cancel7.
6932         (tst-cancel7-ARGS): New variable.
6933         * tst-cancel7.c: New file.
6934
6935         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
6936         around gcc defficiencies.
6937         * old_pthread_cond_signal.c: Likewise.
6938         * old_pthread_cond_timedwait.c: Likewise.
6939         * old_pthread_cond_wait.c: Likewise.
6940
6941         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
6942
6943 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6944
6945         * Makefile (tests): Add tst-cond7.
6946         * tst-cond7.c: New file.
6947
6948         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6949         (condvar_cleanup): Get condvar address from the right place.
6950
6951         * atomic.h: Correct definitions of atomic_full_barrier,
6952         atomic_read_barrier, atomic_write_barrier.
6953
6954         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
6955         race-free.
6956         * old_pthread_cond_signal.c: Likewise.
6957         * old_pthread_cond_timedwait.c: Likewise.
6958         * old_pthread_cond_wait.c: Likewise.
6959
6960 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
6961
6962         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
6963
6964 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6965
6966         * pthreadP.h (pthread_cond_2_0_t): New type.
6967         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
6968         Use new type for the 2.0 condvar function prototypes.
6969         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
6970         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
6971         parameter.
6972         * old_pthread_cond_destroy.c: Likewise.
6973         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
6974         * old_pthread_cond_signal.c: Likewise.
6975         * old_pthread_cond_timedwait.c: Likewise.
6976         * old_pthread_cond_wait.c: Likewise.
6977
6978         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6979         (__pthread_cond_wait): Don't save cancellation mode and seq value
6980         in same location.
6981
6982         * herrno.c (__h_errno_location): Don't define as weak.
6983
6984 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6985
6986         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
6987         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
6988         and pthread_cond_wait.
6989         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
6990         Renamed to...
6991         (__pthread_cond_broadcast_2_0): ... this.
6992         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
6993         Renamed to...
6994         (__pthread_cond_destroy_2_0): ... this.
6995         * old_pthread_cond_init.c (__old_pthread_cond_init):
6996         Renamed to...
6997         (__pthread_cond_init_2_0): ... this.
6998         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
6999         Renamed to...
7000         (__pthread_cond_signal_2_0): ... this.
7001         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
7002         Renamed to...
7003         (__pthread_cond_wait_2_0): ... this.
7004         * pthread_cond_destroy.c: Include shlib-compat.h.
7005         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
7006         * pthread_cond_init.c: Include shlib-compat.h.
7007         (pthread_cond_init): Change strong_alias into versioned_symbol.
7008         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
7009         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
7010         fields.
7011         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
7012         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
7013         __pthread_cond_wait_2_0): New prototypes.
7014         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
7015         __old_pthread_cond_init, __old_pthread_cond_signal,
7016         __old_pthread_cond_wait): Removed.
7017         * init.c: Include shlib-compat.h.
7018         (pthread_functions): Guard ptr___pthread_attr_init_2_0
7019         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
7020         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
7021         ptr___pthread_cond_*_2_0 fields.
7022         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
7023         pthread_cond_*@GLIBC_2.0 compatibility symbols.
7024
7025         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
7026         LIBC_SIGACTION was not yet defined.
7027         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
7028         [!defined LIBC_SIGACTION] (__sigaction): New function and
7029         libc_hidden_weak.
7030         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
7031         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
7032
7033 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
7034
7035         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
7036
7037 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
7038
7039         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7040         New, larger type definition.
7041         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
7042         implementation.
7043         * Versions [libpthread]: Add definitions for new pthread_cond_*
7044         interfaces for version GLIBC_2.3.2.
7045         * pthread_cond_init.c: Update initialization for new type definition.
7046         * Makefile (libpthread-routines): Remove pthread_cond_wait,
7047         pthread_cond_timedwait, pthread_cond_signal, and
7048         pthread_cond_broadcast.  Add old_pthread_cond_init,
7049         old_pthread_cond_destroy, old_pthread_cond_wait,
7050         old_pthread_cond_timedwait, old_pthread_cond_signal, and
7051         old_pthread_cond_broadcast.
7052         * old_pthread_cond_broadcast.c: New file.
7053         * old_pthread_cond_destroy.c: New file.
7054         * old_pthread_cond_init.c: New file.
7055         * old_pthread_cond_signal.c: New file.
7056         * old_pthread_cond_timedwait.c: New file.
7057         * old_pthread_cond_wait.c: New file.
7058         * pthreadP.h: Add prototypes for the compatibility interfaces.
7059
7060         * pthread_cond_destroy.c: Don't include <errno.h>.
7061
7062 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
7063
7064         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
7065         unnecessary zero offset when addressing MUTEX.
7066
7067 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
7068
7069         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7070         __register_atfork.
7071         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
7072         for __register_atfork.
7073
7074 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
7075
7076         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
7077         instead of ASSEMBLER test macro.
7078
7079         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
7080         __libc_current_sigrtmax): Add libc_hidden_def.
7081
7082         * sysdeps/pthread/list.h: Remove assert.h include.
7083
7084 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
7085
7086         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
7087         __pthread_initialize_minimal_internal not
7088         __pthread_initialize_minimal.
7089
7090 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
7091
7092         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
7093         __pthread_initialize_minimal as hidden.
7094
7095         * init.c (__pthread_initialize_minimal_internal): Don't mark as
7096         constructor.
7097
7098 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
7099
7100         * Makefile ($(inst_libdir)/libpthread.so): Depend on
7101         $(common-objpfx)format.lds, include that into the output script.
7102         Fix comment.
7103         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
7104
7105 2002-12-28  Andreas Jaeger  <aj@suse.de>
7106
7107         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
7108         nsec resolution changes.
7109         (xstat64_conv): Likewise.
7110         (xstat32_conv): Likewise.
7111         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
7112         struct kernel_stat.
7113         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
7114         structs stat and stat64.
7115         * time/time.h (__timespec_defined): Define for __USE_MISC.
7116         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
7117
7118 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
7119
7120         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
7121         argument.
7122         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
7123         (pthread_exit): Use strong_alias to avoid warnings.
7124         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
7125         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
7126         ptr___pthread_attr_init_2_*.
7127         * init.c (pthread_functions): Adjust.
7128
7129 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
7130
7131         * forward.c: Make all functions available by default again.  It
7132         caused too much trouble.
7133
7134         * pt-siglongjmp.c: Removed.
7135
7136 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
7137
7138         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
7139         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
7140         * sysdeps/i386/Makefile: New file.
7141         * sysdeps/i386/tcb-offsets.sym: New file.
7142         * sysdeps/pthread/tcb-offsets.h: New file.
7143         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7144         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
7145
7146         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
7147         __register_atfork...
7148         (GLIBC_2.3.2): ...here.
7149
7150 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
7151
7152         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
7153         pthread_attr_setstackaddr with __attribute_deprecated__.
7154
7155 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
7156
7157         * pt-system.c (system): Remove cancellation handling.
7158         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
7159         cancellation routines.
7160
7161 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
7162
7163         * descr.h: Include <dl-sysdep.h>.
7164         (struct pthread): Move header.data.list to the back of the struct.
7165         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
7166         (MULTIPLE_THREADS_OFFSET): Adjust offset.
7167         (SYSINFO_OFFSEET): Likewise.
7168
7169 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
7170
7171         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
7172         Define.
7173         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
7174         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
7175         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
7176         (USE_DL_SYSINFO): Undef.
7177
7178 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
7179
7180         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
7181         $(common-objpfx)libc.so.
7182         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
7183         it is bigger than pipe buffer size even on arches with bigger
7184         page size.
7185         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
7186
7187 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
7188
7189         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
7190         correct errno access for case that USE___THREAD is not defined.
7191
7192 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
7193
7194         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
7195         Patch by Marijn Ros <marijn@mad.scientist.com>.
7196
7197 2002-12-22  Roland McGrath  <roland@redhat.com>
7198
7199         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
7200
7201 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
7202
7203         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
7204
7205 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
7206
7207         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
7208         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
7209         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
7210
7211         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
7212         of int $0x80.
7213         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7214         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
7215         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
7216         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7217         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7218         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
7219         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
7220         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
7221
7222         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
7223         sysenter.
7224         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
7225
7226         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
7227
7228         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
7229         in new TCB.
7230         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
7231         that sysinfo is properly initialized.
7232         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
7233         to 1 only for ld.so.
7234
7235         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
7236         RTLD_CORRECT_DYNAMIC_WEAK.
7237
7238 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
7239
7240         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
7241         Use return 0 as 6th argument to FORWARD4.
7242         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
7243
7244 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
7245
7246         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
7247         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
7248         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
7249         (INIT_SYSINFO): New #define.
7250         (TLS_TP_INIT): Use INIT_SYSINFO.
7251         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7252         At test to make sure SYSINFO_OFFSET value is correct.
7253         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
7254
7255 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
7256
7257         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
7258         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
7259         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
7260         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
7261         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
7262         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
7263         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
7264
7265 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
7266
7267         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
7268         macro instead of using int $0x80 directly.
7269
7270         * sysdeps/pthread/bits/stdio-lock.h: New file.
7271         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
7272         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
7273         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
7274         * Makefile (routines): Add libc-lowlevelmutex.
7275
7276         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
7277         __i686.get_pc_thunk.dx.
7278
7279 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
7280
7281         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
7282         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
7283         ($(objpfx)tst-cancel-wrappers.out): New rule.
7284         * tst-cancel-wrappers.sh: New test.
7285         * tst-locale1.c: Include signal.h.
7286         (uselocale): Test static linking of __libc_current_sigrt*.
7287
7288 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
7289
7290         * Makefile (tests): Add tst-cancel6.
7291         * tst-cancel6.c: New file
7292
7293 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
7294
7295         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
7296         Define meaningfully for assembler as well.
7297         * pthreadP.h (struct pthread_functions): Remove
7298         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
7299         and ptr_pthread_attr_init_2_1 fields.
7300         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
7301         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
7302         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
7303         (FORWARD3): Define using FORWARD4.
7304         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
7305         versions.
7306         * pt-system.c: Remove duplicate stdlib.h include.
7307
7308 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
7309
7310         * sem_init.c: Define sem_init@GLIBC_2.0.
7311         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
7312         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
7313
7314         * flockfile.c: Moved to...
7315         * sysdeps/pthread/flockfile.c: ...here.  New file.
7316         * funlockfile.c: Moved to...
7317         * sysdeps/pthread/funlockfile.c: ...here.  New file.
7318         * ftrylockfile.c: Moved to...
7319         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
7320
7321 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
7322
7323         * libc-cancellation.c: Guard both function with
7324         #if !defined NOT_IN_libc.
7325         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
7326         automatically provided pthread wrappers.
7327         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
7328         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
7329         nor in libpthread.
7330         * pt-open.c: Removed.
7331         * pt-fcntl.c: Removed.
7332         * pt-fsync.c: Removed.
7333         * pt-lseek.c: Removed.
7334         * pt-msgrcv.c: Removed.
7335         * pt-msgsnd.c: Removed.
7336         * pt-msync.c: Removed.
7337         * pt-nanosleep.c: Removed.
7338         * pt-open64.c: Removed.
7339         * pt-pause.c: Removed.
7340         * pt-pread.c: Removed.
7341         * pt-pread64.c: Removed.
7342         * pt-pwrite.c: Removed.
7343         * pt-pwrite64.c: Removed.
7344         * pt-read.c: Removed.
7345         * pt-recv.c: Removed.
7346         * pt-recvfrom.c: Removed.
7347         * pt-recvmsg.c: Removed.
7348         * pt-send.c: Removed.
7349         * pt-sendto.c: Removed.
7350         * pt-sigtimedwait.c: Removed.
7351         * pt-sigwait.c: Removed.
7352         * pt-wait.c: Removed.
7353         * pt-waitpid.c: Removed.
7354         * pt-write.c: Removed.
7355         * pt-accept.c: Removed.
7356         * pt-close.c: Removed.
7357         * pt-connect.c: Removed.
7358         * pt-lseek64.c: Removed.
7359         * pt-sendmsg.c: Removed.
7360         * pt-tcdrain.c: Removed.
7361
7362 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
7363
7364         * init.c (__pthread_initialize_minimal_internal): Renamed from
7365         __pthread_initialize_minimal.  Make old name an alias.  This
7366         converts a normal relocation into a relative relocation.
7367
7368         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
7369
7370         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
7371         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
7372         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
7373         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
7374         pt-sigwaitinfo, pt-waitid, and pt-writev.
7375         * pt-creat.c: Removed.
7376         * pt-poll.c: Removed.
7377         * pt-pselect.c: Removed.
7378         * pt-readv.c: Removed.
7379         * pt-select.c: Removed.
7380         * pt-sigpause.c: Removed.
7381         * pt-sigsuspend.c: Removed.
7382         * pt-sigwaitinfo.c: Removed.
7383         * pt-waitid.c: Removed.
7384         * pt-writev.c: Removed.
7385
7386         * init.c (pthread_functions): New variable.
7387         (__pthread_initialize_minimal): Pass pointer to pthread_functions
7388         (or NULL) to __libc_pthread_init.
7389         * forward.c: Rewrite to use __libc:pthread_functions array to get
7390         function addresses.
7391         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
7392         prototype.
7393         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7394         Take new parameter.  Copy content of variable pointed to by it
7395         to __libc_pthread_init.
7396
7397         * pthreadP.h (struct pthread_functions): New type.
7398         (__libc_pthread_init): Declare.
7399
7400         * pthread_attr_destroy.c: Add namespace protected alias.
7401         * pthread_attr_getdetachstate.c: Likewise.
7402         * pthread_attr_getinheritsched.c: Likewise.
7403         * pthread_attr_getschedparam.c: Likewise.
7404         * pthread_attr_getschedpolicy.c: Likewise.
7405         * pthread_attr_getscope.c: Likewise.
7406         * pthread_attr_setdetachstate.c: Likewise.
7407         * pthread_attr_setinheritsched.c: Likewise.
7408         * pthread_attr_setschedparam.c: Likewise.
7409         * pthread_attr_setschedpolicy.c: Likewise.
7410         * pthread_attr_setscope.c: Likewise.
7411         * pthread_cond_broadcast.c: Likewise.
7412         * pthread_cond_destroy.c: Likewise.
7413         * pthread_cond_init.c: Likewise.
7414         * pthread_cond_signal.c: Likewise.
7415         * pthread_cond_wait.c: Likewise.
7416         * pthread_condattr_destroy.c: Likewise.
7417         * pthread_condattr_init.c: Likewise.
7418         * pthread_equal.c: Likewise.
7419         * pthread_exit.c: Likewise.
7420         * pthread_getschedparam.c: Likewise.
7421         * pthread_self.c: Likewise.
7422         * pthread_setcancelstate.c: Likewise.
7423         * pthread_setschedparam.c: Likewise.
7424         * pthread_mutex_destroy.c: Likewise.
7425         * pthread_mutex_init.c: Likewise.
7426         * pthreadP.h: Add prototypes for the aliases.
7427
7428         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
7429         multiple_threads member in correct TCB to 1.
7430
7431         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
7432         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
7433         member of thread decriptor, otherwise return unconditionally 1.
7434
7435 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
7436
7437         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
7438         regular Linux version.  Remove file.
7439         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
7440         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
7441         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
7442         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
7443         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
7444         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
7445         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
7446         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
7447         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
7448         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
7449         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
7450         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
7451         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
7452         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
7453         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
7454         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
7455         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
7456         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
7457         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
7458         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
7459         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
7460         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
7461         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
7462         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
7463         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
7464         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
7465         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
7466         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
7467         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
7468         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
7469
7470 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
7471
7472         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
7473         * sysdeps/unix/sysv/linux/open.c: Removed.
7474         * sysdeps/unix/sysv/linux/fsync.c: Removed.
7475         * sysdeps/unix/sysv/linux/lseek.c: Removed.
7476         * sysdeps/unix/sysv/linux/msync.c: Removed.
7477         * sysdeps/unix/sysv/linux/read.c: Removed.
7478         * sysdeps/unix/sysv/linux/close.c: Removed.
7479         * sysdeps/unix/sysv/linux/creat.c: Removed.
7480         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
7481         * sysdeps/unix/sysv/linux/pause.c: Removed.
7482         * sysdeps/unix/sysv/linux/select.c: Removed.
7483         * sysdeps/unix/sysv/linux/write.c: Removed.
7484
7485 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
7486
7487         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
7488         element in TCB to see whether locking is needed.
7489
7490         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
7491         MULTIPLE_THREADS_OFFSET value is correct.
7492
7493         * sysdeps/unix/sysv/linux/close.c: New file.
7494         * sysdeps/unix/sysv/linux/connect.S: New file.
7495         * sysdeps/unix/sysv/linux/creat.c: New file.
7496         * sysdeps/unix/sysv/linux/fsync.c: New file.
7497         * sysdeps/unix/sysv/linux/llseek.c: New file.
7498         * sysdeps/unix/sysv/linux/lseek.c: New file.
7499         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
7500         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
7501         * sysdeps/unix/sysv/linux/msync.c: New file.
7502         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
7503         * sysdeps/unix/sysv/linux/open.c: New file.
7504         * sysdeps/unix/sysv/linux/open64.c: New file.
7505         * sysdeps/unix/sysv/linux/pause.c: New file.
7506         * sysdeps/unix/sysv/linux/poll.c: New file.
7507         * sysdeps/unix/sysv/linux/pread.c: New file.
7508         * sysdeps/unix/sysv/linux/pread64.c: New file.
7509         * sysdeps/unix/sysv/linux/pselect.c: New file.
7510         * sysdeps/unix/sysv/linux/pwrite.c: New file.
7511         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
7512         * sysdeps/unix/sysv/linux/readv.c: New file.
7513         * sysdeps/unix/sysv/linux/recv.S: New file.
7514         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
7515         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
7516         * sysdeps/unix/sysv/linux/select.c: New file.
7517         * sysdeps/unix/sysv/linux/send.S: New file.
7518         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
7519         * sysdeps/unix/sysv/linux/sendto.S: New file.
7520         * sysdeps/unix/sysv/linux/sigpause.c: New file.
7521         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
7522         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7523         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7524         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7525         * sysdeps/unix/sysv/linux/system.c: New file.
7526         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
7527         * sysdeps/unix/sysv/linux/wait.c: New file.
7528         * sysdeps/unix/sysv/linux/waitid.c: New file.
7529         * sysdeps/unix/sysv/linux/waitpid.c: New file.
7530         * sysdeps/unix/sysv/linux/writev.c: New file.
7531         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
7532
7533         * pt-readv.c: Fix comment.
7534
7535 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
7536
7537         * tst-cleanup1.c: Include stdlib.h.
7538
7539         * tst-cancel5.c: New test.
7540         * Makefile (tests): Add tst-cancel5.
7541         (tst-cancel5): Link against libc.so libpthread.so in that order.
7542
7543 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
7544
7545         * forward.c (test_loaded): Prevent recursive calls.
7546
7547         * Makefile (routines): Add libc-cancellation.
7548         * libc-cancellation.c: New file.
7549         * descr.h (struct pthread): Add multiple_threads field.
7550         * allocatestack.c (allocate_stack): Initialize multiple_header field of
7551         new thread descriptor to 1.
7552         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
7553         Initialize multiple_thread field after successful thread creation.
7554         * cancellation.c (__do_cancel): Move to pthreadP.h.
7555         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
7556         (__pthread_disable_asynccancel): Add internal_function attribute.
7557         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
7558         * pthread_setcancelstate.c: Likewise.
7559         * pthread_setcanceltype.c: Likewise.
7560         * pthread_exit.c: Likewise.
7561         * pthreadP.h (CANCELLATION_P): Likewise.
7562         (__do_cancel): Define as static inline.
7563         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
7564         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
7565         declarations.
7566         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
7567         fields.  Define MULTIPLE_THREADS_OFFSET.
7568         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
7569         declaration.
7570         * sysdeps/unix/sysv/linux/accept.S: New file.
7571         * sysdeps/unix/sysv/linux/read.c: New file.
7572         * sysdeps/unix/sysv/linux/write.c: New file.
7573         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
7574         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
7575         initialization of __libc_locking_needed.
7576         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
7577         __libc_locking_needed, use multiple_threads field in TCB.
7578         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7579
7580 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7581
7582         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
7583         version.
7584         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
7585
7586         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
7587         access to __libc_locking_needed for PIC.
7588
7589 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
7590
7591         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
7592         declare for libc.so.
7593         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
7594         expression.
7595         (__libc_lock_lock): Put into statement expression.
7596         (__libc_lock_unlock): Remove trailing semicolon.
7597         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
7598
7599 2002-12-12  Roland McGrath  <roland@redhat.com>
7600
7601         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
7602         "m" constraint to refer to __libc_locking_needed.  Declare it here.
7603
7604 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7605
7606         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
7607         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
7608         Initialize __libc_locking_needed.
7609         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
7610         instead of __register_pthread_fork_handler.
7611         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
7612         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
7613         fork-gen with libc_pthread_init.
7614         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
7615         of __register_pthread_fork_handler.
7616         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
7617         of __register_pthread_fork_handler.
7618         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
7619         __libc_locking_needed to determine whether lock prefix can be avoided.
7620         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7621
7622 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
7623
7624         * Makefile (tests): Add tst-cleanup1.
7625         * tst-cleanup1.c: New file.
7626         * cancellation.c (__cleanup_thread): Removed.
7627         (__do_cancel): Remove call to __cleanup_thread.
7628         * pthreadP.h: Remove __cleanup_thread prorotype.
7629
7630         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
7631         Remember function and argument even if cancellation handler
7632         function is not available.
7633         (__libc_cleanup_region_end): Execute registered function directly if
7634         pthread functions are not available.
7635         (__libc_cleanup_end): Likewise.
7636
7637         * init.c (__pthread_initialize_minimal): Fix initialization in
7638         static lib by preventing gcc from being too clever.
7639
7640 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
7641
7642         * init.c (__pthread_initialize_minimal): Remove unneccesary
7643         sigaddset call.
7644
7645         * Makefile (tests): We can run tst-locale2 now.
7646
7647 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
7648
7649         * Versions: Remove duplicated sigwait entry.
7650
7651 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
7652
7653         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
7654         inside libpthread.
7655
7656         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
7657
7658         * pthreadP.h: Declare __pthread_enable_asynccancel and
7659         __pthread_disable_asynccancel.
7660         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
7661         (CANCEL_RESET): Use __pthread_disable_asynccancel.
7662         * cancellation.c (__pthread_enable_asynccancel): New function.
7663         (__pthread_disable_asynccancel): New function.
7664         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
7665         * pt-close.c: Likewise.
7666         * pt-connect.c: Likewise.
7667         * pt-creat.c: Likewise.
7668         * pt-fcntl.c: Likewise.
7669         * pt-fsync.c: Likewise.
7670         * pt-lseek.c: Likewise.
7671         * pt-lseek64.c: Likewise.
7672         * pt-msgrcv.c: Likewise.
7673         * pt-msgsnd.c: Likewise.
7674         * pt-msync.c: Likewise.
7675         * pt-nanosleep.c: Likewise.
7676         * pt-open.c: Likewise.
7677         * pt-open64.c: Likewise.
7678         * pt-pause.c: Likewise.
7679         * pt-poll.c: Likewise.
7680         * pt-pread.c: Likewise.
7681         * pt-pread64.c: Likewise.
7682         * pt-pselect.c: Likewise.
7683         * pt-pwrite.c: Likewise.
7684         * pt-pwrite64.c: Likewise.
7685         * pt-read.c: Likewise.
7686         * pt-readv.c: Likewise.
7687         * pt-recv.c: Likewise.
7688         * pt-recvfrom.c: Likewise.
7689         * pt-recvmsg.c: Likewise.
7690         * pt-select.c: Likewise.
7691         * pt-send.c: Likewise.
7692         * pt-sendmsg.c: Likewise.
7693         * pt-sendto.c: Likewise.
7694         * pt-sigpause.c: Likewise.
7695         * pt-sigsuspend.c: Likewise.
7696         * pt-sigtimedwait.c: Likewise.
7697         * pt-sigwait.c: Likewise.
7698         * pt-sigwaitinfo.c: Likewise.
7699         * pt-system.c: Likewise.
7700         * pt-tcdrain.c: Likewise.
7701         * pt-wait.c: Likewise.
7702         * pt-waitid.c: Likewise.
7703         * pt-waitpid.c: Likewise.
7704         * pt-write.c: Likewise.
7705         * pt-writev.c: Likewise.
7706         * pthread_join.c: Likewise.
7707         * pthread_timedjoin.c: Likewise.
7708
7709         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
7710         (__xpg_sigpause): New function.
7711         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
7712
7713 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
7714
7715         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
7716
7717         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
7718         _GI_pthread_cleanup_pop to pthreadP.h.
7719
7720         * ftrylockfile.c: Use _IO_lock_trylock instead of
7721         pthread_mutex_trylock.
7722
7723         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
7724         (CANCEL_RESET): Likewise.
7725         (__pthread_setcanceltype_): Declare.
7726         (__pthread_mutex_lock_internal): Declare.
7727         (__pthread_mutex_unlock_internal): Declare.
7728         (__pthread_once_internal): Declare.
7729         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
7730         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
7731
7732         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
7733         and pthread_mutex_unlock.
7734         * pthread_cond_wait.c: Likewise.
7735         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
7736         * pthread_mutex_unlock.c: Likewise.
7737
7738         * pthread_setcanceltype.c: Add additional alias
7739         __pthread_setcanceltype.
7740
7741         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
7742         * sem_open.c (sem_open): Likewise.
7743         Use __libc_open, __libc_write, and __libc_close instead of
7744         open, write, and close respectively.
7745
7746         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
7747         Rewrite as statement expression since it must return a value.
7748
7749         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
7750         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
7751         __pthread_kill.
7752
7753         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
7754         alias __pthread_once_internal.
7755
7756         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
7757
7758 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
7759
7760         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
7761         * tst-stdio1.c: New file.
7762         * tst-stdio2.c: New file.
7763
7764         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
7765
7766         * Makefile (tests): Comment out tst-locale2 for now.
7767         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
7768
7769         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
7770         -D_IO_MTSAFE_IO.
7771         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
7772         Use _IO_lock_init instead of explicit assignment.
7773
7774         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
7775         Define __libc_lock_* and __libc_lock_recursive macros with
7776         lowlevellock macros, not pthread mutexes.
7777
7778         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
7779         of pthread_mutex_lock.
7780         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
7781         instead of pthread_mutex_unlock.
7782
7783 2002-12-06  Roland McGrath  <roland@redhat.com>
7784
7785         * allocatestack.c (__stack_user): Use uninitialized defn.
7786         * init.c (__pthread_initialize_minimal): Initialize it here.
7787
7788 2002-12-05  Roland McGrath  <roland@redhat.com>
7789
7790         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
7791         string.
7792         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
7793
7794         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
7795         missing & here too.
7796
7797 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
7798
7799         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7800         lowlevellock.
7801         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
7802         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
7803         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
7804         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
7805         for __libc_lock_* macros.
7806         * Makefile (routines): Add libc-lowlevellock.
7807
7808 2002-10-09  Roland McGrath  <roland@redhat.com>
7809
7810         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
7811         Under [__PIC__], call the function via the pointer fetched for
7812         comparison rather than a call by name that uses the PLT.
7813         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
7814         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
7815         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
7816         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
7817         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
7818
7819 2002-12-04  Roland McGrath  <roland@redhat.com>
7820
7821         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
7822
7823         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
7824         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
7825
7826         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
7827
7828 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7829
7830         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
7831         a completely opaque, non-integer type.
7832         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7833
7834 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
7835
7836         * sysdeps/i386/tls.h: Include stdlib.h.
7837         * sysdeps/x86_64/tls.h: Likewise.
7838
7839 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7840
7841         * Makefile (tests): Add tst-locale2.
7842         (tests-static): Likewise.
7843         * tst-locale2.c: New file.
7844
7845         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
7846         volatile and add memory clobbers to lock operations.
7847
7848 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
7849
7850         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
7851         * sysdeps/i386/i486/bits/atomic.h: New file.
7852         * sysdeps/i386/i586/bits/atomic.h: New file.
7853         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
7854         include i486 version.
7855         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
7856         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
7857         Patch by Marijn Ros <marijn@mad.scientist.com>.
7858
7859         * allocatestack.c (get_cached_stack): Don't crash if we first
7860         found a stack with a larger size then needed.
7861         Reported by Hui Huang <hui.huang@sun.com>.
7862
7863         * Makefile (tests): Add tst-sysconf.
7864         * tst-sysconf.c: New file.
7865
7866         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
7867         PTHREAD_THREADS_MAX.
7868
7869 2002-12-02  Roland McGrath  <roland@redhat.com>
7870
7871         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
7872         Declare using hidden_proto instead of attribute_hidden, so there are
7873         non-.hidden static symbols for gdb to find.
7874         (__pthread_keys): Likewise.
7875         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
7876         * allocatestack.c (__stack_user): Likewise.
7877         * pthread_create.c (__pthread_keys): Likewise.
7878         (__nptl_threads_events, __nptl_last_event): Make these static instead
7879         of hidden.
7880         * pthread_key_create.c (__pthread_pthread_keys_max,
7881         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
7882
7883 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
7884
7885         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
7886         statically.
7887         * tst-locale1.c: New file.
7888
7889         * pthread_cond_timedwait.c: Include <stdlib.h>.
7890
7891         * Makefile (tests): Add tst-fork2 and tst-fork3.
7892         * tst-fork2.c: New file.
7893         * tst-fork3.c: New file.
7894
7895 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
7896
7897         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
7898
7899         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
7900         require it to 200112L.
7901
7902         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
7903         instruction only if HAVE_CMOV is defined.
7904         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
7905
7906         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
7907
7908         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
7909
7910         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
7911
7912         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
7913
7914 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
7915
7916         * sysdeps/x86_64/bits/atomic.h: New file.
7917
7918         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
7919         16-bit operations.
7920
7921         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
7922         possible since gettid cannot fail.
7923
7924         * sysdeps/x86_64/pthreaddef.h: New file.
7925
7926         * sysdeps/i386/pthreaddef.h (gettid): Removed.
7927
7928         * sysdeps/x86_64/pthread_spin_init.c: New file.
7929         * sysdeps/x86_64/pthread_spin_lock.c: New file.
7930         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
7931         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
7932
7933         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
7934         Add missing lock prefix.  Minute optimization.
7935
7936         * tst-spin2.c (main): Also check successful trylock call.
7937
7938         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
7939         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
7940
7941         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
7942         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
7943
7944         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
7945         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
7946         value in case of an error.  Add support for INTERNAL_SYSCALL.
7947
7948         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
7949         value in case of an error.
7950
7951         * sysdeps/x86_64/tls.h: New file.
7952
7953 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7954
7955         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
7956         takes the array member name and the index as parameters.
7957         (THREAD_SETMEM_NC): Likewise.
7958         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
7959         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
7960         interfaces.
7961
7962         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
7963         to decide which code to use.
7964         (THREAD_SETMEM_NC): Likewise.
7965
7966         * allocatestack.c (queue_stack): Don't remove stack from list here.
7967         Do it in the caller.  Correct condition to prematurely terminate
7968         loop to free stacks.
7969         (__deallocate_stack): Remove stack from list here.
7970
7971 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7972
7973         * Makefile (tests): Add tst-stack1.
7974         * tst-stack1.c: New file.
7975
7976         * allocatestack.c (allocate_stack): Initialize the TCB on a user
7977         provided stack.
7978
7979         * pthread_attr_getstack.c: Return bottom of the thread area.
7980
7981 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
7982
7983         * Makefile (libpthread-routines): Add pt-allocrtsig and
7984         pthread_kill_other_threads.
7985         * pt-allocrtsig.c: New file.
7986         * pthread_kill_other_threads.c: New file.
7987         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
7988         all three functions.
7989         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7990         allocrtsig.
7991         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
7992         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
7993         and __libc_allocate_rtsig_private.
7994         * Versions (libpthread): Export pthread_kill_other_threads_np,
7995         __libc_current_sigrtmin, and __libc_current_sigrtmax.
7996
7997 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
7998
7999         * allocatestack.c (allocate_stack): stackaddr in attribute points to
8000         the end of the stack.  Adjust computations.
8001         When mprotect call fails dequeue stack and free it.
8002         * pthread_attr_setstack.c: Store top of the stack in stackaddr
8003         attribute.
8004         * pthread_getattr_np.c: Likewise.
8005
8006         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
8007         surprises.
8008
8009 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
8010
8011         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
8012         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
8013
8014 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
8015
8016         * pthread_getspecific.c: Optimize access to first 2nd-level array.
8017         * pthread_setspecific.c: Likewise.
8018
8019 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
8020
8021         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
8022         definitions.  Get them from the official place.
8023         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
8024
8025         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
8026         Use new CLONE_ flags in clone() calls.
8027
8028         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
8029         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
8030
8031         * Versions: Add pthread_* functions for libc.
8032         * forward.c: New file.
8033
8034         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
8035         errno-loc.
8036         * herrno.c: New file.
8037         * res.c: New file.
8038
8039         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
8040         sem_trywait, and sem_timedwait.  Add herrno and res.
8041         * sem_init.c: Don't initialize lock and waiters members.
8042         * sem_open.c: Likewise.
8043         * sem_post.c: Removed.
8044         * sem_wait.c: Removed.
8045         * sem_trywait.c: Removed.
8046         * sem_timedwait.c: Removed.
8047         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
8048         Includes full implementations of sem_post, sem_wait, sem_trywait,
8049         and sem_timedwait.
8050         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
8051         for new implementation.
8052         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
8053         and waiters fields.
8054
8055         * tst-sem3.c: Improve error message.
8056         * tst-signal3.c: Likewise.
8057
8058         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
8059         to tell the kernel about the termination futex and to initialize tid
8060         member.  Don't initialize main_thread.
8061         * descr.h (struct pthread): Remove main_thread member.
8062         * cancelllation.c (__do_cancel): Remove code handling main thread.
8063         The main thread is not special anymore.
8064
8065         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
8066         size of the stacks to stack_cache_actsize.
8067
8068         * pt-readv.c: Add missing "defined".
8069         * pt-sigwait.c: Likewise.
8070         * pt-writev.c: Likewise.
8071
8072 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
8073
8074         * Versions: Export __connect from libpthread.
8075         Patch by Luca Barbieri <ldb@ldb.ods.org>.
8076
8077         * Makefile (libpthread-routines): Add pt-raise.
8078         * sysdeps/unix/sysv/linux/raise.c: New file.
8079         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
8080         * sysdeps/generic/pt-raise.c: New file.
8081
8082         * pthread_cond_init.c: Initialize all data elements of the condvar
8083         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
8084
8085         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
8086         * pthread_create.c: Likewise.
8087
8088         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
8089         * tst-key1.c: New file.
8090         * tst-key2.c: New file.
8091         * tst-key3.c: New file.
8092
8093         * Versions: Export pthread_detach for version GLIBC_2.0.
8094         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
8095
8096 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
8097
8098         * pthread_key_create.c: Terminate search after an unused key was found.
8099         Patch by Luca Barbieri <ldb@ldb.ods.org>.
8100
8101         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
8102         Patch by Luca Barbieri <ldb@ldb.ods.org>.
8103
8104 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
8105
8106         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
8107         dynamic lookup for errno in PIC.
8108
8109         * allocatestack.c (get_cached_stack): Rearrange code slightly to
8110         release the stack lock as soon as possible.
8111         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
8112         the static TLS block.
8113         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
8114
8115         * cancellation.c: Renamed from cancelation.c.
8116         * Makefile: Adjust accordingly.
8117         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
8118         * cleanup_defer.c: Use CANCELLATION_P.
8119         * pthread_testcancel.c: Likewise.
8120         * descr.h: Fix spelling in comments.
8121         * init.c: Likewise.
8122         * pthread_getattr_np.c: Likewise.
8123         * pthread_getschedparam.c: Likewise.
8124         * pthread_setschedparam.c: Likewise.
8125         * Versions: Likewise.
8126
8127         * pt-pselect.c: New file.
8128         * Makefile (libpthread-routines): Add pt-pselect.
8129         * Versions: Add pselect.
8130
8131         * tst-cancel4.c: New file.
8132         * Makefile (tests): Add tst-cancel4.
8133
8134 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
8135
8136         * pthread_mutex_lock.c: Always record lock ownership.
8137         * pthread_mutex_timedlock.c: Likewise.
8138         * pthread_mutex_trylock.c: Likewise.
8139
8140         * pt-readv.c: New file.
8141         * pt-writev.c: New file.
8142         * pt-creat.c: New file.
8143         * pt-msgrcv.c: New file.
8144         * pt-msgsnd.c: New file.
8145         * pt-poll.c: New file.
8146         * pt-select.c: New file.
8147         * pt-sigpause.c: New file.
8148         * pt-sigsuspend.c: New file.
8149         * pt-sigwait.c: New file.
8150         * pt-sigwaitinfo.c: New file.
8151         * pt-waitid.c: New file.
8152         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
8153         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
8154         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
8155         * Versions: Add all the new functions.
8156
8157         * tst-exit1.c: New file.
8158         * Makefile (tests): Add tst-exit1.
8159
8160         * sem_timedwait.c: Minor optimization for more optimal fastpath.
8161
8162 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
8163
8164         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
8165
8166         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
8167         call.  pthread_join is an official cancellation point.
8168         * pthread_timedjoin.c: Likewise.
8169
8170         * pthread_cond_wait.c: Revert order in which internal lock are dropped
8171         and the condvar's mutex are retrieved.
8172         * pthread_cond_timedwait.c: Likewise.
8173         Reported by dice@saros.East.Sun.COM.
8174
8175 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
8176
8177         * pthreadP.h: Cut out all type definitions and move them...
8178         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
8179         * pthreadP.h: Include <internaltypes.h>.
8180
8181         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
8182         performance tweaks.
8183
8184         * sem_trywait.c: Shuffle #includes around to get right order.
8185         * sem_timedwait.c: Likewise.
8186         * sem_post.c: Likewise.
8187         * sem_wait.c: Likewise.
8188
8189         * nptl 0.3 released.
8190
8191         * Makefile (tests): Add tst-signal3.
8192         * tst-signal3.c: New file.
8193
8194 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
8195
8196         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
8197         the asms modify the sem object.
8198         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
8199
8200         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
8201         the actual members.
8202         * pthreadP.h (struct sem): New type.  Actual semaphore type.
8203         * semaphoreP.h: Include pthreadP.h.
8204         * sem_getvalue.c: Adjust to sem_t change.
8205         * sem_init.c: Likewise.
8206         * sem_open.c: Likewise.
8207         * sem_post.c: Likewise.
8208         * sem_timedwait.c: Likewise.
8209         * sem_trywait.c: Likewise.
8210         * sem_wait.c: Likewise.
8211
8212 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
8213
8214         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
8215         * tst-basic2.c: New file.
8216         * tst-exec1.c: New file.
8217         * tst-exec2.c: New file.
8218         * tst-exec3.c: New file.
8219
8220         * tst-fork1.c: Remove extra */.
8221
8222         * nptl 0.2 released.  The API for IA-32 is complete.