about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* htl: XFAIL rwlock tests which need pshared supportSamuel Thibault2020-02-091-0/+2
|
* pthread: Move some rwlock tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-098-0/+1106
| | | | So they can be checked with htl too.
* pthread: Move most once tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-097-0/+525
| | | | So they can be checked with htl too.
* htl: support cancellation during pthread_onceSamuel Thibault2020-02-091-0/+10
|
* pthread: Move most cond tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-0930-0/+3789
| | | | So they can be checked with htl too.
* htl: make pthread_cond_destroy return EBUSY on waitersSamuel Thibault2020-02-091-1/+8
|
* htl: Report missing mutex lock on pthread_cond_*waitSamuel Thibault2020-02-092-0/+55
|
* pthread: Move some attr tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-092-0/+306
| | | | So they can be checked with htl too.
* htl: Fix default guard sizeSamuel Thibault2020-02-092-1/+5
| | | | | When it is not hardcoded by the architecture with PAGESIZE, we need to use the dynamic values from __vm_page_size.
* pthread: Move most mutex tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-099-1/+1468
| | | | | | 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-0/+376
| | | | So they can be checked with htl too.
* htl: make pthread_spin_lock really spinSamuel Thibault2020-02-091-1/+1
| | | | | __spin_lock would actually use gsync_wait to block, which is not what pthread_spin_lock is about.
* htl: Avoid check-installed-headers looking at inlinesSamuel Thibault2020-02-091-2/+4
|
* htl: Do not put spin_lock inlines in public headersSamuel Thibault2020-02-092-36/+36
| | | | | | They were not getting used anyway. Also do not make libsupport use them, it would make tests using it have to be made to link against libmachuser for gsync_wait.
* pthread: Move basic tests from nptl to sysdeps/pthreadSamuel Thibault2020-02-098-1/+675
| | | | So they can be checked with htl too.
* htl: Fix calling pthread_exit in the child of a forkSamuel Thibault2020-02-091-0/+9
| | | | | We need to reset the threads counter, otherwise pthread_exit() would not call exit(0).
* x86: Remove <bits/select.h> and use the generic versionFlorian Weimer2020-02-091-63/+0
| | | | | | Particularly on CPUs without ERMS, the string instructions are slow, so it is unclear whether this architecture-specific implementation is in fact an optimization.
* C11 threads: Move implementation to sysdeps/pthreadSamuel Thibault2020-02-0947-64/+1633
| | | | | | | 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>
* htl: Add C11 threads types definitionsSamuel Thibault2020-02-091-0/+13
|
* nptl: Move nptl-specific types to separate headerSamuel Thibault2020-02-092-8/+15
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* htl: Make __PTHREAD_ONCE_INIT more flexibleSamuel Thibault2020-02-092-2/+2
| | | | | | by moving its (struct __pthread_once) cast into PTHREAD_ONCE_INIT. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* htl: Add support for C11 threads behaviorSamuel Thibault2020-02-091-0/+3
| | | | | | | Essentially properly calling the thread function which returns an int instead of a void*. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* htl: Add missing internal functions declarationsSamuel Thibault2020-02-091-0/+13
|
* htl: Rename _pthread_mutex_init/destroy to __pthread_mutex_init/destroySamuel Thibault2020-02-094-8/+9
|
* htl: Move internal mutex/rwlock symbols to GLIBC_PRIVATESamuel Thibault2020-02-091-7/+0
| | | | | Their prototypes have never been made public, and they are not used outside libc (checked on the whole Debian archive)
* Linux: Add io/tst-o_path-locks testFlorian Weimer2020-02-092-1/+101
| | | | | | The O_PATH-based fchmodat emulation will rely on the fact that closing an O_PATH descriptor never releases POSIX advisory locks, so this commit adds a test case for this behavior.
* htl: Remove duplicate filesSamuel Thibault2020-02-092-56/+0
| | | | The generic versions have the same content.
* htl: Remove unused filesSamuel Thibault2020-02-0924-1100/+0
| | | | These have never been used.
* Remove a comment claiming that sin/cos round correctly.Wilco Dijkstra2020-02-071-4/+4
|
* y2038: linux: Provide __settimeofday64 implementationLukasz Majewski2020-02-071-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides new __settimeofday64 explicit 64 bit function for setting 64 bit time in the kernel (by internally calling __clock_settime64). Moreover, a 32 bit version - __settimeofday has been refactored to internally use __settimeofday64. The __settimeofday is now supposed to be used on systems still supporting 32 bit time (__TIMESIZE != 64) - hence the necessary conversion of struct timeval to 64 bit struct __timespec64. Internally the settimeofday uses __settimeofday64. This patch is necessary for having architectures with __WORDSIZE == 32 Y2038 safe. Build tests: ./src/scripts/build-many-glibcs.py glibcs Run-time tests: - Run specific tests on ARM/x86 32bit systems (qemu): https://github.com/lmajewski/meta-y2038 and run tests: https://github.com/lmajewski/y2038-tests/commits/master Above tests were performed with Y2038 redirection applied as well as without to test proper usage of both __settimeofday64 and __settimeofday. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: alpha: Rename valid_timeval64_to_timeval to valid_timeval_to_timeval32Lukasz Majewski2020-02-074-9/+9
| | | | | | | | | | | | | | | | The name 'valid_timeval64_to_timeval' suggest conversion of struct __timeval64 to struct timeval (as in ./include/time.h). As on the alpha the struct timeval supports 64 bit time, it seems more feasible to emphasis struct timeval32 in the conversion function name. Hence the helper function naming change to 'valid_timeval_to_timeval32'. Build tests: ./src/scripts/build-many-glibcs.py glibcs Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: alpha: Rename valid_timeval_to_timeval64 to valid_timeval32_to_timevalLukasz Majewski2020-02-074-7/+7
| | | | | | | | | | | | | | | | | | Without this patch the naming convention for functions to convert struct timeval32 to struct timeval (which supports 64 bit time on Alpha) was a bit misleading. The name 'valid_timeval_to_timeval64' suggest conversion of struct timeval to struct __timeval64 (as in ./include/time.h). As on alpha the struct timeval supports 64 bit time it seems more readable to emphasis struct timeval32 in the conversion function name. Hence the helper function naming change to 'valid_timeval32_to_timeval'. Build tests: ./src/scripts/build-many-glibcs.py glibcs Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: Define __suseconds64_t type to be used with struct __timeval64Lukasz Majewski2020-02-076-0/+6
| | | | | | | | | | | | | | | The __suseconds64_t type is supposed to be the 64 bit type across all architectures. It would be mostly used internally in the glibc - however, when passed to Linux kernel (very unlikely), if necessary, it shall be converted to 32 bit type (i.e. __suseconds_t) Build tests: ./src/scripts/build-many-glibcs.py glibcs Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update kernel version to 5.5 in tst-mman-consts.py.Joseph Myers2020-02-071-1/+1
| | | | | | | | This patch updates the kernel version in the test tst-mman-consts.py to 5.5. (There are no new constants covered by this test in 5.5 that need any other header changes.) Tested with build-many-glibcs.py.
* Update syscall lists for Linux 5.5.Joseph Myers2020-02-072-2/+3
| | | | | | | | | Linux 5.5 has no new syscalls to add to syscall-names.list, but it does newly enable the clone3 syscall for AArch64. This patch updates the kernel version listed in syscall-names.list and regenerates the AArch64 arch-syscall.h. Tested with build-many-glibcs.py.
* y2038: linux: Provide __timespec_get64 implementationLukasz Majewski2020-02-051-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides new instance of Linux specific timespec_get.c file placed in ./sysdeps/unix/sysv/linux/. When compared to this file version from ./time directory, it provides __timespec_get64 explicit 64 bit function for getting 64 bit time in the struct __timespec64 (for compilation using C11 standard). Moreover, a 32 bit version - __timespec_get internally uses __timespec_get64. The __timespec_get is now supposed to be used on systems still supporting 32 bit time (__TIMESIZE != 64) - hence the necessary conversion to 32 bit struct timespec. Internally the timespec_get uses __clock_gettime64. This patch is necessary for having architectures with __WORDSIZE == 32 Y2038 safe. Build tests: ./src/scripts/build-many-glibcs.py glibcs Run-time tests: - Run specific tests on ARM/x86 32bit systems (qemu): https://github.com/lmajewski/meta-y2038 and run tests: https://github.com/lmajewski/y2038-tests/commits/master Above tests were performed with Y2038 redirection applied as well as without to test proper usage of both __timespec_get64 and __timespec_get. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* rt: avoid PLT setup in timer_[sg]ettimeAndreas Schwab2020-02-032-2/+4
| | | | | | | | | | The functions __timer_gettime64 and __timer_settime64 live in librt, not libc. Use proper hidden aliases so that the callers do not need to set up the PLT register. Fixes commits cae1635a70 ("y2038: linux: Provide __timer_settime64 implementation") and 562cdc19c7 ("y2038: linux: Provide __timer_gettime64 implementation").
* y2038: linux: Provide __sched_rr_get_interval64 implementationLukasz Majewski2020-02-022-1/+73
| | | | | | | | | | | | | | | | | | | | | | This patch replaces auto generated wrapper (as described in sysdeps/unix/sysv/linux/syscalls.list) for sched_rr_get_interval with one which adds extra support for reading 64 bit time values on machines with __TIMESIZE != 64. There is no functional change for architectures already supporting 64 bit time ABI. The sched_rr_get_interval declaration in ./include/sched.h is not followed by corresponding libc_hidden_proto(), so it has been assumed that newly introduced syscall wrapper doesn't require libc_hidden_def() (which has been added by template used with auto generation script). Moreover, the code for building sched_rr_gi.c file is already placed in ./posix/Makefiles, so there was no need to add it elsewhere. Performed tests and validation are the same as for timer_gettime() conversion (sysdeps/unix/sysv/linux/timer_gettime.c). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: linux: Provide __timerfd_settime64 implementationLukasz Majewski2020-02-023-2/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces auto generated wrapper (as described in sysdeps/unix/sysv/linux/syscalls.list) for timerfd_settime with one which adds extra support for reading and writing from Linux kernel 64 bit time values on machines with __TIMESIZE != 64. There is no functional change for archs already supporting 64 bit time ABI. This patch is conceptually identical to timer_settime conversion already done in sysdeps/unix/sysv/linux/timer_settime.c. Please refer to corresponding commit message for detailed description of introduced functions and the testing procedure. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> --- Changes for v4: - Update date from 2019 to 2020 Changes for v3: - Add missing libc_hidden_def() Changes for v2: - Remove "Contributed by" from the file header - Remove early check for (fd < 0) in __timerfd_settime64 as the fd correctness check is already done in Linux kernel - Add single descriptive comment line to provide concise explanation of the code
* y2038: linux: Provide __timerfd_gettime64 implementationLukasz Majewski2020-02-023-2/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces auto generated wrapper (as described in sysdeps/unix/sysv/linux/syscalls.list) for timerfd_gettime with one which adds extra support for reading 64 bit time values on machines with __TIMESIZE != 64. There is no functional change for architectures already supporting 64 bit time ABI. This patch is conceptually identical to timer_gettime conversion already done in sysdeps/unix/sysv/linux/timer_gettime.c. Please refer to corresponding commit message for detailed description of introduced functions and the testing procedure. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> --- Changes for v4: - Update date from 2019 to 2020 Changes for v3: - Add missing libc_hidden_def() Changes for v2: - Remove "Contributed by" from the file header - Remove early check for (fd < 0) in __timerfd_gettime64 as the fd correctness check is already done in Linux kernel - Add single descriptive comment line to provide concise explanation of the code
* i386: Remove _exit.SH.J. Lu2020-02-011-44/+0
| | | | | | | The generic implementation is suffice since __NR_exit_group is always support and i386 does define ABORT_INSTRUCTION. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* i386: Use ENTRY/END in assembly codesH.J. Lu2020-02-013-15/+10
| | | | | | | Use ENTRY and END in assembly codes so that ENDBR32 will be added at function entries when CET is enabled. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* i386-mcount.S: Add _CET_ENDBR to _mcount and __fentry__H.J. Lu2020-02-011-0/+2
| | | | | | | Since _mcount and __fentry__ don't use ENTRY, we need to add _CET_ENDBR by hand. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* i386/sub_n.S: Add a missing _CET_ENDBR to indirect jump targetH.J. Lu2020-02-011-0/+1
| | | | | | Add a missing _CET_ENDBR to indirect jump targe in sysdeps/i386/sub_n.S. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* i386: Don't unnecessarily save and restore EAX, ECX and EDX [BZ# 25262]H.J. Lu2020-02-014-29/+10
| | | | | | | | | | | On i386, since EAX, ECX and EDX are caller-saved, there are no need to save and restore EAX, ECX and EDX in getcontext, setcontext and swapcontext. They just need to clear EAX on success. The extra scratch registers are needed to enable CET. Tested on i386. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* x86: Don't make 2 calls to dlerror () in a rowH.J. Lu2020-02-012-2/+2
| | | | | | | | | | We shouldn't make 2 calls to dlerror () in a row since the first call will clear the error. We should just use the return value from the first call. Tested on Linux/x86-64. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* nptl: Avoid using PTHREAD_MUTEX_DEFAULT in macro definition [BZ #25271]Florian Weimer2020-01-301-1/+1
| | | | | | | | | | | | | | | | | | | Commit 1c3f9acf1f1f75faa7a28bf39af64afd ("nptl: Add struct_mutex.h") replaced a zero constant with the identifier PTHREAD_MUTEX_DEFAULT in the macro PTHREAD_MUTEX_INITIALIZER. However, that constant is not available in ISO C11 mode: In file included from /usr/include/bits/thread-shared-types.h:74, from /usr/include/bits/pthreadtypes.h:23, from /usr/include/pthread.h:26, from bug25271.c:1: bug25271.c:3:21: error: ‘PTHREAD_MUTEX_DEFAULT’ undeclared here (not in a function) 3 | pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; | ^~~~~~~~~~~~~~~~~~~~~~~~~ This commit change the constant to the equivalent PTHREAD_MUTEX_TIMED_NP, which is in the POSIX extension namespace and thus always available.
* Fix array overflow in backtrace on PowerPC (bug 25423)Andreas Schwab2020-01-212-0/+4
| | | | | | When unwinding through a signal frame the backtrace function on PowerPC didn't check array bounds when storing the frame address. Fixes commit d400dcac5e ("PowerPC: fix backtrace to handle signal trampolines").
* getaddrinfo: Fix resource leak after strdup failure in gethosts [BZ #25425]Florian Weimer2020-01-201-0/+1
| | | | | | | | | | | | Filip Ochnik spotted that one of the error jumps in gethosts fails to call __resolv_context_put to release the resolver context. Fixes commit 352f4ff9a268b81ef5d4b2413f582565806e4790 ("resolv: Introduce struct resolv_context [BZ #21668]") and commit 964263bb8d650f1681665c55704fb01a8e725621 ("getaddrinfo: Release resolver context on error in gethosts [BZ #21885]"). Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Fix maybe-uninitialized error on powerpcMatheus Castanho2020-01-171-0/+7
| | | | | | | | | | | | | | | | | | | | | | The build has been failing on powerpc64le-linux-gnu with GCC 10 due to a maybe-uninitialized error: ../sysdeps/ieee754/dbl-64/mpa.c:875:6: error: ‘w.e’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 875 | EY -= EX; | ^~ The warning is thrown because when __inv is called by __dvd *y is not initialized and if t == 0 before calling __dbl_mp, EY will stay uninitialized, as the function does not touch it in this case. However, since t will be set to 1/t before calling __dbl_mp, t == 0 will never happen, so we can instruct the compiler to ignore this case, which suppresses the warning. Tested on powerpc64le. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>