about summary refs log tree commit diff
path: root/nptl
Commit message (Collapse)AuthorAgeFilesLines
* pthread: Move back linking rules to nptl and htlSamuel Thibault2020-06-081-0/+18
| | | | | | | | | | | | | d6d74ec16 ('htl: Enable more tests') moved the linking rules from nptl/Makefile and htl/Makefile to the shared sysdeps/pthread/Makefile. But e.g. on powerpc some tests are added in sysdeps/powerpc/Makefile, which is included *after* sysdeps/pthread/Makefile, and thus the tests don't get affected by the rules and fail to link. For now let's just copy over the set of rules in both nptl/Makefile and htl/Makefile. * sysdeps/pthread/Makefile: Move libpthread linking rules to... * htl/Makefile: ... here and... * nptl/Makefile: ... there.
* htl: Enable more testsSamuel Thibault2020-06-0711-735/+4
| | | | | | | | | | * nptl/tst-_res1.c, tst-_res1mod1.c, tst-_res1mod2.c, tst-atfork2.c, tst-atfork2mod.c, tst-fini1.c, tst-fini1mod.c, tst-tls4.c, tst-tls4moda.c, tst-tls4modb.c: Move to... * sysdeps/pthread: ... here. Rename tst-tls4.c to tst-pt-tls4.c to avoid conflicting with elf/tst-tls4.c. * nptl/Makefile: Move corresponding references and rules to... * sysdeps/pthread/Makefile: ... here.
* htl: Enable but XFAIL tst-flock2, tst-signal1, tst-signal2Samuel Thibault2020-06-074-646/+1
| | | | | | | | | | | They need setpshared support. * nptl/tst-flock2.c, tst-signal1.c, tst-signal2.c: Move to... * sysdeps/pthread: ... here. * nptl/Makefile: Move corresponding tests references to... * sysdeps/pthread/Makefile: ... here. * sysdeps/mach/hurd/i386/Makefile (test-xfail-tst-flock2, test-xfail-tst-signal1, test-xfail-tst-signal2): Add.
* htl: Enable more testsSamuel Thibault2020-06-0798-7328/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * htl/Makefile: Remove rules adding libpthread.so and libpthread.a to link lines. * nptl/Makefile: Move rules adding libpthread.so and libpthread.a to link lines to... * sysdeps/pthread/Makefile: ... here. * nptl/eintr.c, tst-align.c tst-align3.c tst-atfork1.c tst-backtrace1.c tst-bad-schedattr.c tst-cancel-self-canceltype.c tst-cancel-self-cleanup.c tst-cancel-self-testcancel.c tst-cancel1.c tst-cancel10.c tst-cancel12.c tst-cancel14.c tst-cancel15.c tst-cancel18.c tst-cancel19.c tst-cancel2.c tst-cancel22.c tst-cancel23.c tst-cancel26.c tst-cancel27.c tst-cancel28.c tst-cancel3.c tst-cancel8.c tst-cancelx1.c tst-cancelx10.c tst-cancelx12.c tst-cancelx14.c tst-cancelx15.c tst-cancelx18.c tst-cancelx2.c tst-cancelx3.c tst-cancelx8.c tst-cleanup0.c tst-cleanup0.expect tst-cleanup1.c tst-cleanup2.c tst-cleanup3.c tst-cleanupx0.c tst-cleanupx0.expect tst-cleanupx1.c tst-cleanupx2.c tst-cleanupx3.c tst-clock1.c tst-create-detached.c tst-detach1.c tst-eintr2.c tst-eintr3.c tst-eintr4.c tst-eintr5.c tst-exec1.c tst-exec2.c tst-exec3.c tst-exit1.c tst-exit2.c tst-exit3.c tst-flock1.c tst-fork1.c tst-fork2.c tst-fork3.c tst-fork4.c tst-getpid3.c tst-kill1.c tst-kill2.c tst-kill3.c tst-kill4.c tst-kill5.c tst-kill6.c tst-locale1.c tst-locale2.c tst-memstream.c tst-popen1.c tst-raise1.c tst-sem5.c tst-setuid3.c tst-signal4.c tst-signal5.c tst-signal6.c tst-signal8.c tst-stack1.c tst-stdio1.c tst-stdio2.c tst-sysconf.c tst-tls1.c tst-tls2.c tst-tsd1.c tst-tsd2.c tst-tsd5.c tst-tsd6.c tst-umask1.c tst-unload.c tst-unwind-thread.c tst-vfork1.c tst-vfork1x.c tst-vfork2.c tst-vfork2x.c: Move tests to... * sysdeps/pthread: ... here. Rename tst-popen1.c -> tst-pt-popen1.c tst-align.c -> tst-pt-align.c tst-align3.c -> tst-pt-align3.c tst-sysconf.c -> tst-pt-sysconf.c tst-tls1.c -> tst-pt-tls1.c tst-tls2.c -> tst-pt-tls2.c tst-vfork1.c -> tst-pt-vfork1.c tst-vfork2.c -> tst-pt-vfork2.c to avoid conflicting with libio/tst-popen1.c, elf/tst-align.c, posix/tst-sysconf.c, elf/tst-tls1.c, elf/tst-tls2.c, posix/tst-vfork1.c, posix/tst-vfork2.c. * nptl/Makefile: Move corresponding tests references and special rules to... * sysdeps/pthread/Makefile: ... here. * sysdeps/pthread/tst-stack1.c (do_test): Do not clamp stack size to PTHREAD_STACK_MIN if not defined. Tested on linux-x86_64 and hurd-i386
* htl: Add sem_clockwait supportSamuel Thibault2020-06-072-64/+1
| | | | | | | | | | | | | * sysdeps/htl/sem-timedwait.c (__sem_timedwait_internal): Add clock_id parameter instead of hardcoding CLOCK_REALTIME. (__sem_clockwait): New function. (sem_clockwait): New weak alias. * sysdeps/htl/sem-wait.c (__sem_timedwait_internal): Update declaration. (__sem_wait): Update call to __sem_timedwait_internal. * htl/Versions (GLIBC_2.32): Add sem_clockwait. * sysdeps/mach/hurd/i386/libpthread.abilist (sem_clockwait): Add symbol. * nptl/Makefile (tests): Move tst-sem5 to... * sysdeps/pthread/Makefile (tests): ... here.
* nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_npFlorian Weimer2020-06-029-8/+360
| | | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Make pthread_attr_t dynamically extensibleFlorian Weimer2020-06-028-27/+79
| | | | | | | This introduces the function __pthread_attr_extension to allocate the extension space, which is freed by pthread_attr_destroy. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Destroy the default thread attribute as part of freeresFlorian Weimer2020-06-023-0/+13
| | | | | | This avoids a spurious memory leak report by valgrind. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Change type of __default_pthread_attrFlorian Weimer2020-06-028-15/+14
| | | | | | | | | | | | union pthread_attr_transparent has always the correct size, even if pthread_attr_t has padding that is not present in struct pthread_attr. This should not result in an observable behavioral change. The existing code appears to have been correct, but it was brittle because it was not clear which functions were allowed to write to an entire pthread_attr_t argument (e.g., by copying it). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Use __pthread_attr_setaffinity_np in pthread_getattr_npFlorian Weimer2020-06-021-16/+14
| | | | | | | This avoids duplicating the code for the affinity mask allocation handling. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Use __pthread_getattr_default_np in pthread_createFlorian Weimer2020-06-021-25/+7
| | | | | | This removes another instance of custom attribute copying code. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Add internal alias __pthread_getattr_default_npFlorian Weimer2020-06-023-1/+6
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* htl: Make pthread_cond_destroy wait for threads to be wokenSamuel Thibault2020-06-013-176/+1
| | | | | | | | | | | | | | | | | | This allows to reuse the storage after calling pthread_cond_destroy. * sysdeps/htl/bits/types/struct___pthread_cond.h (__pthread_cond): Replace unused struct __pthread_condimpl *__impl field with unsigned int __wrefs. (__PTHREAD_COND_INITIALIZER): Update accordingly. * sysdeps/htl/pt-cond-timedwait.c (__pthread_cond_timedwait_internal): Register as waiter in __wrefs field. On unregistering, wake any pending pthread_cond_destroy. * sysdeps/htl/pt-cond-destroy.c (__pthread_cond_destroy): Register wake request in __wrefs. * nptl/Makefile (tests): Move tst-cond20 tst-cond21 to... * sysdeps/pthread/Makefile (tests): ... here. * nptl/tst-cond20.c nptl/tst-cond21.c: Move to... * sysdeps/pthread/tst-cond20.c sysdeps/pthread/tst-cond21.c: ... here.
* htl: Enable more cond testsSamuel Thibault2020-06-011-1/+1
| | | | | * nptl/Makefile (tests): Move tst-cond11 and tst-cond27 to... * sysdeps/pthread/Makefile (tests): ... here.
* htl: Add clock variantsSamuel Thibault2020-05-2621-1421/+441
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * htl/pt-join.c (__pthread_join): Move implementation to... (__pthread_join_common): ... new function. Add try, timed and clock support. (__pthread_join): Reimplement on top of __pthread_join_common. (__pthread_tryjoin_np, __pthread_timedjoin_np, __pthread_clockjoin_np): Implement on top of __pthread_join_common. (pthread_tryjoin_np, pthread_timedjoin_np, pthread_clockjoin_np): New aliases. * hurd/hurdlock.c (__lll_abstimed_wait, __lll_abstimed_xwait, __lll_abstimed_lock): Check for supported clock. * sysdeps/htl/pt-cond-timedwait.c (__pthread_cond_timedwait_internal): Add clockid parameter and support it. (__pthread_cond_timedwait): Pass -1 as clockid. (__pthread_cond_clockwait): New function. (pthread_cond_clockwait): New alias. * sysdeps/htl/pt-cond-wait.c (__pthread_cond_timedwait_internal): Update prototype. (__pthread_cond_wait): Pass -1 as clockid. * sysdeps/htl/pt-rwlock-timedrdlock.c (__pthread_rwlock_timedrdlock_internal): Add clockid parameter, and support id. (__pthread_rwlock_clockrdlock): New function. (pthread_rwlock_clockrdlock): New alias. * sysdeps/htl/pt-rwlock-rdlock.c (__pthread_rwlock_timedrdlock_internal): Update prototype. (__pthread_rwlock_rdlock): Pass -1 as clockid. * sysdeps/htl/pt-rwlock-timedwrlock.c (__pthread_rwlock_timedwrlock_internal): Add clockid parameter, and support id. (__pthread_rwlock_clockwrlock): New function. (pthread_rwlock_clockwrlock): New alias. * sysdeps/htl/pt-rwlock-wrlock.c (__pthread_rwlock_timedwrlock_internal): Update prototype. (__pthread_rwlock_wrlock): Pass -1 as clockid. * sysdeps/mach/hurd/htl/pt-mutex-timedlock.c (__pthread_mutex_timedlock): Move implementation to (__pthread_mutex_clocklock): New function with additional clockid parameter and support it. (pthread_mutex_clocklock): New alias. (__pthread_mutex_timedlock): Reimplement on top of __pthread_mutex_clocklock. * sysdeps/htl/pthread.h (pthread_tryjoin_np, pthread_timedjoin_np, pthread_clockjoin_np, pthread_mutex_clocklock, pthread_cond_clockwait, pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock): New prototypes. * sysdeps/htl/pthreadP.h (__pthread_cond_clockwait): New prototype. * htl/Versions (GLIBC_2.32): Add pthread_cond_clockwait, pthread_mutex_clocklock, pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock, pthread_tryjoin_np, pthread_timedjoin_np, pthread_clockjoin_np. * sysdeps/mach/hurd/i386/libpthread.abilist (pthread_clockjoin_np, pthread_cond_clockwait, pthread_mutex_clocklock, pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock, pthread_timedjoin_np, pthread_tryjoin_np): New functions. * nptl/tst-abstime.c, nptl/tst-join10.c, nptl/tst-join11.c, nptl/tst-join12.c, nptl/tst-join13.c, nptl/tst-join14.c, nptl/tst-join2.c, nptl/tst-join3.c, nptl/tst-join8.c, nptl/tst-join9.c, nptl/tst-mutex-errorcheck.c, nptl/tst-pthread-mutexattr.c, nptl/tst-mutex11.c, nptl/tst-mutex5.c, nptl/tst-mutex7.c, nptl/tst-mutex7robus.c, nptl/tst-mutex9.c, nptl/tst-rwlock12.c, nptl/tst-rwlock14.c: Move to sysdeps/pthread. * sysdeps/pthread/tst-mutex8.c: Move back to nptl. * nptl/Makefile (tests): Move tst-mutex5, tst-mutex7, tst-mutex7robust, tst-mutex9, tst-mutex11, tst-rwlock12, tst-rwlock14, tst-join2, tst-join3, tst-join8, tst-join9 tst-join10, tst-join11, tst-join12, tst-join13, tst-join14, tst-abstime, tst-mutex-errorcheck, tst-pthread-mutexattr to ... * sysdeps/pthread/Makefile (tests): ... here.
* signal: Deprecate additional legacy signal handling functionsFlorian Weimer2020-05-257-26/+23
| | | | | | | | | | This needs a few test adjustments: In some cases, sigignore was used for convenience (replaced with xsignal with SIG_IGN). Tests for the deprecated functions need to disable -Wdeprecated-declarations, and for the sigmask deprecation, -Wno-error. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Use __pthread_attr_copy in pthread_setattr_default_npFlorian Weimer2020-05-201-38/+15
| | | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Use __pthread_attr_copy in pthread_getattr_default_np (bug 25999)Florian Weimer2020-05-203-9/+82
| | | | | | | pthread_getattr_default_np needs to make a deep copy. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Add __pthread_attr_copy for copying pthread_attr_t objectsFlorian Weimer2020-05-204-0/+65
| | | | | | | | Also add the private type union pthread_attr_transparent, to reduce the amount of casting that is required. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Make __pthread_attr_init, __pthread_attr_destroy available internallyFlorian Weimer2020-05-204-4/+9
| | | | | | | | pthread_attr_destroy needs to be a weak alias to avoid future linknamespace failures. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_gettattr_np into libcFlorian Weimer2020-05-204-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Use __getline instead of __getdelim to avoid a localplt failure. Likewise for __getrlimit/getrlimit. The abilist updates were performed by: git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \ | while read x ; do echo "GLIBC_2.32 pthread_getattr_np F" >> $x done python3 scripts/move-symbol-to-libc.py --only-linux pthread_getattr_np The private export of __pthread_getaffinity_np is no longer needed, but the hidden alias still necessary so that the symbol can be exported with versioned_symbol. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_getaffinity_np into libcFlorian Weimer2020-05-204-10/+20
| | | | | | | | | | | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> The abilist updates were performed by: git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \ | while read x ; do echo "GLIBC_2.32 pthread_getaffinity_np F" >> $x done python3 scripts/move-symbol-to-libc.py pthread_getaffinity_np Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_attr_setaffinity_np into libcFlorian Weimer2020-05-204-10/+29
| | | | | | | | | | | | | | | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> The symbol did not previously exist in libc, so a new GLIBC_2.32 symbol is needed, to get correct dependency for binaries which use the symbol but no longer link against libpthread. The abilist updates were performed by: git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \ | while read x ; do echo "GLIBC_2.32 pthread_attr_setaffinity_np F" >> $x done python3 scripts/move-symbol-to-libc.py pthread_attr_setaffinity_np Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Replace some stubs with the Linux implementationFlorian Weimer2020-05-209-30/+626
| | | | | | | | | | | | | The stubs for pthread_getaffinity_np, pthread_getname_np, pthread_setaffinity_np, pthread_setname_np are replaced, and corresponding tests are moved. After the removal of the NaCl port, nptl is Linux-specific, and the stubs are no longer needed. This effectively reverts commit c76d1ff5149bd03210f2bb8cd64446c51618d016 ("NPTL: Add stubs for Linux-only extension functions."). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: wait for pending setxid request also in detached thread (bug 25942)Andreas Schwab2020-05-121-5/+6
| | | | | | | | | | | | | There is a race between __nptl_setxid and exiting detached thread, which causes a deadlock on stack_cache_lock. The deadlock happens in this state: T1: setgroups -> __nptl_setxid (holding stack_cache_lock, waiting on cmdp->cntr == 0) T2 (detached, exiting): start_thread -> __deallocate_stack (waiting on stack_cache_lock) more threads waiting on stack_cache_lock in pthread_create For non-detached threads, start_thread waits for its own setxid handler to finish before exiting. Do this for detached threads as well.
* nptl/tst-setuid1-static: Improve isolation from system objectsFlorian Weimer2020-04-271-0/+5
| | | | | Static dlopen needs an LD_LIBRARY_PATH setting to avoid loading system libraries.
* nptl: Start new threads with all signals blocked [BZ #25098]Florian Weimer2020-04-272-24/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | New threads inherit the signal mask from the current thread. This means that signal handlers can run on the newly created thread immediately after the kernel has created the userspace thread, even before glibc has initialized the TCB. Consequently, new threads can observe uninitialized ctype data, among other things. To address this, block all signals before starting the thread, and pass the original signal mask to the start routine wrapper. On the new thread, first perform all thread initialization, and then unblock signals. The cost of doing this is two rt_sigprocmask system calls on the old thread, and one rt_sigprocmask system call on the new thread. (If there was a way to clone a new thread with a signals disabled, this could be brought down to one system call each.) The thread descriptor increases in size, too, and sigset_t is fairly large. This increase could be brought down by reusing space the in the descriptor which is not needed before running user code, or by switching to an internal sigset_t definition which only covers the signals supported by the kernel definition. (Part of the thread descriptor size increase is already offset by reduced stack usage in the thread start wrapper routine after this commit.) Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* signal: Only handle on NSIG signals on signal functions (BZ #25657)Adhemerval Zanella2020-04-213-5/+66
| | | | | | | | | | | | | | | The upper bits of the sigset_t s not fully initialized in the signal mask calls that return information from kernel (sigprocmask, sigpending, and pthread_sigmask), since the exported sigset_t size (1024 bits) is larger than Linux support one (64 or 128 bits). It might make sigisemptyset/sigorset/sigandset fail if the mask is filled prior the call. This patch changes the internal signal function to handle up to supported Linux signal number (_NSIG), the remaining bits are untouched. Checked on x86_64-linux-gnu and i686-linux-gnu.
* linux: Use pthread_sigmask on sigprocmaskAdhemerval Zanella2020-04-212-0/+3
| | | | | | | With pthread_sigmask on libc.so, it allows implement sigprocmask on top of pthread_sigmask. Checked on x86_64-linux-gnu.
* nptl: Move pthread_sigmask implementation to libcAdhemerval Zanella2020-04-213-4/+14
| | | | | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> A new symbol version is added on libc to force loading failure instead of lazy binding one for newly binaries with old loaders. Checked with a build against all affected ABIs.
* Linux: set_robust_list syscall number is always availableFlorian Weimer2020-03-032-8/+2
| | | | | | | Due to the built-in tables, __NR_set_robust_list is always defined (although it may not be available at run time). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_setschedparam implementation into libcFlorian Weimer2020-02-204-9/+1
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_getschedparam implementation into libcFlorian Weimer2020-02-204-6/+3
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_cond_init implementation into libcFlorian Weimer2020-02-207-20/+8
| | | | | | | | | | | It is necessary to export __pthread_cond_init from libc because the C11 condition variable needs it and is still left in libpthread. This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_cond_destroy implementation into libcFlorian Weimer2020-02-207-19/+13
| | | | | | | | | | | It is necessary to export __pthread_cond_destroy from libc because the C11 condition variable needs it and is still left in libpthread. This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_condattr_init implementation into libcFlorian Weimer2020-02-204-6/+1
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_condattr_destroy implementation into libcFlorian Weimer2020-02-204-4/+3
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_setscope implementation into libcFlorian Weimer2020-02-204-8/+1
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getscope implementation into libcFlorian Weimer2020-02-204-5/+3
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_setschedpolicy implementation into libcFlorian Weimer2020-02-204-6/+1
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getschedpolicy implementation into libcFlorian Weimer2020-02-204-5/+3
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Sort routines list in Makefile alphabeticallyFlorian Weimer2020-02-201-7/+21
| | | | | | | This will make it easier to review changes which move implementations from libpthread to libc. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Use .NOTPARALLEL in Makefile only if actually running testsFlorian Weimer2020-02-201-1/+3
| | | | | | It is safe to build the tests in parallel. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Block all signals on timer_create thread (BZ#10815)Adhemerval Zanella2020-02-192-1/+83
| | | | | | | | | | | | | | | | | | | | The behavior of the signal mask on threads created by timer_create for SIGEV_THREAD timers are implementation-defined and glibc explicit unblocks all signals before calling the user-defined function. This behavior, although not incorrect standard-wise, opens a race if a program using a blocked rt-signal plus sigwaitinfo (and without an installed signal handler for the rt-signal) receives a signal while executing the used-defined function for SIGEV_THREAD. A better alternative discussed in bug report is to rather block all signals (besides the internal ones not available to application usage). This patch fixes this issue by only unblocking SIGSETXID (used on set*uid function) and SIGCANCEL (used for thread cancellation). Checked on x86_64-linux-gnu and i686-linux-gnu.
* Introduce <elf-initfini.h> and ELF_INITFINI for all architecturesFlorian Weimer2020-02-181-3/+10
| | | | | | | | | | | | | | | | This supersedes the init_array sysdeps directory. It allows us to check for ELF_INITFINI in both C and assembler code, and skip DT_INIT and DT_FINI processing completely on newer architectures. A new header file is needed because <dl-machine.h> is incompatible with assembler code. <sysdep.h> is compatible with assembler code, but it cannot be included in all assembler files because on some architectures, it redefines register names, and some assembler files conflict with that. <elf-initfini.h> is replicated for legacy architectures which need DT_INIT/DT_FINI support. New architectures follow the generic default and disable it.
* pthread: Fix building tst-robust8 with nptlSamuel Thibault2020-02-161-2/+2
| | | | NPTL's pthreadP.h needs internal definitions
* pthread: Move robust mutex tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-1612-1059/+3
| | | | | tst-robust8.c prints some mutex internals for nptl debugging, this needed to be made conditioned by getting built with nptl.
* linux: Remove INTERNAL_SYSCALL_DECLAdhemerval Zanella2020-02-147-50/+32
| | | | | | | | | | | With all Linux ABIs using the expected Linux kABI to indicate syscalls errors, the INTERNAL_SYSCALL_DECL is an empty declaration on all ports. This patch removes the 'err' argument on INTERNAL_SYSCALL* macro and remove the INTERNAL_SYSCALL_DECL usage. Checked with a build against all affected ABIs.
* nptl: Remove ununsed pthread-errnos.h ruleAdhemerval Zanella2020-02-142-15/+1
|
* pthread: Move some join tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-1013-521/+8
| | | | So they can be checked with htl too.