unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: YunQiang Su <yunqiang.su@cipunited.com>
To: libc-alpha@sourceware.org
Cc: syq@debian.org, YunQiang Su <yunqiang.su@cipunited.com>,
	jiaxun.yang@flygoat.com, aurelien@aurel32.net, macro@orcam.me.uk
Subject: [PATCH] Rename STAT_HAS_TIME32 to KERNEL_STAT64_HAS_TIME32
Date: Fri,  4 Nov 2022 09:54:28 +0800	[thread overview]
Message-ID: <20221104015428.1545677-1-yunqiang.su@cipunited.com> (raw)

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


             reply	other threads:[~2022-11-04  1:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  1:54 YunQiang Su [this message]
2022-11-04 10:02 ` [PATCH] Rename STAT_HAS_TIME32 to KERNEL_STAT64_HAS_TIME32 Arnd Bergmann
2022-11-07 18:08   ` Adhemerval Zanella Netto via Libc-alpha
2022-11-07 18:24     ` Arnd Bergmann
2022-11-07 18:45       ` Adhemerval Zanella Netto via Libc-alpha
2022-11-08 11:21         ` Arnd Bergmann
2022-11-08 12:04           ` Adhemerval Zanella Netto via Libc-alpha
2022-11-17 16:47 ` Adhemerval Zanella Netto via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221104015428.1545677-1-yunqiang.su@cipunited.com \
    --to=yunqiang.su@cipunited.com \
    --cc=aurelien@aurel32.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=macro@orcam.me.uk \
    --cc=syq@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).