[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <cec27d94-c99d-4c57-9a12-275ea663dda8@app.fastmail.com>
Date: Wed, 01 Oct 2025 09:43:37 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: Thomas Weißschuh <linux@...ssschuh.net>,
"Willy Tarreau" <w@....eu>, "Catalin Marinas" <catalin.marinas@....com>,
"Will Deacon" <will@...nel.org>, shuah <shuah@...nel.org>
Cc: "Mark Brown" <broonie@...nel.org>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH 1/7] tools/nolibc: remove __nolibc_enosys() fallback from
time64-related functions
On Thu, Aug 21, 2025, at 17:40, Thomas Weißschuh wrote:
> These fallbacks where added when no explicit fallbacks for time64 was
> implemented. Now that these fallbacks are in place, the additional
> fallback to __nolibc_enosys() is superfluous.
>
> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
Hi Thomas,
I just saw these fly by as they made it into mainline and
I noticed that there is still something wrong here:
> @@ -39,10 +39,8 @@ int sys_poll(struct pollfd *fds, int nfds, int
> timeout)
> t.tv_nsec = (timeout % 1000) * 1000000;
> }
> return my_syscall5(__NR_ppoll_time64, fds, nfds, (timeout >= 0) ? &t
> : NULL, NULL, 0);
> -#elif defined(__NR_poll)
> - return my_syscall3(__NR_poll, fds, nfds, timeout);
> #else
> - return __nolibc_enosys(__func__, fds, nfds, timeout);
> + return my_syscall3(__NR_poll, fds, nfds, timeout);
> #endif
> }
The change is fine, as there is always at least one of the
time64 or the old syscalls implemented, for any of the affected
calls.
However, the problem here is the default to the old time
types on 32-bit targets, for two reasons:
- this fails when turning off CONFIG_COMPAT_32BIT_TIME
- the old types are often too short, both for the y2038
overflow and for the file system types.
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.
The proper solution I think would be to do the same thing
that klibc has and use sane defaults for all the types
along with the modern syscalls. At least __kernel_time_t,
__kernel_timespec, __kernel_ino_t, __kernel_loff_t and
probably a few more. We should also consider drop the
legacy type definitions from uapi/linux/time.h and
require each libc to define their own.
Arnd
Powered by blists - more mailing lists