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 v2 1/2] Y2038: make __mktime_internal compatible with __time64_t


On Thu, 28 Mar 2019, Lukasz Majewski wrote:

> > where __time_t is merely an alias for time_t and so is 64 bits if
> > _TIME_BITS=64 and is the current size (32 or 64) otherwise.
> 
> In other words - I shall not introduce new "installed" type for struct
> timeval and just in posix/bits/types.h define:
> 
> #ifndef __USE_TIME_BITS64
>   __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
> #else
>   __STD_TYPE·__TIME64_T_TYPE __time_t;
> #endif

Note that would conflict with the practice for all the other types such as 
__off_t.

> In that way all structures which use __time_t are Y2038 safe.

I don't think you can avoid explicit conditionals in struct timespec, 
because of the issue of endian-dependent padding around 32-bit 
nanoseconds.

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