glibc/sysdeps
Lukasz Majewski 562cdc19c7 y2038: linux: Provide __timer_gettime64 implementation
This patch provides new __timer_gettime64 explicit 64 bit function for reading
status of specified timer. To be more precise - the remaining time and interval
set with timer_settime.
Moreover, a 32 bit version - __timer_gettime has been refactored to internally
use __timer_gettime64.

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

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

The original INLINE_SYSCALL() macro has been replaced with
INLINE_SYSCALL_CALL() to avoid explicit passing the number of arguments.

Build tests:
- The code has been tested on x86_64/x86 (native compilation):
make PARALLELMFLAGS="-j8" && make check PARALLELMFLAGS="-j8" && \\
make xcheck PARALLELMFLAGS="-j8"

- The glibc has been build tested (make PARALLELMFLAGS="-j8") for
x86 (i386), x86_64-x32, and armv7

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

- Use of cross-test-ssh.sh for ARM (armv7):
  make PARALLELMFLAGS="-j8" test-wrapper='./cross-test-ssh.sh root@192.168.7.2' xcheck

Linux kernel, headers and minimal kernel version for glibc build test
matrix:
- Linux v5.1 (with timer_gettime64) and glibc build with v5.1 as
  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 timer_gettime64
  syscall.

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

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

No regressions were observed.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-05 23:16:54 +01:00
..
aarch64 elf: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214] 2019-12-02 14:55:22 +01:00
alpha nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
arm elf: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214] 2019-12-02 14:55:22 +01:00
csky nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
generic Avoid late dlopen failure due to scope, TLS slotinfo updates [BZ #25112] 2019-11-27 20:55:35 +01:00
gnu Add TCP_TX_DELAY from Linux 5.3 to netinet/tcp.h. 2019-09-27 13:37:36 +00:00
hppa nptl: Add struct_rwlock.h 2019-11-26 13:53:36 +00:00
htl time: Introduce function to check correctness of nanoseconds value 2019-10-27 21:49:25 +01:00
hurd Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
i386 elf: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214] 2019-12-02 14:55:22 +01:00
ia64 nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
ieee754 ldbl-128ibm-compat: Add tests for strfroml, strtold, and wcstold 2019-12-03 13:30:42 -03:00
init_array Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
m68k nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
mach hurd: Fix ld.so __access override from libc 2019-12-01 21:05:56 +00:00
microblaze nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
mips nptl: Add struct_rwlock.h 2019-11-26 13:53:36 +00:00
nios2 nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
nptl nptl: Fix __PTHREAD_MUTEX_INITIALIZER for !__PTHREAD_MUTEX_HAVE_PREV 2019-11-26 17:00:19 -03:00
posix hurd: Fix ld.so __getcwd override from libc 2019-12-01 21:05:51 +00:00
powerpc Expand $(as-needed) and $(no-as-needed) throughout the build system 2019-12-03 21:37:50 +01:00
pthread Change most internal uses of __gettimeofday to __clock_gettime. 2019-10-30 17:04:10 -03:00
riscv nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
s390 S390: Fix handling of needles crossing a page in strstr z15 ifunc-variant. [BZ #25226] 2019-11-27 12:35:40 +01:00
sh nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
sparc elf: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214] 2019-12-02 14:55:22 +01:00
unix y2038: linux: Provide __timer_gettime64 implementation 2019-12-05 23:16:54 +01:00
wordsize-32 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
wordsize-64 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
x86 nptl: Add struct_rwlock.h 2019-11-26 13:53:36 +00:00
x86_64 elf: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214] 2019-12-02 14:55:22 +01:00