glibc/sysdeps
Lukasz Majewski 6f5eb5b2e5 y2038: linux: Provide __mq_timedsend_time64 implementation
This patch provides new __mq_timedsend_time64 explicit 64 bit function for
sending messages with absolute timeout.
Moreover, a 32 bit version - __mq_timedsend has been refactored to internally
use __mq_timedsend_time64.

The __mq_timedsend is now supposed to be used on systems still supporting 32
bit time (__TIMESIZE != 64) - hence the necessary conversion to 64 bit struct
__timespec64 from struct timespec.

The new __mq_timedsend_time64 syscall available from Linux 5.1+ has been used,
when applicable.

As this wrapper function is also used internally in the glibc, to e.g. provide
mq_send implementation, an explicit check for abs_timeout being NULL has been
added due to conversions between struct timespec and struct __timespec64.
Before this change the Linux kernel handled this NULL pointer.

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

Linux kernel, headers and minimal kernel version for glibc build test matrix:
- Linux v5.1 (with mq_timedsend_time64) and glibc built with v5.1 as a
  minimal kernel version (--enable-kernel="5.1.0")
  The __ASSUME_TIME64_SYSCALLS flag defined.

- Linux v5.1 and default minimal kernel version
  The __ASSUME_TIME64_SYSCALLS not defined, but kernel supports
  mq_timedsend_time64 syscall.

- Linux v4.19 (no mq_timedsend_time64 support) with default minimal kernel
  version for contemporary glibc (3.2.0)
  This kernel doesn't support mq_timedsend_time64 syscall, so the fallback to
  mq_timedsend is tested.

Above tests were performed with Y2038 redirection applied as well as without
(so the __TIMESIZE != 64 execution path is checked as well).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2020-04-06 23:05:11 +02:00
..
aarch64 math: Remove inline math tests 2020-03-19 11:45:44 -03:00
alpha math: Remove inline math tests 2020-03-19 11:45:44 -03:00
arm math: Remove inline math tests 2020-03-19 11:45:44 -03:00
csky math: Remove inline math tests 2020-03-19 11:45:44 -03:00
generic ldbl-128ibm-compat: Provide ieee128 symbols to narrow functions 2020-02-20 17:12:14 -06:00
gnu Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
hppa Add new file missed in previous hppa commit. 2020-03-30 21:58:06 +00:00
htl pthread: Move robust mutex tests from nptl to sysdeps/pthread 2020-02-16 14:43:54 +00:00
hurd C11 threads: Move implementation to sysdeps/pthread 2020-02-09 13:56:48 +01:00
i386 math: Add inputs that yield larger errors for float type (x86_64) 2020-03-31 21:48:54 -04:00
ia64 math: Remove inline math tests 2020-03-19 11:45:44 -03:00
ieee754 ldbl-128ibm: simplify iscanonical.h 2020-04-06 10:23:58 -05:00
m68k math: Remove inline math tests 2020-03-19 11:45:44 -03:00
mach posix: Remove posix waitid 2020-02-27 16:16:17 -03:00
microblaze math: Remove inline math tests 2020-03-19 11:45:44 -03:00
mips math: Remove inline math tests 2020-03-19 11:45:44 -03:00
nios2 math: Remove inline math tests 2020-03-19 11:45:44 -03:00
nptl Linux: set_robust_list syscall number is always available 2020-03-03 12:49:44 +01:00
posix posix: Fix system error return value [BZ #25715] 2020-03-23 18:00:38 -03:00
powerpc powerpc64le: enforce non-specific long double in .gnu.attributes section 2020-04-06 10:23:58 -05:00
pthread pthread: Fix building tst-robust8 with nptl 2020-02-16 23:53:45 +01:00
riscv math: Remove inline math tests 2020-03-19 11:45:44 -03:00
s390 S390: Regenerate ULPs. 2020-04-03 09:38:02 +02:00
sh math: Remove inline math tests 2020-03-19 11:45:44 -03:00
sparc sparc: Move __fenv_{ld,st}fsr to fenv-private.h 2020-03-30 10:52:32 -03:00
unix y2038: linux: Provide __mq_timedsend_time64 implementation 2020-04-06 23:05:11 +02:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
x86 x86: Remove feraiseexcept optimization 2020-03-30 10:52:32 -03:00
x86_64 nptl: Remove x86_64 cancellation assembly implementations [BZ #25765] 2020-04-03 10:47:59 -03:00