[PATCH] Y2038: provide kernel support indication
Paul Eggert
eggert@cs.ucla.edu
Mon Sep 24 21:50:00 GMT 2018
On 9/24/18 2:34 PM, Albert ARIBAUD wrote:
> Right now we can use the bits in __y2038_linux_support to indicate
> level of support (when positive) or reasons for not supporting (when
> negative). That's 31 distinct flags.
Rather than trying to shoehorn this into a single central integer or
bitset that governs everything that could go wrong or right with Y2038,
how about having a separate boolean (or whatever) variable for each
feature? That way, only code that is worried about that feature needs to
know about the variable, and it's easier to add or remove variables as
the need for them is discovered or abandoned.
> /* Linux kernel does or does not provide clock_gettime64 syscall. */
> #define Y2038_FEATURE_LINUX_CLOCK_GETTIME64 1
>
> /* Linux kernel does or does not provide clock_settime64 syscall. */
> #define Y2038_FEATURE_LINUX_CLOCK_SETTIME64 2
Will there ever be a kernel that provides one syscall but not the other?
We shouldn't need variables for each theoretically-possible platform,
only for the platforms that exist, or are likely to.
More information about the Libc-alpha
mailing list