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 v4 03/24] sysdeps/gettimeofday: Use clock_gettime64 if avaliable


On Fri, 9 Aug 2019, Alistair Francis wrote:

> The Linux documentation says that "The use of the timezone structure
> is obsolete; the tz argument should normally be specified as NULL."

The relevant information to include in commit messages here isn't what the 
documentation says, it's what the interfaces actually do, as detailed in 
<https://sourceware.org/ml/libc-alpha/2019-07/msg00574.html>.

>  __gettimeofday (struct timeval *tv, struct timezone *tz)

> +#ifdef __ASSUME_TIME64_SYSCALLS
> +  long int ret;
> +  struct timespec now;
> +
> +  ret = INLINE_VSYSCALL (clock_gettime64, 2, CLOCK_REALTIME,
> +                         &now);

This is using a timespec (possibly 32-bit) with a syscall that requires 
the 64-bit version.  You need to address such issues throughout the patch 
series.  As illustrated here, it's not just cases where you have a 
mismatch with the function interface; you need to make sure, in every 
case, that where you pass internal variables to 64-bit time syscalls they 
have the correct type as well.

> +#else
> +# ifdef __NR_clock_nanosleep_time64

No, this code isn't using clock_nanosleep_time64.  The #ifdef should be 
for the syscall it actually uses.

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