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 RFC 2] 02/63] Y2038: add function __difftime64


On Wed, 2 May 2018, Albert ARIBAUD wrote:

> 1) Keep the original file untouched as the 32-bit-time compilation unit.
> Compiling this file as it is now ensures that the ABI is untouched.
> 
> 2) Compile the same original file with -D_TIME_BITS=64 (just like
> application code would be compiled under 64-bit-time), producing a
> second compilation unit which provides new symbols.

3. Make the main implementation the 64-bit one.  Make difftime into a thin 
wrapper round __difftime64.  (In the case where time_t is already 64-bit, 
the function would just be built directly as difftime without any wrapper 
being involved.)

That's what I think it appropriate in all the cases where the function 
implementations are nontrivial.  It avoids duplication of complicated code 
in the sources, and reduces the code size increase from duplication in the 
binaries.

That's particularly important for e.g. the pthread functions where a 
previous patch series was duplicating hundreds of lines of code in some 
cases.

It would mean times sometimes go through two levels of validation / 
conversion, from 32-bit to 64-bit and then back to 32-bit if the kernel 
doesn't support the 64-bit interfaces, but I think the cost of that is 
negligible.

-- 
Joseph S. Myers
joseph@codesourcery.com


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