From bdcfc417f26ffd1a7e214d1cce78500dc4dbc2d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sat, 20 Dec 2025 14:55:53 +0100 Subject: [PATCH] tools/nolibc: always use 64-bit time types MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 32-bit time types will stop working in 2038. Switch to 64-bit time types everywhere. Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/lkml/cec27d94-c99d-4c57-9a12-275ea663dda8@app.fastmail.com/ Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau Reviewed-by: Arnd Bergmann Link: https://patch.msgid.link/20251220-nolibc-uapi-types-v3-9-c662992f75d7@weissschuh.net --- tools/include/nolibc/std.h | 2 +- tools/include/nolibc/types.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/include/nolibc/std.h b/tools/include/nolibc/std.h index 392f4dd941588..b9a1161239025 100644 --- a/tools/include/nolibc/std.h +++ b/tools/include/nolibc/std.h @@ -29,6 +29,6 @@ typedef unsigned long nlink_t; typedef int64_t off_t; typedef signed long blksize_t; typedef signed long blkcnt_t; -typedef __kernel_time_t time_t; +typedef __kernel_time64_t time_t; #endif /* _NOLIBC_STD_H */ diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index c8ed4d9cae8a8..8f3cb18df7f1c 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -17,14 +17,15 @@ #include struct timespec { - __kernel_time_t tv_sec; - long tv_nsec; + time_t tv_sec; + int64_t tv_nsec; }; #define _STRUCT_TIMESPEC +/* Never use with system calls */ struct timeval { - __kernel_time_t tv_sec; - __kernel_suseconds_t tv_usec; + time_t tv_sec; + int64_t tv_usec; }; #define timeval __nolibc_kernel_timeval -- 2.47.3