[[PATCH RFC 2] 02/63] Y2038: add function __difftime64

Paul Eggert eggert@cs.ucla.edu
Wed May 2 19:14:00 GMT 2018


On 05/02/2018 12:22 AM, Albert ARIBAUD wrote:
> At least the
> syscall-dependent ones work differently: the 32-bit impelmentations
> just use the 32-bit syscalls, while the 64-bit implementations have to
> use the 64-bit syscalls *if availaible at run-time*, and be able to
> fallback on the 32-bit syscalls if they have to.

That's fine, and we can have code protected by ifdef to do that as 
needed for the special case where the system has multiple time_t flavors 
some of which might not work. This doesn't mean we need to have separate 
copies of the entire module that needs to use such code.

And for functions like difftime that do not use time_t-related syscalls, 
things should be even simpler, as we shouldn't need to worry about this 
issue in those functions.

> Using a single source code for both 32-bit time and 64-bit time
> would mean that 32-bit syscall-based implementation behavior would
> change,

I don't see why it would, at least not if things were done as suggested 
above.



More information about the Libc-alpha mailing list