[PATCH] Rename STAT_HAS_TIME32 to KERNEL_STAT64_HAS_TIME32

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Thu Nov 17 16:47:04 GMT 2022



On 03/11/22 22:54, YunQiang Su wrote:
> The macro name STAT_HAS_TIME32 is not so clear.
> 
> This macro is used for some arch like MIPSn64.
> The kernel_stat/kernel_stat64 of it has a 32bit unsigned time value.
> Thus that has y2106 problem.
> So we should statx to solve this problem.

I am not seeing much gain in this refactor, it is only an internal define
used once and on its definition it already states the problem (and the 
y2106 issue is already stated in 5b980d48099130).  I prefer to keep current
macro so keep git history simpler.

> ---
>  sysdeps/unix/sysv/linux/fstatat64.c        | 2 +-
>  sysdeps/unix/sysv/linux/mips/kernel_stat.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
> index 8b1a1a290d..532b9beb67 100644
> --- a/sysdeps/unix/sysv/linux/fstatat64.c
> +++ b/sysdeps/unix/sysv/linux/fstatat64.c
> @@ -42,7 +42,7 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
>  
>  #if (__WORDSIZE == 32 \
>       && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
> -     || defined STAT_HAS_TIME32 \
> +     || defined KERNEL_STAT64_HAS_TIME32 \
>       || (!defined __NR_newfstatat && !defined __NR_fstatat64)
>  # define FSTATAT_USE_STATX 1
>  
> diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
> index 19524f7ea4..044adfb8df 100644
> --- a/sysdeps/unix/sysv/linux/mips/kernel_stat.h
> +++ b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
> @@ -69,7 +69,7 @@ struct kernel_stat
>  #endif
>  /* MIPS64 has unsigned 32 bit timestamps fields, so use statx as well.  */
>  #if _MIPS_SIM == _ABI64
> -# define STAT_HAS_TIME32
> +# define KERNEL_STAT64_HAS_TIME32
>  #endif
>  
>  #endif


More information about the Libc-alpha mailing list