[PATCH 01/18] Use 64 bit time_t stat internally

Florian Weimer fweimer@redhat.com
Tue Jun 22 19:37:45 GMT 2021


* Adhemerval Zanella via Libc-alpha:

> diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
> index b7e1aee80f..b2831508c4 100644
> --- a/sysdeps/posix/getaddrinfo.c
> +++ b/sysdeps/posix/getaddrinfo.c
> @@ -1636,16 +1636,17 @@ static int gaiconf_reload_flag_ever_set;
>  /* Last modification time.  */
>  #ifdef _STATBUF_ST_NSEC
>  
> -static struct timespec gaiconf_mtime;
> +static struct __timespec64 gaiconf_mtime;
>  
>  static inline void
> -save_gaiconf_mtime (const struct stat64 *st)
> +save_gaiconf_mtime (const struct __stat64_t64 *st)
>  {
> -  gaiconf_mtime = st->st_mtim;
> +  gaiconf_mtime = (struct __timespec64) { .tv_sec  = st->st_mtim.tv_sec,
> +					  .tv_nsec = st->st_mtim.tv_nsec };
>  }
>  
>  static inline bool
> -check_gaiconf_mtime (const struct stat64 *st)
> +check_gaiconf_mtime (const struct __stat64_t64 *st)
>  {
>    return (st->st_mtim.tv_sec == gaiconf_mtime.tv_sec
>            && st->st_mtim.tv_nsec == gaiconf_mtime.tv_nsec);
> @@ -1656,13 +1657,13 @@ check_gaiconf_mtime (const struct stat64 *st)
>  static time_t gaiconf_mtime;
>  
>  static inline void
> -save_gaiconf_mtime (const struct stat64 *st)
> +save_gaiconf_mtime (const struct __stat64_t64 *st)
>  {
>    gaiconf_mtime = st->st_mtime;
>  }
>  

Apparently this caused:

../sysdeps/posix/getaddrinfo.c: In function ‘save_gaiconf_mtime’:
../sysdeps/posix/getaddrinfo.c:1644:19: error: incompatible types when assigning to type ‘struct __timespec64’ from type ‘struct timespec’
 1644 |   gaiconf_mtime = st->st_mtim;
      |                   ^~

I do not know the state of 64-bit time_t on Hurd.

Thanks,
Florian



More information about the Libc-alpha mailing list