Go to file
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
ChangeLog.old
argp
assert
benchtests Add new script for plotting string benchmark JSON output 2019-11-13 14:18:52 +00:00
bits
catgets
conform
crypt
csu Introduce link_map_audit_state accessor function 2019-11-15 13:03:40 +01:00
ctype
debug
dirent
dlfcn
elf Expand $(as-needed) and $(no-as-needed) throughout the build system 2019-12-03 21:37:50 +01:00
gmon
gnulib
grp
gshadow
hesiod
htl
hurd hurd: Use __clock_gettime in _hurd_select 2019-11-07 09:54:33 +01:00
iconv
iconvdata
include y2038: linux: Provide __timer_gettime64 implementation 2019-12-05 23:16:54 +01:00
inet Change most internal uses of __gettimeofday to __clock_gettime. 2019-10-30 17:04:10 -03:00
intl
io hurd: Fix ld.so __access override from libc 2019-12-01 21:05:56 +00:00
libio libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203] 2019-11-27 20:16:22 +01:00
locale locale: Greek -> ASCII transliteration table [BZ #12031] 2019-11-26 12:23:09 +01:00
localedata ru_UA locale: use copy "ru_RU" in LC_TIME (bug 25044) 2019-11-26 11:54:29 +01:00
login login: Use pread64 in utmp implementation 2019-11-12 20:13:35 +01:00
mach hurd: make strerror(0) coherent with other ports 2019-12-01 16:36:43 +00:00
malloc Correct range checking in mallopt/mxfast/tcache [BZ #25194] 2019-12-05 16:46:37 -05:00
manual nptl: Fix niggles with pthread_clockjoin_np 2019-11-04 16:44:49 -03:00
math math: enhance the endloop condition of function handle_input_flag 2019-11-07 00:26:54 +00:00
mathvec
misc misc: Set generic pselect as ENOSYS 2019-11-22 14:40:57 -03:00
nis Change most internal uses of __gettimeofday to __clock_gettime. 2019-10-30 17:04:10 -03:00
nptl Expand $(as-needed) and $(no-as-needed) throughout the build system 2019-12-03 21:37:50 +01:00
nptl_db slotinfo in struct dtv_slotinfo_list should be flexible array [BZ #25097] 2019-11-12 13:54:30 +01:00
nscd Change most internal uses of time to __clock_gettime. 2019-10-30 17:11:10 -03:00
nss
po
posix Fix array bounds violation in regex matcher (bug 25149) 2019-11-11 12:24:59 +01:00
pwd
resolv resolv: Implement trust-ad option for /etc/resolv.conf [BZ #20358] 2019-11-27 20:54:37 +01:00
resource
rt
scripts build-many-glibcs.py: Move sparcv8 to extra_glibcs 2019-12-05 08:51:58 -03:00
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib Expand $(as-needed) and $(no-as-needed) throughout the build system 2019-12-03 21:37:50 +01:00
string <string.h>: Define __CORRECT_ISO_CPP_STRING_H_PROTO for Clang [BZ #25232] 2019-12-05 16:50:00 +01:00
sunrpc Change most internal uses of __gettimeofday to __clock_gettime. 2019-10-30 17:04:10 -03:00
support resolv: Implement trust-ad option for /etc/resolv.conf [BZ #20358] 2019-11-27 20:54:37 +01:00
sysdeps y2038: linux: Provide __timer_gettime64 implementation 2019-12-05 23:16:54 +01:00
sysvipc
termios
time Declare asctime_r, ctime_r, gmtime_r, localtime_r for C2X. 2019-11-11 15:04:48 +00:00
timezone
wcsmbs Use DEPRECATED_SCANF macro for remaining C99-compliant scanf functions 2019-11-22 15:29:21 -03:00
wctype
.gitattributes
.gitignore
COPYING
COPYING.LIB
INSTALL
LICENSES
MAINTAINERS
Makeconfig Expand $(as-needed) and $(no-as-needed) throughout the build system 2019-12-03 21:37:50 +01:00
Makefile Do not use ld.so to open statically linked programs in debugglibc.sh 2019-12-04 09:17:06 -03:00
Makefile.help
Makefile.in
Makerules Expand $(as-needed) and $(no-as-needed) throughout the build system 2019-12-03 21:37:50 +01:00
NEWS Lazy binding failures during dlopen/dlclose must be fatal [BZ #24304] 2019-11-27 20:55:35 +01:00
README
Rules
abi-tags
aclocal.m4
config.h.in
config.make.in
configure x86: Assume --enable-cet if GCC defaults to CET [BZ #25225] 2019-12-03 18:48:18 +01:00
configure.ac x86: Assume --enable-cet if GCC defaults to CET [BZ #25225] 2019-12-03 18:48:18 +01:00
extra-lib.mk
gen-locales.mk
libc-abis
libof-iterator.mk
o-iterator.mk
shlib-versions
test-skeleton.c
version.h

README

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arm-*-linux-gnueabi
	csky-*-linux-gnuabiv2
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see https://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at https://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see https://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.