This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v5 0/3] y2038: Linux: Introduce __clock_settime64 function


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 systems with
not defined __ASSUME_TIME64_SYSCALLS.

The code from this patch set uses the new clock_settime64 syscall
from Linux kernel (5.1+).

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-v5

Those patches have been applied on top of master branch:
SHA1: e47308c98d2187b9657c58199a3597d72b89bf40

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

Dependency:
The patch adding __ASSUME_TIME64_SYSCALLS define:
"y2038: Introduce __ASSUME_TIME64_SYSCALLS define"
https://patchwork.ozlabs.org/patch/1107125/

Feedback and comments are more than welcome.

Lukasz Majewski (3):
  y2038: Introduce internal for glibc struct __timespec64
  y2038: Provide conversion helpers for struct __timespec64
  y2038: linux: Provide __clock_settime64 implementation

 include/time.h                          | 118 ++++++++++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/clock_settime.c |  37 ++++++++--
 2 files changed, 151 insertions(+), 4 deletions(-)

-- 
2.11.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]