glibc/sysdeps/unix/sysv/linux/x86
Lukasz Majewski 75c4044b9a y2038: linux: Provide __time64 implementation
In the glibc the time function can use vDSO (on power and x86 the
USE_IFUNC_TIME is defined), time syscall or 'default' time() from
./time/time.c (as a fallback).

In this patch the last function (time) has been refactored and moved
to ./sysdeps/unix/sysv/linux/time.c to be Linux specific.

The new __time64 explicit 64 bit function for providing 64 bit value of
seconds after epoch (by internally calling __clock_gettime64) has been
introduced.

Moreover, a 32 bit version - __time has been refactored to internally
use __time64.

The __time is now supposed to be used on systems still supporting 32 bit
time (__TIMESIZE != 64) - hence the necessary check for time_t potential
overflow.

The iFUNC vDSO direct call optimization has been removed from both i686 and
powerpc32 (USE_IFUNC_TIME is not defined for those architectures
anymore). The Linux kernel does not provide a y2038 safe implementation of
time neither it plans to provide it in the future, __clock_gettime64
should be used instead. Keeping support for this optimization would require
to handle another build permutation (!__ASSUME_TIME64_SYSCALLS &&
USE_IFUNC_TIME which adds more complexity and has limited use (since the
idea is to eventually have a y2038 safe glibc build).

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 __time64 and __time.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-19 16:01:37 +02:00
..
bits linux: Move the struct stat{64} to struct_stat.h 2020-10-09 17:02:06 -03:00
include/asm x86: Remove ARCH_CET_LEGACY_BITMAP [BZ #25397] 2020-03-18 04:35:54 -07:00
sys Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
arch-pkey.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
cpu-features.c x86: Move CET control to _dl_x86_feature_control [BZ #25887] 2020-05-18 06:15:02 -07:00
dl-cet.h x86: Remove ARCH_CET_LEGACY_BITMAP [BZ #25397] 2020-03-18 04:35:54 -07:00
dl-sysdep.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
elision-conf.c x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
elision-conf.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
elision-lock.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
elision-timed.c y2038: nptl: Convert pthread_mutex_{clock|timed}lock to support 64 bit 2020-10-15 09:35:43 +02:00
elision-trylock.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
elision-unlock.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
force-elision.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
gettimeofday.c y2038: linux: Provide __gettimeofday64 implementation 2020-02-18 23:55:47 +01:00
hle.h
Implies
jmp_buf-ssp.sym
lowlevellock.h y2038: nptl: Convert pthread_mutex_{clock|timed}lock to support 64 bit 2020-10-15 09:35:43 +02:00
Makefile x86/CET: Update vfork to prevent child return 2020-10-15 04:00:36 -07:00
pkey_get.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
pkey_set.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
pthread_mutex_cond_lock.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
pthread_mutex_lock.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
pthread_mutex_timedlock.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
pthread_mutex_trylock.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
setjmpP.h linux: Fix __NSIG_WORDS and add __NSIG_BYTES 2020-07-07 14:10:58 -03:00
sysconf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
time.c y2038: linux: Provide __time64 implementation 2020-10-19 16:01:37 +02:00
tst-cet-property-1.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
tst-cet-property-2.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
tst-cet-property-dep-2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
tst-cet-setcontext-1.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
tst-cet-vfork-1.c x86/CET: Update vfork to prevent child return 2020-10-15 04:00:36 -07:00
tst-saved_mask-1.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
xstatver.h Remove mknod wrapper functions, move them to symbols 2020-10-09 17:02:06 -03:00