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@weissschuh.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