summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorZhouyi Zhou <zhouzhouyi@gmail.com>2025-09-19 01:46:43 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-15 12:00:02 +0200
commitd7a3eb5931909d1f8e5b1af184d039c7956b2744 (patch)
treeab83d0c3437a884309593a064aeb66b40a829ff4 /tools
parent372a5b01da506433a8b39b02fcdc6446f29cc1a2 (diff)
downloadlinux-d7a3eb5931909d1f8e5b1af184d039c7956b2744.tar.gz
linux-d7a3eb5931909d1f8e5b1af184d039c7956b2744.tar.bz2
linux-d7a3eb5931909d1f8e5b1af184d039c7956b2744.zip
tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers
[ Upstream commit 0ff52df6b32a6b04a7c9dfe3d7a387aff215b482 ] Commit d5094bcb5bfd ("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 94c467ddb273 ("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: d5094bcb5bfd ("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>
Diffstat (limited to 'tools')
-rw-r--r--tools/include/nolibc/std.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/include/nolibc/std.h b/tools/include/nolibc/std.h
index a9d8b5b51f37..f24953f8b949 100644
--- a/tools/include/nolibc/std.h
+++ b/tools/include/nolibc/std.h
@@ -33,6 +33,6 @@ typedef unsigned long nlink_t;
typedef signed long off_t;
typedef signed long blksize_t;
typedef signed long blkcnt_t;
-typedef __kernel_old_time_t time_t;
+typedef __kernel_time_t time_t;
#endif /* _NOLIBC_STD_H */