This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v3 0/5] y2038: Linux: Provide __clock_settime function supporting 64 bit time
- From: Lukasz Majewski <lukma at denx dot de>
- To: libc-alpha at sourceware dot org
- Cc: Stepan Golosunov <stepan at golosunov dot pp dot ru>, Arnd Bergmann <arnd at arndb dot de>, Paul Eggert <eggert at cs dot ucla dot edu>, Joseph Myers <joseph at codesourcery dot com>, Lukasz Majewski <lukma at denx dot de>
- Date: Tue, 7 May 2019 15:18:37 +0200
- Subject: [PATCH v3 0/5] y2038: Linux: Provide __clock_settime function supporting 64 bit time
- References: <20190414220841.20243-1-lukma@denx.de>
This patch set introduces the conversion of __clock_settime to explicit
64 bit struct __timespec64 arguments. As a result this function is now
Y2038 safe.
To achieve the above goal - new, internal to glibc,
struct __timespec64 has been also introduced as well as
helper functions to handle time conversions on 32 bit systems.
The code from this patch set uses new clock_settime64 syscall (explicit
64 bits) from Linux kernel (5.1+).
In glibc new __ASSUME_TIME64_SYSCALLS define has been introduced to
indicate if above syscall is provided by the kernel.
This work is (loosely) based on a previous development/patches:
https://libc-alpha.sourceware.narkive.com/zniMOWui/rfc-patch-00-52-make-glibc-y2038-proof#post68
Github branch (including the y2038 conversion example):
https://github.com/lmajewski/y2038_glibc/commits/Y2038-2.29-glibc-__clock-internal-struct-timespec-v3
Those patches have been applied on top of master branch:
SHA1: 32e902a94e24fc5a00168d0df3301098704c61fb
Shall be used with provided meta-y2038 for development and testing:
https://github.com/lmajewski/meta-y2038
I've used guidelines from:
https://www.gnu.org/software/libc/manual/html_mono/libc.html
"D.2.1 64-bit time symbol handling in the GNU C Library"
to convert *clock_settime*.
and most notably from:
https://sourceware.org/glibc/wiki/Y2038ProofnessDesign#clock_gettime.28.29
Feedback and comments are more than welcome.
Lukasz Majewski (5):
y2038: Introduce __ASSUME_TIME64_SYSCALLS define
y2038: Introduce internal for glibc struct __timespec64
y2038: Provide conversion helpers for struct __timespec64
y2038: linux: Provide __clock_settime64 implementation
y2038: Support for Y2038 safe time on 32 bit systems
include/features.h | 19 ++++
include/time.h | 121 +++++++++++++++++++++++
manual/creature.texi | 28 ++++++
sysdeps/unix/sysv/linux/clock_settime.c | 53 +++++++++-
sysdeps/unix/sysv/linux/kernel-features.h | 38 +++++++
sysdeps/unix/sysv/linux/x86_64/kernel-features.h | 9 ++
time/Versions | 3 +
time/bits/types/struct_timespec.h | 15 ++-
time/bits/types/time_t.h | 4 +
time/time.h | 9 ++
10 files changed, 294 insertions(+), 5 deletions(-)
--
2.11.0