Skip to content

Commit 0ff52df

Browse files
zhouzhouyi-hubt-8ch
authored andcommitted
tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers
Commit d5094bc ("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 94c467d ("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: d5094bc ("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>
1 parent ca38943 commit 0ff52df

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • tools/include/nolibc

tools/include/nolibc/std.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ typedef unsigned long nlink_t;
2929
typedef signed long off_t;
3030
typedef signed long blksize_t;
3131
typedef signed long blkcnt_t;
32-
typedef __kernel_old_time_t time_t;
32+
typedef __kernel_time_t time_t;
3333

3434
#endif /* _NOLIBC_STD_H */

0 commit comments

Comments
 (0)