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: [RFC v2 03/20] y2038: linux: Provide __clock_settime64 implementation


Hi Arnd,

> On Tue, Jun 25, 2019 at 2:11 AM Alistair Francis
> <alistair.francis@wdc.com> wrote:
> 
> >  weak_alias (__clock_settime, clock_settime)
> > +
> > +#if __TIMESIZE != 64
> > +int
> > +__clock_settime (clockid_t clock_id, const struct timespec *tp)
> > +{
> > +  struct __timespec64 ts64;
> > +
> > +  valid_timespec_to_timespec64 (tp, &ts64);
> > +  return __clock_settime64 (clock_id, &ts64);
> > +}
> > +#endif  
> 
> I missed this when Lukasz first posted this, but I would still
> prefer this to be changed.
> 
> Having clock_settime() (using the weak_alias) call into
> __clock_settime64() means that a kernel that warns about
> old user space calling into the old syscall never notices this.

Could you be more specific here?


I thought that we do not care about the legacy systems (i.e. those
which don't switch to 64 bit time syscalls before Y2038).

The assumption is to not break anything and use 64 bit time related
syscalls after v5.1 kernel (i.e. clock_settime64 and friends on systems
with __WORDSIZE=32).

Syscalls, which handle only 32 bit time would be used as fallback.

> 
> Can you please leave the existing clock_settime()

I think that some pseudo code would shed some more light on your idea.

> untouched and instead just change the internal callers
> (if any) over to __clock_settime64?

The above approach (from this patch) was developed to comply with
following recommendations:

https://www.gnu.org/software/libc/manual/html_mono/libc.html
"D.2.1 64-bit time symbol handling in the GNU C Library"
to convert *clock_settime*.

and most notably from:
https://sourceware.org/glibc/wiki/Y2038ProofnessDesign#clock_gettime.28.29
recommended by glibc for the syscalls conversion for 64 bit.

It also uses the __ASSUME_TIME64_SYSCALLS flag.

> 
>       Arnd




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: pgpzwAwY63shQ.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]