linux/tools/include
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
..
asm tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' 2021-05-10 09:01:00 -03:00
asm-generic hugetlb_encode.h: fix undefined behaviour (34 << 26) 2024-07-05 09:14:23 +02:00
linux XArray: Add calls to might_alloc() 2025-08-28 16:24:13 +02:00
nolibc tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers 2025-10-19 16:21:31 +02:00
tools tools include: add dis-asm-compat.h to handle version differences 2023-03-17 08:49:04 +01:00
trace/events tools/lib/lockdep: Remove private kernel headers 2017-06-05 09:28:14 +02:00
uapi bpf: Fix L4 csum update on IPv6 in CHECKSUM_COMPLETE 2025-06-27 11:05:38 +01:00
vdso tools headers: Synchronize linux/bits.h with the kernel sources 2020-04-14 11:40:05 -03:00