From e1e46622ac0fce73d802fa4a8a2e83cc25cd9e7a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 14 Feb 2015 23:04:02 -0600 Subject: Revert "resolve merge" This reverts commit 6b6ede3d15f04fe825cfa9f697507457e3640344. --- libpthread/linuxthreads/Makefile.in | 87 +- libpthread/linuxthreads/alloca_cutoff.c | 35 + libpthread/linuxthreads/attr.c | 377 ++++- libpthread/linuxthreads/barrier.c | 127 ++ libpthread/linuxthreads/cancel.c | 90 +- libpthread/linuxthreads/condvar.c | 60 +- libpthread/linuxthreads/debug.h | 40 - libpthread/linuxthreads/descr.h | 268 ++++ libpthread/linuxthreads/errno.c | 15 +- libpthread/linuxthreads/events.c | 14 +- libpthread/linuxthreads/forward.c | 31 +- libpthread/linuxthreads/internals.h | 636 ++++---- libpthread/linuxthreads/join.c | 57 +- libpthread/linuxthreads/libc-cancellation.c | 60 + libpthread/linuxthreads/libc_pthread_init.c | 15 +- libpthread/linuxthreads/linuxthreads.texi | 1627 -------------------- libpthread/linuxthreads/locale.c | 57 - libpthread/linuxthreads/lockfile.c | 29 +- libpthread/linuxthreads/manager.c | 829 ++++++---- libpthread/linuxthreads/mutex.c | 57 +- libpthread/linuxthreads/pt-machine.c | 15 +- libpthread/linuxthreads/ptcleanup.c | 74 + libpthread/linuxthreads/ptclock_gettime.c | 67 + libpthread/linuxthreads/ptclock_settime.c | 53 + libpthread/linuxthreads/ptfork.c | 173 +-- libpthread/linuxthreads/pthandles.c | 5 + libpthread/linuxthreads/pthread.c | 1318 +++++++++------- libpthread/linuxthreads/pthread_atfork.c | 62 + libpthread/linuxthreads/pthread_setegid.c | 27 + libpthread/linuxthreads/pthread_seteuid.c | 27 + libpthread/linuxthreads/pthread_setgid.c | 27 + libpthread/linuxthreads/pthread_setregid.c | 27 + libpthread/linuxthreads/pthread_setresgid.c | 27 + libpthread/linuxthreads/pthread_setresuid.c | 27 + libpthread/linuxthreads/pthread_setreuid.c | 27 + libpthread/linuxthreads/pthread_setuid.c | 27 + libpthread/linuxthreads/ptlongjmp.c | 67 - libpthread/linuxthreads/queue.h | 1 + libpthread/linuxthreads/restart.h | 3 +- libpthread/linuxthreads/rwlock.c | 250 ++- libpthread/linuxthreads/semaphore.c | 18 +- libpthread/linuxthreads/semaphore.h | 2 +- libpthread/linuxthreads/sighandler.c | 71 + libpthread/linuxthreads/signals.c | 137 +- libpthread/linuxthreads/specific.c | 223 +-- libpthread/linuxthreads/spinlock.c | 24 +- libpthread/linuxthreads/spinlock.h | 8 +- .../linuxthreads/sysdeps/alpha/elf/pt-initfini.c | 89 ++ libpthread/linuxthreads/sysdeps/alpha/pspinlock.c | 109 ++ libpthread/linuxthreads/sysdeps/alpha/tls.h | 133 ++ libpthread/linuxthreads/sysdeps/arc/pt-machine.h | 42 - libpthread/linuxthreads/sysdeps/arm/pspinlock.c | 81 + libpthread/linuxthreads/sysdeps/arm/pt-machine.h | 69 +- .../linuxthreads/sysdeps/arm/sysdep-cancel.h | 8 + libpthread/linuxthreads/sysdeps/arm/tls.h | 171 ++ libpthread/linuxthreads/sysdeps/bfin/pt-machine.h | 75 - libpthread/linuxthreads/sysdeps/c6x/pt-machine.h | 63 - libpthread/linuxthreads/sysdeps/cris/pspinlock.c | 71 + libpthread/linuxthreads/sysdeps/cris/pt-machine.h | 21 +- libpthread/linuxthreads/sysdeps/frv/pt-machine.h | 69 - libpthread/linuxthreads/sysdeps/h8300/pt-machine.h | 57 - libpthread/linuxthreads/sysdeps/hppa/pspinlock.c | 80 + libpthread/linuxthreads/sysdeps/hppa/pt-machine.h | 59 + .../linuxthreads/sysdeps/i386/i686/pt-machine.h | 78 + libpthread/linuxthreads/sysdeps/i386/pspinlock.c | 102 ++ libpthread/linuxthreads/sysdeps/i386/pt-machine.h | 93 +- .../linuxthreads/sysdeps/i386/tcb-offsets.sym | 7 + libpthread/linuxthreads/sysdeps/i386/tls.h | 84 +- libpthread/linuxthreads/sysdeps/i386/useldt.h | 19 +- libpthread/linuxthreads/sysdeps/ia64/pspinlock.c | 78 + libpthread/linuxthreads/sysdeps/ia64/pt-machine.h | 6 +- .../linuxthreads/sysdeps/ia64/tcb-offsets.sym | 9 + libpthread/linuxthreads/sysdeps/ia64/tls.h | 6 + libpthread/linuxthreads/sysdeps/m68k/pspinlock.c | 91 ++ libpthread/linuxthreads/sysdeps/m68k/pt-machine.h | 8 +- .../linuxthreads/sysdeps/microblaze/pt-machine.h | 106 -- .../sysdeps/microblaze/sigcontextinfo.h | 17 - libpthread/linuxthreads/sysdeps/mips/pspinlock.c | 95 ++ libpthread/linuxthreads/sysdeps/mips/pt-machine.h | 41 +- libpthread/linuxthreads/sysdeps/mips/tls.h | 169 ++ libpthread/linuxthreads/sysdeps/nios/pt-machine.h | 67 - libpthread/linuxthreads/sysdeps/nios2/pt-machine.h | 57 - .../sysdeps/powerpc/powerpc32/pspinlock.c | 69 + .../sysdeps/powerpc/powerpc32/pt-machine.h | 119 ++ .../sysdeps/powerpc/powerpc64/pspinlock.c | 69 + .../sysdeps/powerpc/powerpc64/pt-machine.h | 184 +++ .../linuxthreads/sysdeps/powerpc/pspinlock.c | 8 + .../linuxthreads/sysdeps/powerpc/pt-machine.h | 103 +- .../linuxthreads/sysdeps/powerpc/tcb-offsets.sym | 19 + libpthread/linuxthreads/sysdeps/powerpc/tls.h | 164 ++ .../linuxthreads/sysdeps/pthread/bits/initspin.h | 27 + .../linuxthreads/sysdeps/pthread/bits/libc-lock.h | 65 +- .../linuxthreads/sysdeps/pthread/bits/libc-tsd.h | 14 +- .../sysdeps/pthread/bits/pthreadtypes.h | 12 +- .../linuxthreads/sysdeps/pthread/bits/typesizes.h | 65 + .../linuxthreads/sysdeps/pthread/errno-loc.c | 44 + .../linuxthreads/sysdeps/pthread/flockfile.c | 32 + .../linuxthreads/sysdeps/pthread/ftrylockfile.c | 32 + .../linuxthreads/sysdeps/pthread/funlockfile.c | 32 + .../linuxthreads/sysdeps/pthread/getcpuclockid.c | 116 ++ .../linuxthreads/sysdeps/pthread/herrno-loc.c | 44 + libpthread/linuxthreads/sysdeps/pthread/list.h | 113 ++ .../linuxthreads/sysdeps/pthread/malloc-machine.h | 66 + .../linuxthreads/sysdeps/pthread/not-cancel.h | 4 +- .../linuxthreads/sysdeps/pthread/posix-timer.h | 203 +++ .../linuxthreads/sysdeps/pthread/pt-initfini.c | 123 ++ .../sysdeps/pthread/pthread-functions.h | 14 +- libpthread/linuxthreads/sysdeps/pthread/pthread.h | 46 +- .../linuxthreads/sysdeps/pthread/ptlongjmp.c | 32 + .../linuxthreads/sysdeps/pthread/res-state.c | 46 + .../linuxthreads/sysdeps/pthread/semaphore.h | 1 + .../linuxthreads/sysdeps/pthread/sigaction.c | 56 + .../linuxthreads/sysdeps/pthread/tcb-offsets.h | 1 + .../linuxthreads/sysdeps/pthread/timer_create.c | 169 ++ .../linuxthreads/sysdeps/pthread/timer_delete.c | 69 + .../linuxthreads/sysdeps/pthread/timer_getoverr.c | 44 + .../linuxthreads/sysdeps/pthread/timer_gettime.c | 76 + .../linuxthreads/sysdeps/pthread/timer_routines.c | 572 +++++++ .../linuxthreads/sysdeps/pthread/timer_settime.c | 136 ++ libpthread/linuxthreads/sysdeps/pthread/tls.h | 80 - .../linuxthreads/sysdeps/pthread/tst-timer.c | 113 ++ .../linuxthreads/sysdeps/pthread/uClibc-glue.h | 47 + libpthread/linuxthreads/sysdeps/sh/pspinlock.c | 79 + libpthread/linuxthreads/sysdeps/sh/tcb-offsets.sym | 10 + libpthread/linuxthreads/sysdeps/sh/tls.h | 140 +- libpthread/linuxthreads/sysdeps/sh64/Makefile.arch | 30 - libpthread/linuxthreads/sysdeps/sh64/pt-machine.c | 46 - libpthread/linuxthreads/sysdeps/sh64/pt-machine.h | 38 - libpthread/linuxthreads/sysdeps/sparc/pspinlock.c | 87 ++ .../linuxthreads/sysdeps/sparc/tcb-offsets.h | 1 - .../linuxthreads/sysdeps/sparc/tcb-offsets.sym | 4 + libpthread/linuxthreads/sysdeps/sparc/tls.h | 114 ++ .../sysdeps/unix/sysv/linux/allocalim.h | 25 + .../sysdeps/unix/sysv/linux/allocrtsig.c | 88 ++ .../sysdeps/unix/sysv/linux/alpha/aio_cancel.c | 33 + .../sysdeps/unix/sysv/linux/alpha/bits/local_lim.h | 91 ++ .../sysdeps/unix/sysv/linux/alpha/bits/typesizes.h | 65 + .../sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S | 27 + .../sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h | 145 ++ .../sysdeps/unix/sysv/linux/alpha/vfork.S | 69 + .../sysdeps/unix/sysv/linux/arm/sysdep-cancel.h | 129 ++ .../sysdeps/unix/sysv/linux/arm/vfork.S | 77 + .../linuxthreads/sysdeps/unix/sysv/linux/execve.c | 39 + .../linuxthreads/sysdeps/unix/sysv/linux/fork.c | 29 + .../linuxthreads/sysdeps/unix/sysv/linux/fork.h | 57 + .../sysdeps/unix/sysv/linux/hppa/aio_cancel.c | 33 + .../sysdeps/unix/sysv/linux/hppa/bits/initspin.h | 26 + .../sysdeps/unix/sysv/linux/hppa/malloc-machine.h | 72 + .../sysdeps/unix/sysv/linux/hppa/pt-initfini.c | 108 ++ .../sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h | 188 +++ .../sysdeps/unix/sysv/linux/i386/sysdep-cancel.h | 186 +++ .../sysdeps/unix/sysv/linux/i386/vfork.S | 94 ++ .../sysdeps/unix/sysv/linux/ia64/bits/local_lim.h | 91 ++ .../sysdeps/unix/sysv/linux/ia64/fork.h | 24 + .../sysdeps/unix/sysv/linux/ia64/pt-initfini.c | 141 ++ .../sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c | 32 + .../sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h | 143 ++ .../sysdeps/unix/sysv/linux/ia64/vfork.S | 53 + .../sysdeps/unix/sysv/linux/jmp-unwind.c | 34 + .../sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h | 128 ++ .../sysdeps/unix/sysv/linux/m68k/vfork.S | 83 + .../unix/sysv/linux/mips/mips64/sysdep-cancel.h | 143 ++ .../sysdeps/unix/sysv/linux/mips/sysdep-cancel.h | 143 ++ .../sysdeps/unix/sysv/linux/mips/vfork.S | 104 ++ .../sysdeps/unix/sysv/linux/mq_notify.c | 284 ++++ .../sysv/linux/powerpc/powerpc32/sysdep-cancel.h | 158 ++ .../unix/sysv/linux/powerpc/powerpc32/vfork.S | 85 + .../sysv/linux/powerpc/powerpc64/sysdep-cancel.h | 126 ++ .../unix/sysv/linux/powerpc/powerpc64/vfork.S | 90 ++ .../sysdeps/unix/sysv/linux/powerpc/ptlongjmp.c | 70 + .../sysdeps/unix/sysv/linux/pt-sigsuspend.c | 32 + .../linuxthreads/sysdeps/unix/sysv/linux/raise.c | 41 + .../sysdeps/unix/sysv/linux/register-atfork.c | 86 ++ .../sysdeps/unix/sysv/linux/sh/pt-initfini.c | 142 ++ .../linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h | 23 + .../sysdeps/unix/sysv/linux/sh/sysdep-cancel.h | 226 +++ .../sysdeps/unix/sysv/linux/sh/vfork.S | 77 + .../linuxthreads/sysdeps/unix/sysv/linux/sigwait.c | 82 + .../linuxthreads/sysdeps/unix/sysv/linux/smp.h | 47 + .../sysdeps/unix/sysv/linux/sparc/aio_cancel.c | 33 + .../sysdeps/unix/sysv/linux/sparc/bits/local_lim.h | 91 ++ .../sysdeps/unix/sysv/linux/sparc/bits/typesizes.h | 65 + .../sysdeps/unix/sysv/linux/sparc/fork.h | 20 + .../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 100 ++ .../sysdeps/unix/sysv/linux/sparc/vfork.S | 64 + .../sysdeps/unix/sysv/linux/unregister-atfork.c | 48 + .../sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c | 1 + .../sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h | 131 ++ .../sysdeps/unix/sysv/linux/x86_64/vfork.S | 61 + libpthread/linuxthreads/sysdeps/v850/pt-machine.h | 52 - libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c | 96 ++ .../linuxthreads/sysdeps/x86_64/pt-machine.h | 156 +- .../linuxthreads/sysdeps/x86_64/tcb-offsets.sym | 4 + .../linuxthreads/sysdeps/xtensa/pt-machine.h | 79 - libpthread/linuxthreads/wrapsyscall.c | 246 --- 195 files changed, 13706 insertions(+), 5216 deletions(-) create mode 100644 libpthread/linuxthreads/alloca_cutoff.c create mode 100644 libpthread/linuxthreads/barrier.c delete mode 100644 libpthread/linuxthreads/debug.h create mode 100644 libpthread/linuxthreads/descr.h create mode 100644 libpthread/linuxthreads/libc-cancellation.c delete mode 100644 libpthread/linuxthreads/linuxthreads.texi delete mode 100644 libpthread/linuxthreads/locale.c create mode 100644 libpthread/linuxthreads/ptcleanup.c create mode 100644 libpthread/linuxthreads/ptclock_gettime.c create mode 100644 libpthread/linuxthreads/ptclock_settime.c create mode 100644 libpthread/linuxthreads/pthandles.c create mode 100644 libpthread/linuxthreads/pthread_atfork.c create mode 100644 libpthread/linuxthreads/pthread_setegid.c create mode 100644 libpthread/linuxthreads/pthread_seteuid.c create mode 100644 libpthread/linuxthreads/pthread_setgid.c create mode 100644 libpthread/linuxthreads/pthread_setregid.c create mode 100644 libpthread/linuxthreads/pthread_setresgid.c create mode 100644 libpthread/linuxthreads/pthread_setresuid.c create mode 100644 libpthread/linuxthreads/pthread_setreuid.c create mode 100644 libpthread/linuxthreads/pthread_setuid.c delete mode 100644 libpthread/linuxthreads/ptlongjmp.c create mode 100644 libpthread/linuxthreads/sighandler.c create mode 100644 libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c create mode 100644 libpthread/linuxthreads/sysdeps/alpha/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/alpha/tls.h delete mode 100644 libpthread/linuxthreads/sysdeps/arc/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/arm/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/arm/tls.h delete mode 100644 libpthread/linuxthreads/sysdeps/bfin/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/c6x/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/cris/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/frv/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/h8300/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/hppa/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/hppa/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/i386/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/i386/tcb-offsets.sym create mode 100644 libpthread/linuxthreads/sysdeps/ia64/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/ia64/tcb-offsets.sym create mode 100644 libpthread/linuxthreads/sysdeps/m68k/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/microblaze/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/microblaze/sigcontextinfo.h create mode 100644 libpthread/linuxthreads/sysdeps/mips/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/mips/tls.h delete mode 100644 libpthread/linuxthreads/sysdeps/nios/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/nios2/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/powerpc/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/powerpc/tcb-offsets.sym create mode 100644 libpthread/linuxthreads/sysdeps/powerpc/tls.h create mode 100644 libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h create mode 100644 libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h create mode 100644 libpthread/linuxthreads/sysdeps/pthread/errno-loc.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/flockfile.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/funlockfile.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/herrno-loc.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/list.h create mode 100644 libpthread/linuxthreads/sysdeps/pthread/malloc-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/pthread/posix-timer.h create mode 100644 libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/ptlongjmp.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/res-state.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/semaphore.h create mode 100644 libpthread/linuxthreads/sysdeps/pthread/sigaction.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/tcb-offsets.h create mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_create.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_delete.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_getoverr.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_gettime.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_routines.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_settime.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/tls.h create mode 100644 libpthread/linuxthreads/sysdeps/pthread/tst-timer.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h create mode 100644 libpthread/linuxthreads/sysdeps/sh/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/sh/tcb-offsets.sym delete mode 100644 libpthread/linuxthreads/sysdeps/sh64/Makefile.arch delete mode 100644 libpthread/linuxthreads/sysdeps/sh64/pt-machine.c delete mode 100644 libpthread/linuxthreads/sysdeps/sh64/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/sparc/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/tcb-offsets.h create mode 100644 libpthread/linuxthreads/sysdeps/sparc/tcb-offsets.sym create mode 100644 libpthread/linuxthreads/sysdeps/sparc/tls.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocalim.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/aio_cancel.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/aio_cancel.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/malloc-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/jmp-unwind.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/ptlongjmp.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/raise.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/register-atfork.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/pt-initfini.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/smp.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/aio_cancel.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/unregister-atfork.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h create mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/v850/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/x86_64/tcb-offsets.sym delete mode 100644 libpthread/linuxthreads/sysdeps/xtensa/pt-machine.h delete mode 100644 libpthread/linuxthreads/wrapsyscall.c (limited to 'libpthread/linuxthreads') diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in index 6be2099d2..c1ec1c9c7 100644 --- a/libpthread/linuxthreads/Makefile.in +++ b/libpthread/linuxthreads/Makefile.in @@ -6,17 +6,23 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -subdirs += libpthread/linuxthreads.old +subdirs += libpthread/linuxthreads/sysdeps/$(TARGET_ARCH) +subdirs += libpthread/linuxthreads/sysdeps/unix/sysv/linux +subdirs += libpthread/linuxthreads/sysdeps/pthread -CFLAGS-dir_linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread -CFLAGS-libpthread/linuxthreads.old := $(CFLAGS-dir_linuxthreads.old) $(SSP_ALL_CFLAGS) +CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread +CFLAGS-libpthread/linuxthreads := $(CFLAGS-dir_linuxthreads) $(SSP_ALL_CFLAGS) + +# This stuff will not compile without at least -O1 +# psm: can't handle this here, could maybe search for -O0 in CFLAGS +# and append -O1 if found +#CFLAGS:=$(CFLAGS:-O0=-O1) ifeq ($(PTHREADS_DEBUG_SUPPORT),y) LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs else LDFLAGS-libpthread.so := $(LDFLAGS) endif -LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libpthread.so := -Wl,--dsbt-index=10 LIBS-libpthread.so := $(LIBS) $(ldso) @@ -25,42 +31,51 @@ END_FILE-libpthread.so := $(SHARED_END_FILES) libpthread_FULL_NAME := libpthread-$(VERSION).so -libpthread_DIR := $(top_srcdir)libpthread/linuxthreads.old -libpthread_OUT := $(top_builddir)libpthread/linuxthreads.old +libpthread_DIR := $(top_srcdir)libpthread/linuxthreads +libpthread_OUT := $(top_builddir)libpthread/linuxthreads -include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch -libpthread_SRC := \ - attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \ - mutex.c pt-machine.c ptfork.c pthread.c ptlongjmp.c \ - rwlock.c semaphore.c signals.c specific.c spinlock.c wrapsyscall.c -ifeq ($(UCLIBC_HAS_XLOCALE),y) -libpthread_SRC += locale.c -endif - -# remove generic sources, if arch specific version is present -ifneq ($(strip $(libpthread_ARCH_SRC)),) -libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC)) -endif - -libpthread_SRC := $(patsubst %,$(libpthread_DIR)/%,$(libpthread_SRC)) - +pthread_arch_SRC := pspinlock +pthread_arch_SRC := $(patsubst %,$(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/%.c,$(pthread_arch_SRC)) +pthread_linux_SRC := fork pt-sigsuspend register-atfork unregister-atfork +pthread_linux_SRC := $(patsubst %,$(libpthread_DIR)/sysdeps/unix/sysv/linux/%.c,$(pthread_linux_SRC)) +pthread_sysdep_SRC := errno-loc herrno-loc ptlongjmp +pthread_sysdep_SRC := $(patsubst %,$(libpthread_DIR)/sysdeps/pthread/%.c,$(pthread_sysdep_SRC)) +pthread_SRC := \ + attr barrier cancel condvar errno events join pthread \ + lockfile manager mutex pt-machine ptcleanup \ + ptclock_gettime ptclock_settime ptfork pthandles \ + pthread_setegid pthread_seteuid pthread_setgid pthread_setregid \ + pthread_setresgid pthread_setresuid pthread_setreuid pthread_setuid \ + rwlock semaphore sighandler signals specific spinlock +pthread_SRC := $(patsubst %,$(libpthread_DIR)/%.c,$(pthread_SRC)) + +libpthread_static_SRC := pthread_atfork +libpthread_SRC := $(pthread_arch_SRC) $(pthread_linux_SRC) $(pthread_sysdep_SRC) $(pthread_SRC) libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC)) # # Stuff that goes into libc.so, not libpthread.so # -CFLAGS-OMIT-forward.c := $(CFLAGS-dir_linuxthreads.old) -CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads.old) -libpthread_libc_CSRC := forward.c libc_pthread_init.c +#CFLAGS-OMIT-alloca_cutoff.c := $(CFLAGS-dir_linuxthreads) +CFLAGS-OMIT-forward.c := $(CFLAGS-dir_linuxthreads) +CFLAGS-OMIT-libc-cancellation.c := $(CFLAGS-dir_linuxthreads) +CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads) +libpthread_libc_CSRC := \ + forward.c libc-cancellation.c libc_pthread_init.c # alloca_cutoff.c libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC)) -libc-static-y += $(libpthread_OUT)/libc_pthread_init.o +libc-static-y += $(libpthread_OUT)/libc_pthread_init.o $(libpthread_OUT)/libc-cancellation.o libc-shared-y += $(libpthread_libc_OBJ:.o=.oS) +libpthread-static-y += $(patsubst %,$(libpthread_OUT)/%.o,$(libpthread_static_SRC)) + +libpthread-nonshared-y += $(patsubst %,$(libpthread_OUT)/%.oS,$(libpthread_static_SRC)) + ifeq ($(DOPIC),y) -libpthread-a-y += $(libpthread_OBJ:.o=.os) +libpthread-a-y += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os) else -libpthread-a-y += $(libpthread_OBJ) +libpthread-a-y += $(libpthread_OBJ) $(libpthread-static-y) endif libpthread-so-y += $(libpthread_OBJ:.o=.oS) @@ -68,12 +83,16 @@ lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so #ifeq ($(DOMULTI),n) -$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) +$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a $(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION)) #else -#$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc.depend) +#$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a # $(call linkm.so,$(libpthread_FULL_NAME),$(ABI_VERSION)) #endif + $(Q)$(RM) $@ + $(Q)cat $(top_srcdir)extra/scripts/format.lds > $@.tmp + $(Q)echo "GROUP ( $(notdir $@).$(ABI_VERSION) libpthread_nonshared.a )" >> $@.tmp + $(Q)mv $@.tmp $@ ifeq ($(PTHREADS_DEBUG_SUPPORT),y) $(libpthread_OUT)/libpthread_so.a: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug) @@ -110,10 +129,10 @@ linuxthreads_headers := $(top_builddir)include/pthread.h \ $(linuxthreads_headers): $(wildcard $(addprefix $(top_builddir)include/config/linuxthreads/,old.h new.h)) headers-$(UCLIBC_HAS_THREADS) += $(linuxthreads_headers) -objclean-y += CLEAN_libpthread/linuxthreads.old -headers_clean-y += HEADERCLEAN_libpthread/linuxthreads.old -HEADERCLEAN_libpthread/linuxthreads.old: +objclean-y += CLEAN_libpthread/linuxthreads +headers_clean-y += HEADERCLEAN_libpthread/linuxthreads +HEADERCLEAN_libpthread/linuxthreads: $(do_rm) $(linuxthreads_headers) -CLEAN_libpthread/linuxthreads.old: - $(do_rm) $(addprefix $(libpthread_OUT)/*., o os oS a) +CLEAN_libpthread/linuxthreads: + $(do_rm) $(addprefix $(libpthread_OUT)/,$(foreach e, o os oS a,$(foreach d, *. */*. */*/*. */*/*/*.,$(d)$(e)))) diff --git a/libpthread/linuxthreads/alloca_cutoff.c b/libpthread/linuxthreads/alloca_cutoff.c new file mode 100644 index 000000000..9fe13a39d --- /dev/null +++ b/libpthread/linuxthreads/alloca_cutoff.c @@ -0,0 +1,35 @@ +/* Determine whether block of given size can be allocated on the stack or not. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, see . */ + +#include +#include +#include +#include "internals.h" +#include + +int +__libc_alloca_cutoff (size_t size) +{ + if (! SINGLE_THREAD_P) + { + pthread_descr self = thread_self (); + return size <= LIBC_THREAD_GETMEM (self, p_alloca_cutoff); + } + + return size <= __MAX_ALLOCA_CUTOFF; +} diff --git a/libpthread/linuxthreads/attr.c b/libpthread/linuxthreads/attr.c index 8465c234c..a621c2dcc 100644 --- a/libpthread/linuxthreads/attr.c +++ b/libpthread/linuxthreads/attr.c @@ -12,82 +12,49 @@ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Library General Public License for more details. */ -/* changed for uClibc */ -#define __sched_get_priority_min sched_get_priority_min -#define __sched_get_priority_max sched_get_priority_max - /* Handling of thread attributes */ #include +#include +#include +#include +#include #include #include #include +#include #include "pthread.h" #include "internals.h" -libpthread_hidden_proto(pthread_attr_destroy) -libpthread_hidden_proto(pthread_attr_init) -libpthread_hidden_proto(pthread_attr_getdetachstate) -libpthread_hidden_proto(pthread_attr_setdetachstate) -libpthread_hidden_proto(pthread_attr_getinheritsched) -libpthread_hidden_proto(pthread_attr_setinheritsched) -libpthread_hidden_proto(pthread_attr_setschedparam) -libpthread_hidden_proto(pthread_attr_getschedparam) -libpthread_hidden_proto(pthread_attr_getschedpolicy) -libpthread_hidden_proto(pthread_attr_setschedpolicy) -libpthread_hidden_proto(pthread_attr_getscope) -libpthread_hidden_proto(pthread_attr_setscope) - -/* NOTE: With uClibc I don't think we need this versioning stuff. - * Therefore, define the function pthread_attr_init() here using - * a strong symbol. */ -/*int __pthread_attr_init_2_1(pthread_attr_t *attr)*/ -int pthread_attr_init(pthread_attr_t *attr) +int __pthread_attr_init(pthread_attr_t *attr) { - size_t ps = getpagesize (); + size_t ps = __getpagesize (); attr->__detachstate = PTHREAD_CREATE_JOINABLE; attr->__schedpolicy = SCHED_OTHER; attr->__schedparam.sched_priority = 0; attr->__inheritsched = PTHREAD_EXPLICIT_SCHED; attr->__scope = PTHREAD_SCOPE_SYSTEM; +#ifdef NEED_SEPARATE_REGISTER_STACK + attr->__guardsize = ps + ps; +#else attr->__guardsize = ps; +#endif attr->__stackaddr = NULL; attr->__stackaddr_set = 0; attr->__stacksize = STACK_SIZE - ps; return 0; } -libpthread_hidden_def(pthread_attr_init) - -/* uClibc: leave out this for now. */ -#if defined DO_PTHREAD_VERSIONING_WITH_UCLIBC -#if defined __PIC__ && defined DO_VERSIONING -default_symbol_version (__pthread_attr_init_2_1, pthread_attr_init, GLIBC_2.1); - -int __pthread_attr_init_2_0(pthread_attr_t *attr) -{ - attr->__detachstate = PTHREAD_CREATE_JOINABLE; - attr->__schedpolicy = SCHED_OTHER; - attr->__schedparam.sched_priority = 0; - attr->__inheritsched = PTHREAD_EXPLICIT_SCHED; - attr->__scope = PTHREAD_SCOPE_SYSTEM; - return 0; -} -symbol_version (__pthread_attr_init_2_0, pthread_attr_init, GLIBC_2.0); -#else -strong_alias (__pthread_attr_init_2_1, pthread_attr_init) -#endif -#endif /* DO_PTHREAD_VERSIONING_WITH_UCLIBC */ +strong_alias (__pthread_attr_init, pthread_attr_init) -int pthread_attr_destroy(pthread_attr_t *attr attribute_unused) +int __pthread_attr_destroy(pthread_attr_t *attr) { return 0; } -libpthread_hidden_def(pthread_attr_destroy) - +strong_alias (__pthread_attr_destroy, pthread_attr_destroy) -int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate) +int __pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate) { if (detachstate < PTHREAD_CREATE_JOINABLE || detachstate > PTHREAD_CREATE_DETACHED) @@ -95,17 +62,17 @@ int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate) attr->__detachstate = detachstate; return 0; } -libpthread_hidden_def(pthread_attr_setdetachstate) +strong_alias (__pthread_attr_setdetachstate, pthread_attr_setdetachstate) -int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate) +int __pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate) { *detachstate = attr->__detachstate; return 0; } -libpthread_hidden_def(pthread_attr_getdetachstate) +strong_alias (__pthread_attr_getdetachstate, pthread_attr_getdetachstate) -int pthread_attr_setschedparam(pthread_attr_t *attr, - const struct sched_param *param) +int __pthread_attr_setschedparam(pthread_attr_t *attr, + const struct sched_param *param) { int max_prio = __sched_get_priority_max(attr->__schedpolicy); int min_prio = __sched_get_priority_min(attr->__schedpolicy); @@ -115,49 +82,49 @@ int pthread_attr_setschedparam(pthread_attr_t *attr, memcpy (&attr->__schedparam, param, sizeof (struct sched_param)); return 0; } -libpthread_hidden_def(pthread_attr_setschedparam) +strong_alias (__pthread_attr_setschedparam, pthread_attr_setschedparam) -int pthread_attr_getschedparam(const pthread_attr_t *attr, - struct sched_param *param) +int __pthread_attr_getschedparam(const pthread_attr_t *attr, + struct sched_param *param) { memcpy (param, &attr->__schedparam, sizeof (struct sched_param)); return 0; } -libpthread_hidden_def(pthread_attr_getschedparam) +strong_alias (__pthread_attr_getschedparam, pthread_attr_getschedparam) -int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy) +int __pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy) { if (policy != SCHED_OTHER && policy != SCHED_FIFO && policy != SCHED_RR) return EINVAL; attr->__schedpolicy = policy; return 0; } -libpthread_hidden_def(pthread_attr_setschedpolicy) +strong_alias (__pthread_attr_setschedpolicy, pthread_attr_setschedpolicy) -int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy) +int __pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy) { *policy = attr->__schedpolicy; return 0; } -libpthread_hidden_def(pthread_attr_getschedpolicy) +strong_alias (__pthread_attr_getschedpolicy, pthread_attr_getschedpolicy) -int pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit) +int __pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit) { if (inherit != PTHREAD_INHERIT_SCHED && inherit != PTHREAD_EXPLICIT_SCHED) return EINVAL; attr->__inheritsched = inherit; return 0; } -libpthread_hidden_def(pthread_attr_setinheritsched) +strong_alias (__pthread_attr_setinheritsched, pthread_attr_setinheritsched) -int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit) +int __pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit) { *inherit = attr->__inheritsched; return 0; } -libpthread_hidden_def(pthread_attr_getinheritsched) +strong_alias (__pthread_attr_getinheritsched, pthread_attr_getinheritsched) -int pthread_attr_setscope(pthread_attr_t *attr, int scope) +int __pthread_attr_setscope(pthread_attr_t *attr, int scope) { switch (scope) { case PTHREAD_SCOPE_SYSTEM: @@ -169,22 +136,17 @@ int pthread_attr_setscope(pthread_attr_t *attr, int scope) return EINVAL; } } -libpthread_hidden_def(pthread_attr_setscope) +strong_alias (__pthread_attr_setscope, pthread_attr_setscope) -int pthread_attr_getscope(const pthread_attr_t *attr, int *scope) +int __pthread_attr_getscope(const pthread_attr_t *attr, int *scope) { *scope = attr->__scope; return 0; } -libpthread_hidden_def(pthread_attr_getscope) +strong_alias (__pthread_attr_getscope, pthread_attr_getscope) int __pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize) { - size_t ps = getpagesize (); - - /* First round up the guard size. */ - guardsize = roundup (guardsize, ps); - /* The guard size must not be larger than the stack itself */ if (guardsize >= attr->__stacksize) return EINVAL; @@ -210,6 +172,9 @@ int __pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr) } weak_alias (__pthread_attr_setstackaddr, pthread_attr_setstackaddr) +link_warning (pthread_attr_setstackaddr, + "the use of `pthread_attr_setstackaddr' is deprecated, use `pthread_attr_setstack'") + int __pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr) { /* XXX This function has a stupid definition. The standard specifies @@ -219,10 +184,29 @@ int __pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr) return 0; } weak_alias (__pthread_attr_getstackaddr, pthread_attr_getstackaddr) + +link_warning (pthread_attr_getstackaddr, + "the use of `pthread_attr_getstackaddr' is deprecated, use `pthread_attr_getstack'") #endif + int __pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) { +#ifdef FLOATING_STACKS + /* We have to check against the maximum allowed stack size. This is no + problem if the manager is already started and we determined it. If + this hasn't happened, we have to find the limit outself. */ + if (__pthread_max_stacksize == 0) + __pthread_init_max_stacksize (); + + if (stacksize > __pthread_max_stacksize) + return EINVAL; +#else + /* We have a fixed size limit. */ + if (stacksize > STACK_SIZE) + return EINVAL; +#endif + /* We don't accept value smaller than PTHREAD_STACK_MIN. */ if (stacksize < PTHREAD_STACK_MIN) return EINVAL; @@ -230,7 +214,44 @@ int __pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) attr->__stacksize = stacksize; return 0; } + +#if PTHREAD_STACK_MIN == 16384 || defined __UCLIBC__ weak_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize) +#else +versioned_symbol (libpthread, __pthread_attr_setstacksize, + pthread_attr_setstacksize, GLIBC_2_3_3); + +# if SHLIB_COMPAT(libpthread, GLIBC_2_1, GLIBC_2_3_3) + +int __old_pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) +{ +# ifdef FLOATING_STACKS + /* We have to check against the maximum allowed stack size. This is no + problem if the manager is already started and we determined it. If + this hasn't happened, we have to find the limit outself. */ + if (__pthread_max_stacksize == 0) + __pthread_init_max_stacksize (); + + if (stacksize > __pthread_max_stacksize) + return EINVAL; +# else + /* We have a fixed size limit. */ + if (stacksize > STACK_SIZE) + return EINVAL; +# endif + + /* We don't accept value smaller than old PTHREAD_STACK_MIN. */ + if (stacksize < 16384) + return EINVAL; + + attr->__stacksize = stacksize; + return 0; +} +compat_symbol (libpthread, __old_pthread_attr_setstacksize, + pthread_attr_setstacksize, GLIBC_2_1); +# endif +#endif + int __pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize) { @@ -238,3 +259,211 @@ int __pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize) return 0; } weak_alias (__pthread_attr_getstacksize, pthread_attr_getstacksize) + +int __pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, + size_t stacksize) +{ + int err; + + if ((((uintptr_t) stackaddr) + & (__alignof__ (struct _pthread_descr_struct) - 1)) != 0) + err = EINVAL; + else + err = __pthread_attr_setstacksize (attr, stacksize); + if (err == 0) + { +#ifndef _STACK_GROWS_UP + attr->__stackaddr = (char *) stackaddr + stacksize; +#else + attr->__stackaddr = stackaddr; +#endif + attr->__stackaddr_set = 1; + } + + return err; +} + +#if PTHREAD_STACK_MIN == 16384 || defined __UCLIBC__ +weak_alias (__pthread_attr_setstack, pthread_attr_setstack) +#else +versioned_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack, + GLIBC_2_3_3); +# if SHLIB_COMPAT(libpthread, GLIBC_2_2, GLIBC_2_3_3) +int __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, + size_t stacksize) +{ + int err; + + if ((((uintptr_t) stackaddr) + & (__alignof__ (struct _pthread_descr_struct) - 1)) != 0) + err = EINVAL; + else + err = __old_pthread_attr_setstacksize (attr, stacksize); + if (err == 0) + { +# ifndef _STACK_GROWS_UP + attr->__stackaddr = (char *) stackaddr + stacksize; +# else + attr->__stackaddr = stackaddr; +# endif + attr->__stackaddr_set = 1; + } + + return err; +} + +compat_symbol (libpthread, __old_pthread_attr_setstack, pthread_attr_setstack, + GLIBC_2_2); + +# endif +#endif + +int __pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr, + size_t *stacksize) +{ + /* XXX This function has a stupid definition. The standard specifies + no error value but what is if no stack address was set? We simply + return the value we have in the member. */ +#ifndef _STACK_GROWS_UP + *stackaddr = (char *) attr->__stackaddr - attr->__stacksize; +#else + *stackaddr = attr->__stackaddr; +#endif + *stacksize = attr->__stacksize; + return 0; +} +weak_alias (__pthread_attr_getstack, pthread_attr_getstack) + +int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr) +{ + pthread_handle handle = thread_handle (thread); + pthread_descr descr; + int ret = 0; + + if (handle == NULL) + return ENOENT; + + descr = handle->h_descr; + + attr->__detachstate = (descr->p_detached + ? PTHREAD_CREATE_DETACHED + : PTHREAD_CREATE_JOINABLE); + + attr->__schedpolicy = __sched_getscheduler (descr->p_pid); + if (attr->__schedpolicy == -1) + return errno; + + if (__sched_getparam (descr->p_pid, + (struct sched_param *) &attr->__schedparam) != 0) + return errno; + + attr->__inheritsched = descr->p_inheritsched; + attr->__scope = PTHREAD_SCOPE_SYSTEM; + +#ifdef _STACK_GROWS_DOWN +# ifdef __UCLIBC_HAS_TLS__ + attr->__stacksize = descr->p_stackaddr - (char *)descr->p_guardaddr + - descr->p_guardsize; +# else + attr->__stacksize = (char *)(descr + 1) - (char *)descr->p_guardaddr + - descr->p_guardsize; +# endif +#else +# ifdef __UCLIBC_HAS_TLS__ + attr->__stacksize = (char *)descr->p_guardaddr - descr->p_stackaddr; +# else + attr->__stacksize = (char *)descr->p_guardaddr - (char *)descr; +# endif +#endif + attr->__guardsize = descr->p_guardsize; + attr->__stackaddr_set = descr->p_userstack; +#ifdef NEED_SEPARATE_REGISTER_STACK + if (descr->p_userstack == 0) + attr->__stacksize *= 2; + /* XXX This is awkward. The guard pages are in the middle of the + two stacks. We must count the guard size in the stack size since + otherwise the range of the stack area cannot be computed. */ + attr->__stacksize += attr->__guardsize; +#endif +#ifdef __UCLIBC_HAS_TLS__ + attr->__stackaddr = descr->p_stackaddr; +#else +# ifndef _STACK_GROWS_UP + attr->__stackaddr = (char *)(descr + 1); +# else + attr->__stackaddr = (char *)descr; +# endif +#endif + +#ifdef __UCLIBC_HAS_TLS__ + if (attr->__stackaddr == NULL) +#else + if (descr == &__pthread_initial_thread) +#endif + { + /* Stack size limit. */ + struct rlimit rl; + + /* The safest way to get the top of the stack is to read + /proc/self/maps and locate the line into which + __libc_stack_end falls. */ + FILE *fp = fopen ("/proc/self/maps", "rc"); + if (fp == NULL) + ret = errno; + /* We need the limit of the stack in any case. */ + else if (getrlimit (RLIMIT_STACK, &rl) != 0) + ret = errno; + else + { + /* We need no locking. */ + __fsetlocking (fp, FSETLOCKING_BYCALLER); + + /* Until we found an entry (which should always be the case) + mark the result as a failure. */ + ret = ENOENT; + + char *line = NULL; + size_t linelen = 0; + uintptr_t last_to = 0; + + while (! feof_unlocked (fp)) + { + if (getdelim (&line, &linelen, '\n', fp) <= 0) + break; + + uintptr_t from; + uintptr_t to; + if (sscanf (line, "%" SCNxPTR "-%" SCNxPTR, &from, &to) != 2) + continue; + if (from <= (uintptr_t) __libc_stack_end + && (uintptr_t) __libc_stack_end < to) + { + /* Found the entry. Now we have the info we need. */ + attr->__stacksize = rl.rlim_cur; +#ifdef _STACK_GROWS_UP + /* Don't check to enforce a limit on the __stacksize */ + attr->__stackaddr = (void *) from; +#else + attr->__stackaddr = (void *) to; + + /* The limit might be too high. */ + if ((size_t) attr->__stacksize + > (size_t) attr->__stackaddr - last_to) + attr->__stacksize = (size_t) attr->__stackaddr - last_to; +#endif + + /* We succeed and no need to look further. */ + ret = 0; + break; + } + last_to = to; + } + + fclose (fp); + free (line); + } + } + + return 0; + +} diff --git a/libpthread/linuxthreads/barrier.c b/libpthread/linuxthreads/barrier.c new file mode 100644 index 000000000..2e2521b19 --- /dev/null +++ b/libpthread/linuxthreads/barrier.c @@ -0,0 +1,127 @@ +/* POSIX barrier implementation for LinuxThreads. + Copyright (C) 2000, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Kaz Kylheku , 2000. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, see . */ + +#include +#include "pthread.h" +#include "internals.h" +#include "spinlock.h" +#include "queue.h" +#include "restart.h" + +int +pthread_barrier_wait(pthread_barrier_t *barrier) +{ + pthread_descr self = thread_self(); + pthread_descr temp_wake_queue, th; + int result = 0; + + __pthread_lock(&barrier->__ba_lock, self); + + /* If the required number of threads have achieved rendezvous... */ + if (barrier->__ba_present >= barrier->__ba_required - 1) + { + /* ... then this last caller shall be the serial thread */ + result = PTHREAD_BARRIER_SERIAL_THREAD; + /* Copy and clear wait queue and reset barrier. */ + temp_wake_queue = barrier->__ba_waiting; + barrier->__ba_waiting = NULL; + barrier->__ba_present = 0; + } + else + { + result = 0; + barrier->__ba_present++; + enqueue(&barrier->__ba_waiting, self); + } + + __pthread_unlock(&barrier->__ba_lock); + + if (result == 0) + { + /* Non-serial threads have to suspend */ + suspend(self); + /* We don't bother dealing with cancellation because the POSIX + spec for barriers doesn't mention that pthread_barrier_wait + is a cancellation point. */ + } + else + { + /* Serial thread wakes up all others. */ + while ((th = dequeue(&temp_wake_queue)) != NULL) + restart(th); + } + + return result; +} + +int +pthread_barrier_init(pthread_barrier_t *barrier, + const pthread_barrierattr_t *attr, + unsigned int count) +{ + if (count == 0) + return EINVAL; + + __pthread_init_lock(&barrier->__ba_lock); + barrier->__ba_required = count; + barrier->__ba_present = 0; + barrier->__ba_waiting = NULL; + return 0; +} + +int +pthread_barrier_destroy(pthread_barrier_t *barrier) +{ + if (barrier->__ba_waiting != NULL) return EBUSY; + return 0; +} + +int +pthread_barrierattr_init(pthread_barrierattr_t *attr) +{ + attr->__pshared = PTHREAD_PROCESS_PRIVATE; + return 0; +} + +int +pthread_barrierattr_destroy(pthread_barrierattr_t *attr) +{ + return 0; +} + +int +__pthread_barrierattr_getpshared(const pthread_barrierattr_t *attr, + int *pshared) +{ + *pshared = PTHREAD_PROCESS_PRIVATE; + return 0; +} + +int +pthread_barrierattr_setpshared(pthread_barrierattr_t *attr, int pshared) +{ + if (pshared != PTHREAD_PROCESS_PRIVATE && pshared != PTHREAD_PROCESS_SHARED) + return EINVAL; + + /* For now it is not possible to shared a conditional variable. */ + if (pshared != PTHREAD_PROCESS_PRIVATE) + return ENOSYS; + + return 0; +} diff --git a/libpthread/linuxthreads/cancel.c b/libpthread/linuxthreads/cancel.c index 392d1d586..21b8d900c 100644 --- a/libpthread/linuxthreads/cancel.c +++ b/libpthread/linuxthreads/cancel.c @@ -19,13 +19,6 @@ #include "internals.h" #include "spinlock.h" #include "restart.h" -#ifdef __UCLIBC_HAS_RPC__ -#include -extern void __rpc_thread_destroy(void); -#endif -#include - -#include #ifdef _STACK_GROWS_DOWN # define FRAME_LEFT(frame, other) ((char *) frame >= (char *) other) @@ -35,10 +28,8 @@ extern void __rpc_thread_destroy(void); # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP" #endif -libpthread_hidden_proto(pthread_setcancelstate) -libpthread_hidden_proto(pthread_setcanceltype) -int pthread_setcancelstate(int state, int * oldstate) +int __pthread_setcancelstate(int state, int * oldstate) { pthread_descr self = thread_self(); if (state < PTHREAD_CANCEL_ENABLE || state > PTHREAD_CANCEL_DISABLE) @@ -51,9 +42,9 @@ int pthread_setcancelstate(int state, int * oldstate) __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME); return 0; } -libpthread_hidden_def(pthread_setcancelstate) +strong_alias (__pthread_setcancelstate, pthread_setcancelstate) -int pthread_setcanceltype(int type, int * oldtype) +int __pthread_setcanceltype(int type, int * oldtype) { pthread_descr self = thread_self(); if (type < PTHREAD_CANCEL_DEFERRED || type > PTHREAD_CANCEL_ASYNCHRONOUS) @@ -66,7 +57,33 @@ int pthread_setcanceltype(int type, int * oldtype) __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME); return 0; } -libpthread_hidden_def(pthread_setcanceltype) +strong_alias (__pthread_setcanceltype, pthread_setcanceltype) + + +/* The next two functions are similar to pthread_setcanceltype() but + more specialized for the use in the cancelable functions like write(). + They do not need to check parameters etc. */ +int +attribute_hidden +__pthread_enable_asynccancel (void) +{ + pthread_descr self = thread_self(); + int oldtype = THREAD_GETMEM(self, p_canceltype); + THREAD_SETMEM(self, p_canceltype, PTHREAD_CANCEL_ASYNCHRONOUS); + if (__builtin_expect (THREAD_GETMEM(self, p_canceled), 0) && + THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) + __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME); + return oldtype; +} + +void +internal_function attribute_hidden +__pthread_disable_asynccancel (int oldtype) +{ + pthread_descr self = thread_self(); + THREAD_SETMEM(self, p_canceltype, oldtype); +} + int pthread_cancel(pthread_t thread) { @@ -167,7 +184,6 @@ void _pthread_cleanup_push_defer(struct _pthread_cleanup_buffer * buffer, THREAD_SETMEM(self, p_canceltype, PTHREAD_CANCEL_DEFERRED); THREAD_SETMEM(self, p_cleanup, buffer); } -strong_alias(_pthread_cleanup_push_defer,__pthread_cleanup_push_defer) void _pthread_cleanup_pop_restore(struct _pthread_cleanup_buffer * buffer, int execute) @@ -181,26 +197,36 @@ void _pthread_cleanup_pop_restore(struct _pthread_cleanup_buffer * buffer, THREAD_GETMEM(self, p_canceltype) == PTHREAD_CANCEL_ASYNCHRONOUS) __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME); } -strong_alias(_pthread_cleanup_pop_restore,__pthread_cleanup_pop_restore) - +extern void __rpc_thread_destroy(void); void __pthread_perform_cleanup(char *currentframe) { pthread_descr self = thread_self(); - struct _pthread_cleanup_buffer * c; - - for (c = THREAD_GETMEM(self, p_cleanup); c != NULL; c = c->__prev) + struct _pthread_cleanup_buffer *c = THREAD_GETMEM(self, p_cleanup); + struct _pthread_cleanup_buffer *last; + + if (c != NULL) + while (FRAME_LEFT (currentframe, c)) + { + last = c; + c = c->__prev; + + if (c == NULL || FRAME_LEFT (last, c)) + { + c = NULL; + break; + } + } + + while (c != NULL) { -#ifdef _STACK_GROWS_DOWN - if ((char *) c <= currentframe) - break; -#elif defined _STACK_GROWS_UP - if ((char *) c >= currentframe) - break; -#else -# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP" -#endif c->__routine(c->__arg); + + last = c; + c = c->__prev; + + if (FRAME_LEFT (last, c)) + break; } #ifdef __UCLIBC_HAS_RPC__ @@ -209,11 +235,3 @@ void __pthread_perform_cleanup(char *currentframe) __rpc_thread_destroy (); #endif } - -#ifndef __PIC__ -/* We need a hook to force the cancellation wrappers to be linked in when - static libpthread is used. */ -extern const char __pthread_provide_wrappers; -static const char *const __pthread_require_wrappers = - &__pthread_provide_wrappers; -#endif diff --git a/libpthread/linuxthreads/condvar.c b/libpthread/linuxthreads/condvar.c index 35daacf15..d7b2e9886 100644 --- a/libpthread/linuxthreads/condvar.c +++ b/libpthread/linuxthreads/condvar.c @@ -25,28 +25,28 @@ #include "queue.h" #include "restart.h" -int pthread_cond_init(pthread_cond_t *cond, - const pthread_condattr_t *cond_attr attribute_unused) +int __pthread_cond_init(pthread_cond_t *cond, + const pthread_condattr_t *cond_attr) { __pthread_init_lock(&cond->__c_lock); cond->__c_waiting = NULL; return 0; } -libpthread_hidden_def(pthread_cond_init) +strong_alias (__pthread_cond_init, pthread_cond_init) -int pthread_cond_destroy(pthread_cond_t *cond) +int __pthread_cond_destroy(pthread_cond_t *cond) { if (cond->__c_waiting != NULL) return EBUSY; return 0; } -libpthread_hidden_def(pthread_cond_destroy) +strong_alias (__pthread_cond_destroy, pthread_cond_destroy) /* Function called by pthread_cancel to remove the thread from waiting on a condition variable queue. */ static int cond_extricate_func(void *obj, pthread_descr th) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); pthread_cond_t *cond = obj; int did_remove = 0; @@ -57,9 +57,9 @@ static int cond_extricate_func(void *obj, pthread_descr th) return did_remove; } -int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +int __pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); pthread_extricate_if extr; int already_canceled = 0; int spurious_wakeup_count; @@ -98,7 +98,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME); } - __pthread_mutex_unlock(mutex); + pthread_mutex_unlock(mutex); spurious_wakeup_count = 0; while (1) @@ -123,7 +123,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) if (THREAD_GETMEM(self, p_woken_by_cancel) && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) { THREAD_SETMEM(self, p_woken_by_cancel, 0); - __pthread_mutex_lock(mutex); + pthread_mutex_lock(mutex); __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME); } @@ -131,17 +131,17 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) while (spurious_wakeup_count--) restart(self); - __pthread_mutex_lock(mutex); + pthread_mutex_lock(mutex); return 0; } -libpthread_hidden_def(pthread_cond_wait) +strong_alias (__pthread_cond_wait, pthread_cond_wait) static int pthread_cond_timedwait_relative(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec * abstime) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); int already_canceled = 0; pthread_extricate_if extr; int spurious_wakeup_count; @@ -174,7 +174,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond, __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME); } - __pthread_mutex_unlock(mutex); + pthread_mutex_unlock(mutex); spurious_wakeup_count = 0; while (1) @@ -191,7 +191,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond, if (was_on_queue) { __pthread_set_own_extricate_if(self, 0); - __pthread_mutex_lock(mutex); + pthread_mutex_lock(mutex); return ETIMEDOUT; } @@ -218,7 +218,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond, if (THREAD_GETMEM(self, p_woken_by_cancel) && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) { THREAD_SETMEM(self, p_woken_by_cancel, 0); - __pthread_mutex_lock(mutex); + pthread_mutex_lock(mutex); __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME); } @@ -226,19 +226,19 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond, while (spurious_wakeup_count--) restart(self); - __pthread_mutex_lock(mutex); + pthread_mutex_lock(mutex); return 0; } -int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec * abstime) +int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec * abstime) { /* Indirect call through pointer! */ return pthread_cond_timedwait_relative(cond, mutex, abstime); } -libpthread_hidden_def(pthread_cond_timedwait) +strong_alias (__pthread_cond_timedwait, pthread_cond_timedwait) -int pthread_cond_signal(pthread_cond_t *cond) +int __pthread_cond_signal(pthread_cond_t *cond) { pthread_descr th; @@ -252,9 +252,9 @@ int pthread_cond_signal(pthread_cond_t *cond) } return 0; } -libpthread_hidden_def(pthread_cond_signal) +strong_alias (__pthread_cond_signal, pthread_cond_signal) -int pthread_cond_broadcast(pthread_cond_t *cond) +int __pthread_cond_broadcast(pthread_cond_t *cond) { pthread_descr tosignal, th; @@ -271,27 +271,27 @@ int pthread_cond_broadcast(pthread_cond_t *cond) } return 0; } -libpthread_hidden_def(pthread_cond_broadcast) +strong_alias (__pthread_cond_broadcast, pthread_cond_broadcast) -int pthread_condattr_init(pthread_condattr_t *attr attribute_unused) +int __pthread_condattr_init(pthread_condattr_t *attr) { return 0; } -libpthread_hidden_def(pthread_condattr_init) +strong_alias (__pthread_condattr_init, pthread_condattr_init) -int pthread_condattr_destroy(pthread_condattr_t *attr attribute_unused) +int __pthread_condattr_destroy(pthread_condattr_t *attr) { return 0; } -libpthread_hidden_def(pthread_condattr_destroy) +strong_alias (__pthread_condattr_destroy, pthread_condattr_destroy) -int pthread_condattr_getpshared (const pthread_condattr_t *attr attribute_unused, int *pshared) +int pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared) { *pshared = PTHREAD_PROCESS_PRIVATE; return 0; } -int pthread_condattr_setpshared (pthread_condattr_t *attr attribute_unused, int pshared) +int pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared) { if (pshared != PTHREAD_PROCESS_PRIVATE && pshared != PTHREAD_PROCESS_SHARED) return EINVAL; diff --git a/libpthread/linuxthreads/debug.h b/libpthread/linuxthreads/debug.h deleted file mode 100644 index 76779dad9..000000000 --- a/libpthread/linuxthreads/debug.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** NAME: -** debug.h -** -** DESCRIPTION: -** This header file defines the debug macros used in pthreads. To turn -** debugging on, add -DDEBUG_PT to CFLAGS. It was added to the original -** distribution of linuxthreads. -** -** This program is free software; you can redistribute it and/or -** modify it under the terms of the GNU Library General Public License -** as published by the Free Software Foundation; either version 2 -** of the License, or (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU Library General Public License for more details. -** -****************************************************************************/ - -#ifndef _PT_DEBUG_H -#define _PT_DEBUG_H - -#include - -#ifdef __DODEBUG_PT__ -# define DEBUG_PT -#endif - -/* define the PDEBUG macro here */ -#undef PDEBUG -#ifdef DEBUG_PT -# define PDEBUG(fmt, args...) __pthread_message("%s: " fmt, __FUNCTION__, ## args) -#else -# define PDEBUG(fmt, args...) /* debug switched off */ -#endif - -#endif /* _PT_DEBUG_H */ diff --git a/libpthread/linuxthreads/descr.h b/libpthread/linuxthreads/descr.h new file mode 100644 index 000000000..1c816b225 --- /dev/null +++ b/libpthread/linuxthreads/descr.h @@ -0,0 +1,268 @@ +/* Linuxthreads - a simple clone()-based implementation of Posix */ +/* threads for Linux. */ +/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU Library General Public License */ +/* as publ