[PATCH v5 2/3] y2038: Provide conversion helpers for struct __timespec64

Lukasz Majewski lukma@denx.de
Mon Jun 3 09:19:00 GMT 2019


Hi Stepan,

> 29.05.2019 в 18:18:49 +0200 Lukasz Majewski написал:
> > Those functions allow easy conversion between Y2038 safe struct
> > __timespec64 and other time related data structures (like struct
> > timeval).
> > 
> > Moreover, those functions are NOT compiled when 64 bit time support
> > is enabled (i.e. the __ASSUME_TIME64_SYSCALLS is defined) and are
> > used only in 32 bit wrappers (like e.g. __clock_settime()).  
> 
> 
> > Changes for v5:
> > - This code is now only compiled in when __ASSUME_TIME64_SYSCALLS
> > is NOT defined. Previously it was depending on #if __TIMESIZE !=
> > 64.  
> 
> That's wrong.  valid_timespec_to_timespec64 is used when __TIMESIZE !=
> 64.  Even when __ASSUME_TIME64_SYSCALLS is defined.

Hmm.. Then I think that I should have kept [1]:

#if __TIMESIZE != 64

(helper functions)

#endif

> 
> And when __ASSUME_TIME64_SYSCALLS is not defined __TIMESIZE should be
> 32.  (Supporting __TIMESIZE == 64 without __ASSUME_TIME64_SYSCALLS is
> a bad idea.)

The above assumption is implicit. When __ASSUME_TIME64_SYSCALLS is
defined 64 bit versions of syscalls are used and hence we don't need
the conversion.

Shall I add more formalism here or just use #ifdef from [1] ?

> 
> Also, it doesn't look like __ASSUME_TIME64_SYSCALLS can be defined by
> any header included from include/time.h.

Ok.


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20190603/d5e9f815/attachment.sig>


More information about the Libc-alpha mailing list