From f5aa863aea6c1ec20b85cc0b0a22e99597f0cb50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sat, 20 Dec 2025 14:55:52 +0100 Subject: [PATCH] tools/nolibc: use custom structs timespec and timeval MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A custom 'struct timespec' and 'struct timeval' will be necessary for 64-bit time types on 32-bit architectures. will define other time-related types in terms of the custom 'struct timespec'. Add custom struct definitions which for now mirror exactly the ones from the UAPI headers, but provide the foundation for further changes. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau Reviewed-by: Arnd Bergmann Link: https://patch.msgid.link/20251220-nolibc-uapi-types-v3-8-c662992f75d7@weissschuh.net --- tools/include/nolibc/arch-s390.h | 3 +++ tools/include/nolibc/types.h | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s390.h index 74125a254ce3b..5bee6ecbde0af 100644 --- a/tools/include/nolibc/arch-s390.h +++ b/tools/include/nolibc/arch-s390.h @@ -5,6 +5,9 @@ #ifndef _NOLIBC_ARCH_S390_H #define _NOLIBC_ARCH_S390_H + +#include "types.h" + #include #include diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index 470a5f77bc0fe..c8ed4d9cae8a8 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -13,9 +13,23 @@ #include "std.h" #include #include -#include +#include #include +struct timespec { + __kernel_time_t tv_sec; + long tv_nsec; +}; +#define _STRUCT_TIMESPEC + +struct timeval { + __kernel_time_t tv_sec; + __kernel_suseconds_t tv_usec; +}; + +#define timeval __nolibc_kernel_timeval +#include +#undef timeval /* Only the generic macros and types may be defined here. The arch-specific * ones such as the O_RDONLY and related macros used by fcntl() and open() -- 2.47.3