linux/tools/include/nolibc
Zhouyi Zhou ae7b1443f4 tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers
[ Upstream commit 0ff52df6b3 ]

Commit d5094bcb5b ("tools/nolibc: define time_t in terms of
__kernel_old_time_t") made nolibc use the kernel's time type so that
`time_t` matches `timespec::tv_sec` on all ABIs (notably x32).

But since __kernel_old_time_t is fairly new, notably from 2020 in commit
94c467ddb2 ("y2038: add __kernel_old_timespec and __kernel_old_time_t"),
nolibc builds that rely on host headers may fail.

Switch to __kernel_time_t, which is the same as __kernel_old_time_t and
has existed for longer.

Tested in PPC VM of Open Source Lab of Oregon State University
(./tools/testing/selftests/rcutorture/bin/mkinitrd.sh)

Fixes: d5094bcb5b ("tools/nolibc: define time_t in terms of __kernel_old_time_t")
Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
[Thomas: Reformat commit and its message a bit]
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-10-19 16:21:31 +02:00
..
arch-aarch64.h tools/nolibc: Remove .global _start from the entry point code 2023-01-18 11:48:56 +01:00
arch-arm.h tools/nolibc: Remove .global _start from the entry point code 2023-01-18 11:48:56 +01:00
arch-i386.h tools/nolibc: Remove .global _start from the entry point code 2023-01-18 11:48:56 +01:00
arch-mips.h tools/nolibc: restore mips branch ordering in the _start block 2023-01-18 11:48:56 +01:00
arch-riscv.h tools/nolibc: fix the O_* fcntl/open macro definitions for riscv 2023-01-18 11:48:56 +01:00
arch-x86_64.h tools/nolibc: Remove .global _start from the entry point code 2023-01-18 11:48:56 +01:00
arch.h tools/nolibc/arch: split arch-specific code into individual files 2023-01-18 11:48:55 +01:00
nolibc.h tools/nolibc/arch: split arch-specific code into individual files 2023-01-18 11:48:55 +01:00
std.h tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers 2025-10-19 16:21:31 +02:00
types.h tools/nolibc/types: split syscall-specific definitions into their own files 2023-01-18 11:48:55 +01:00