]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/nolibc: use custom structs timespec and timeval
authorThomas Weißschuh <linux@weissschuh.net>
Sat, 20 Dec 2025 13:55:52 +0000 (14:55 +0100)
committerThomas Weißschuh <linux@weissschuh.net>
Sun, 4 Jan 2026 09:29:02 +0000 (10:29 +0100)
A custom 'struct timespec' and 'struct timeval' will be necessary for
64-bit time types on 32-bit architectures. <linux/time.h> 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 <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20251220-nolibc-uapi-types-v3-8-c662992f75d7@weissschuh.net
tools/include/nolibc/arch-s390.h
tools/include/nolibc/types.h

index 74125a254ce3b48ccc76af37a8d0d07a55456f25..5bee6ecbde0af77840934288d0ddf1d7e538a2c2 100644 (file)
@@ -5,6 +5,9 @@
 
 #ifndef _NOLIBC_ARCH_S390_H
 #define _NOLIBC_ARCH_S390_H
+
+#include "types.h"
+
 #include <linux/signal.h>
 #include <linux/unistd.h>
 
index 470a5f77bc0feaae09a70fb40c574cfe6bb21fac..c8ed4d9cae8a8e616ed900dbdd84f1ef66f6df21 100644 (file)
 #include "std.h"
 #include <linux/mman.h>
 #include <linux/stat.h>
-#include <linux/time.h>
+#include <linux/time_types.h>
 #include <linux/wait.h>
 
+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 <linux/time.h>
+#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()