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]

Re: [PATCH] Y2038: provide kernel support indication


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.


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