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 Thu, Jun 27, 2019 at 4:08 PM Lukasz Majewski <lukma@denx.de> wrote:
> > > On Thu, Jun 27, 2019 at 12:36 PM Lukasz Majewski <lukma@denx.de>
> > > wrote:  
> > 2. For arch with WORDSIZE==64 (and WORDSIZE_SYSCALL=64 -> x32) and
> > __TIMESIZE==64
> >
> > __clock_settime64 (clockid_t clock_id, const struct __timespec64
> > *tp) {
> > #ifdef __ASSUME_TIME64_SYSCALLS
> > # ifndef __NR_clock_settime64
> > #  define __NR_clock_settime64 __NR_clock_settime
> > # endif
> >   return INLINE_SYSCALL_CALL (clock_settime64, clock_id, tp);
> > #else
> > ....  
> 
> Ok, I see. I missed the fact that you also had
> __ASSUME_TIME64_SYSCALLS on 64-bit architectures,
> and define a local __NR_clock_settime64, and just
> assumed that the 64-bit case would be unmodified from what
> it is now.

Yes. Exactly.

> 
> Are you missing a
> 
> weak_alias (__clock_settime64, clock_settime)
> 
> in this case?

I think that it is not necessary as the patch [1] has following code:

> 
>    Arnd

 
#if __TIMESIZE == 64
# define __clock_settime64 __clock_settime
#else
extern int __clock_settime64 (clockid_t clock_id,
                              const struct __timespec64 *tp);
libc_hidden_proto (__clock_settime64)
#endif

So for archs supporting 64 bit time syscalls (WORDSIZE==64 &&
WORDSIZE_SYSCALLS==64) we have the #define and the
weak_alias (__clock_settime, clock_settime) does the job.



If you are interested, please look into patch [2], which is a
proposition of using clock_settime as a part of Y2038 safe system.
This code corresponds to v3 of adding clock_settime syscall support,
which is a bit outdated as now we discuss v5. It gives a rough idea
though.


Note:

[1] - https://patchwork.ozlabs.org/patch/1107235/
[2] - https://patchwork.ozlabs.org/patch/1096352/

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