public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Rename STAT_HAS_TIME32 to KERNEL_STAT64_HAS_TIME32
@ 2022-11-04  1:54 YunQiang Su
  2022-11-04 10:02 ` Arnd Bergmann
  2022-11-17 16:47 ` Adhemerval Zanella Netto
  0 siblings, 2 replies; 8+ messages in thread
From: YunQiang Su @ 2022-11-04  1:54 UTC (permalink / raw)
  To: libc-alpha
  Cc: aurelien, adhemerval.zanella, jiaxun.yang, macro, syq, YunQiang Su

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.
---
 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
-- 
2.30.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-17 16:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04  1:54 [PATCH] Rename STAT_HAS_TIME32 to KERNEL_STAT64_HAS_TIME32 YunQiang Su
2022-11-04 10:02 ` Arnd Bergmann
2022-11-07 18:08   ` Adhemerval Zanella Netto
2022-11-07 18:24     ` Arnd Bergmann
2022-11-07 18:45       ` Adhemerval Zanella Netto
2022-11-08 11:21         ` Arnd Bergmann
2022-11-08 12:04           ` Adhemerval Zanella Netto
2022-11-17 16:47 ` Adhemerval Zanella Netto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).