[RFC PATCH 3/4] linux: consistently use time64 syscalls if available

Paul Eggert eggert@cs.ucla.edu
Tue Nov 10 16:10:19 GMT 2026


On 2026-11-10 06:51, Arnd Bergmann wrote:
> +  struct __timespec64 timeout_ts;
> +  struct __timespec64 *timeout_ts_p = NULL;
> +
> +  if (timeout >= 0)
> +    {
> +      timeout_ts.tv_sec = timeout / 1000;
> +      timeout_ts.tv_nsec = (timeout % 1000) * 1000000;
> +      timeout_ts_p = &timeout_ts;
> +    }

Simpler and clearer is something like this:

   struct __timespec64 *timeout_ts_p
     = (timeout < 0 ? NULL
        : &(struct __timespec64) { .tv_sec = timeout / 1000,
                                   .tv_nsec = timeout % 1000 * 1000000 });



More information about the Libc-alpha mailing list