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 v5 2/3] y2038: Provide conversion helpers for struct __timespec64


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

Attachment: pgp0M2bnW6OYl.pgp
Description: OpenPGP digital signature


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