[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <b554958d-1f38-4d61-8378-ce784c2bb188@app.fastmail.com>
Date: Tue, 07 Oct 2025 12:03:37 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: Thomas Weißschuh <linux@...ssschuh.net>
Cc: "Willy Tarreau" <w@....eu>, "Catalin Marinas" <catalin.marinas@....com>,
"Will Deacon" <will@...nel.org>, shuah <shuah@...nel.org>,
"Mark Brown" <broonie@...nel.org>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kselftest@...r.kernel.org,
Linux-Arch <linux-arch@...r.kernel.org>, linux-api@...r.kernel.org
Subject: Re: [PATCH 1/7] tools/nolibc: remove __nolibc_enosys() fallback from
time64-related functions
On Mon, Oct 6, 2025, at 22:14, Thomas Weißschuh wrote:
> On 2025-10-01 09:43:37+0200, Arnd Bergmann wrote:
>> On Thu, Aug 21, 2025, at 17:40, Thomas Weißschuh wrote:
>> - the old types are often too short, both for the y2038
>> overflow and for the file system types.
>
> So far this was not something we actively tried to support,
> especially with the restriction mentioned below.
>
>> I suspect the problem is that the kernel's uapi/linux/time.h
>> still defines the old types as the default, and nolibc
>> historically just picks it up from there.
>
> So far we have tried to keep nolibc compatible with the kernel UAPI when
> included in any order. This forced us to use 'struct timespec' from
> uapi/linux/time.h. With the upcoming implementation of signals in nolibc
> this guideline is relaxed a bit, so we should be able to use our own
> always-64-bit 'struct timespec'.
You can probably either "#define timespec __kernel_timespec" or
"#define __kernel_timespec timespec" before including
linux/time_types.h.
Note that there is no time64 variant of "struct timeval", so
any syscall that needs this has to be implemented in userspace
as a wrapper around the timespec based one, e.g. gettimeofday()
needs to call clock_gettime() on all 32-bit systems.
>> We should also consider drop the
>> legacy type definitions from uapi/linux/time.h and
>> require each libc to define their own.
>
> Can we even just drop them? Or should they also get some backwards
> compat guards?
This is the big question, and we kind of left this one open
to be decided later when we finished the actual binary interface.
I think simply dropping the old definition is one of several
options we have, because that does not change the ABI in an
incompatible way and just requires the few user space sources
that use this to either require old kernel headers or make
simple source-level changes that they should have done for
portability anyway.
I see multiple decisions we have to make in that option space
once we decide to do anything:
- do we change the headers for both 32-bit and 64-bit userspace
for consistency, or only for 32-bit userspace to limit
the impact to those users that care about 32-bit?
- do we remove only the type definitions (timespec, timeval,
itimerspec, itimerval, timex) or also the syscall macros
for the time32 syscalls using them?
- What method (if any) would be used to choose between the
time32 definitions, the time64 definitions or none of them
when including the kernel headers?
Arnd
Powered by blists - more mailing lists