[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <ebf493ee-1e8b-426d-bcf4-d8e17d10844a@app.fastmail.com>
Date: Wed, 15 May 2024 14:25:28 +0000
From: "Arnd Bergmann" <arnd@...db.de>
To: "Bibo Mao" <maobibo@...ngson.cn>, "Huacai Chen" <chenhuacai@...ngson.cn>,
"Huacai Chen" <chenhuacai@...nel.org>
Cc: loongarch@...ts.linux.dev, Linux-Arch <linux-arch@...r.kernel.org>,
"Xuefeng Li" <lixuefeng@...ngson.cn>, guoren <guoren@...nel.org>,
"WANG Xuerui" <kernel@...0n.name>, "Jiaxun Yang" <jiaxun.yang@...goat.com>,
linux-kernel@...r.kernel.org, loongson-kernel@...ts.loongnix.cn,
stable@...r.kernel.org
Subject: Re: [PATCH] LoongArch: Define __ARCH_WANT_NEW_STAT in unistd.h
On Wed, May 15, 2024, at 09:30, maobibo wrote:
> On 2024/5/11 下午8:17, Arnd Bergmann wrote:
>> On Sat, May 11, 2024, at 12:01, Huacai Chen wrote:
>>
>> Importantly, we can't just add fstatat64() on riscv32 because
>> there is no time64 version for it other than statx(), and I don't
>> want the architectures to diverge more than necessary.
> yes, I agree. Normally there is newfstatat() on 64-bit architectures but
> fstatat64() on 32-bit ones.
>
> I do not understand why fstatat64() can be added for riscv32 still.
> 32bit timestamp seems works well for the present, it is valid until
> (0x1UL << 32) / 365 / 24 / 3600 + 1970 == 2106 year. Year 2106 should
> be enough for 32bit system.
There is a very small number of interfaces for which we ended up
not using a 64-bit time_t replacement, but those are only for
relative times, not epoch based offsets. The main problems
here are:
- time_t is defined to be a signed value in posix, and we need
to handle file timestamps before 1970 in stat(), so changing
this one to be unsigned is not an option.
- A lot of products have already shipped that will have to
be supported past 2038 on existing 32-bit hardware. We
cannot regress on architectures that have already been
fixed to support this.
- file timestamps can also be set into the future, so applications
relying on this are broken before 2038.
Arnd
Powered by blists - more mailing lists