about summary refs log tree commit diff
path: root/nptl
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* pthread: Move most barrier tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-105-530/+0
| | | | So they can be checked with htl too.
* pthread: Move most sem tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-1013-1197/+1
| | | | So they can be checked with htl too.
* pthread: Move key tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-105-497/+0
| | | | So they can be checked with htl too.
* pthread: Move some rwlock tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-098-1109/+4
| | | | So they can be checked with htl too.
* pthread: Move most once tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-097-524/+2
| | | | So they can be checked with htl too.
* pthread: Move most cond tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-0929-3772/+3
| | | | So they can be checked with htl too.
* pthread: Move some attr tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-092-306/+1
| | | | So they can be checked with htl too.
* pthread: Move most mutex tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-098-1463/+1
| | | | | | So they can be checked with htl too. XFAIL tst-mutex4, for which support is still missing in htl.
* pthread: Move spin tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-095-376/+0
| | | | So they can be checked with htl too.
* pthread: Move basic tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-098-669/+0
| | | | So they can be checked with htl too.
* C11 threads: Move implementation to sysdeps/pthreadSamuel Thibault2020-02-0936-1538/+3
| | | | | | | so it gets shared by nptl and htl. Also add htl versions of thrd_current and thrd_yield. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* C11 threads: make thrd_join more portableSamuel Thibault2020-02-091-1/+1
| | | | | | | by making a __pthread_join call instead of an equivalent __pthread_clockjoin_ex call. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* C11 threads: Fix thrd_t / pthread_t compatibility assertionSamuel Thibault2020-02-091-2/+2
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* C11 threads: do not require PTHREAD_DESTRUCTOR_ITERATIONSSamuel Thibault2020-02-091-0/+2
| | | | | | It is optional in POSIX. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move nptl-specific types to separate headerSamuel Thibault2020-02-091-1/+1
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Run nptl/tst-pthread-getattr in a containerDJ Delorie2020-02-031-2/+4
| | | | | | | | | | | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=1653942 This test depends on the kernel's assignment of memory regions, but running under ld.so explicitly changes those assignments, sometimes sufficiently to cause the test to fail (esp with address space randomization). The easiest way to "fix" the test, is to run it the way the user would - without ld.so. Running it in a container does that. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Update copyright dates not handled by scripts/update-copyrights.Joseph Myers2020-01-011-1/+1
| | | | | | | | | | | | | | | I've updated copyright dates in glibc for 2020. This is the patch for the changes not generated by scripts/update-copyrights and subsequent build / regeneration of generated files. As well as the usual annual updates, mainly dates in --version output (minus libc.texinfo which previously had to be handled manually but is now successfully updated by update-copyrights), there is a fix to sysdeps/unix/sysv/linux/powerpc/bits/termios-c_lflag.h where a typo in the copyright notice meant it failed to be updated automatically. Please remember to include 2020 in the dates for any new files added in future (which means updating any existing uncommitted patches you have that add new files to use the new copyright dates in them).
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-01493-493/+493
|
* nptl: Move waitpid implementation to libcAdhemerval Zanella2019-12-192-3/+2
| | | | Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.
* nptl: Move wait implementation to libcAdhemerval Zanella2019-12-192-3/+2
| | | | Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.
* nptl: Add more missing placeholder abi symbol from nanosleep moveAdhemerval Zanella2019-12-091-8/+18
| | | | | | | | | | | | | | | | | | | | This patch adds the missing __libpthread_version_placeholder for GLIBC_2.2.6 version from the nanosleep implementation move from libpthread to libc (79a547b162). It also fixes the wrong compat symbol definitions added by changing back the version used on vfork check and remove the __libpthread_version_placeholder added on some ABI (4f4bb489e0dd). The __libpthread_version_placeholder is also refactored to make it simpler to add new compat_symbols by adding a new macro compat_symbol_unique which uses the compiler extension __COUNTER__ to generate unique strong alias to be used with compat_symbol. Checked with a updated-abi on the all affected abis of the nanosleep move. Change-Id: I347a4dbdc931bb42b359456932dd1e17aa4d4078
* Expand $(as-needed) and $(no-as-needed) throughout the build systemFlorian Weimer2019-12-031-2/+2
| | | | | | | | | Since commit a3cc4f48e94f32c9532ee36982ac00eb1e5719b0 ("Remove --as-needed configure test."), --as-needed support is no longer optional. The macros are not much shorter and do not provide documentary value, either, so this commit removes them.
* nptl: Add struct_rwlock.hAdhemerval Zanella2019-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new generic __pthread_rwlock_arch_t definition meant to be used by new ports. Its layout mimics the current usage on some 64 bits ports and it allows some ports to use the generic definition. The arch __pthread_rwlock_arch_t definition is moved from pthreadtypes-arch.h to another arch-specific header (struct_rwlock.h). Also the static intialization macro for pthread_rwlock_t is set to use an arch defined on (__PTHREAD_RWLOCK_INITIALIZER) which simplifies its implementation. The default pthread_rwlock_t layout differs from current ports with: 1. Internal layout is the same for 32 bits and 64 bits. 2. Internal flag is an unsigned short so it should not required additional padding to align for word boundary (if it is the case for the ABI). Checked with a build on affected abis. Change-Id: I776a6a986c23199929d28a3dcd30272db21cd1d0
* nptl: Add struct_mutex.hAdhemerval Zanella2019-11-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current way of defining the common mutex definition for POSIX and C11 on pthreadtypes-arch.h (added by commit 06be6368da16104be5) is not really the best options for newer ports. It requires define some misleading flags that should be always defined as 0 (__PTHREAD_COMPAT_PADDING_MID and __PTHREAD_COMPAT_PADDING_END), it exposes options used solely for linuxthreads compat mode (__PTHREAD_MUTEX_USE_UNION and __PTHREAD_MUTEX_NUSERS_AFTER_KIND), and requires newer ports to explicit define them (adding more boilerplate code). This patch adds a new default __pthread_mutex_s definition meant to be used by newer ports. Its layout mimics the current usage on both 32 and 64 bits ports and it allows most ports to use the generic definition. Only ports that use some arch-specific definition (such as hardware lock-elision or linuxthreads compat) requires specific headers. For 32 bit, the generic definitions mimic the other 32-bit ports of using an union to define the fields uses on adaptive and robust mutexes (thus not allowing both usage at same time) and by using a single linked-list for robust mutexes. Both decisions seemed to follow what recent ports have done and make the resulting pthread_mutex_t/mtx_t object smaller. Also the static intialization macro for pthread_mutex_t is set to use a macro __PTHREAD_MUTEX_INITIALIZER where the architecture can redefine in its struct_mutex.h if it requires additional fields to be initialized. Checked with a build on affected abis. Change-Id: I30a22c3e3497805fd6e52994c5925897cffcfe13
* nptl: Add tests for internal pthread_rwlock_t offsetsAdhemerval Zanella2019-11-261-0/+8
| | | | | | | | | | | | | This patch new build tests to check for internal fields offsets for internal pthread_rwlock_t definition. Althoug the '__data.__flags' field layout should be preserved due static initializators, the patch also adds tests for the futexes that may be used in a shared memory (although using different libc version in such scenario is not really supported). Checked with a build against all affected ABIs. Change-Id: Iccc103d557de13d17e4a3f59a0cad2f4a640c148
* nptl: Cleanup mutex internal offset testsAdhemerval Zanella2019-11-262-10/+6
| | | | | | | | | | | | | The offsets of pthread_mutex_t __data.__nusers, __data.__spins, __data.elision, __data.list are not required to be constant over the releases. Only the __data.__kind is used for static initializers. This patch also adds an additional size check for __data.__kind. Checked with a build against affected ABIs. Change-Id: I7a4e48cc91b4c4ada57e9a5d1b151fb702bfaa9f
* nptl: Refactor thrd_sleep in terms of clock_nanosleepAdhemerval Zanella2019-11-061-12/+9
| | | | | | Checked on x86_64-linux-gnu and powerpc64le-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* nptl: Move nanosleep implementation to libcAdhemerval Zanella2019-11-063-6/+4
| | | | | | | | | Checked on x86_64-linux-gnu and powerpc64le-linux-gnu. I also checked the libpthread.so .gnu.version_d entries for every ABI affected and all of them contains the required versions (including for architectures which exports __nanosleep with a different version). Reviewed-by: Florian Weimer <fweimer@redhat.com>
* nptl: Add pthread_timedjoin_np, pthread_clockjoin_np NULL timeout testMike Crowe2019-11-012-0/+75
| | | | | | | | | | | Passing NULL as the timeout parameter to pthread_timedjoin_np has resulted in it behaving like pthread_join for a long time. Since that is now the documented behaviour, we ought to test that both it and the new pthread_clockjoin_np support it. Checked on x86_64-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add pthread_clockjoin_npMike Crowe2019-11-0115-28/+181
| | | | | | | | | | | Introduce pthread_clockjoin_np as a version of pthread_timedjoin_np that accepts a clockid_t parameter to indicate which clock the timeout should be measured against. This mirrors the recently-added POSIX-proposed "clock" wait functions. Checked on x86_64-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>