From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Willy Tarreau <w@1wt.eu>, Shuah Khan <shuah@kernel.org>
Cc: "Arnd Bergmann" <arnd@arndb.de>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH 09/12] tools/nolibc: use a custom struct timespec
Date: Wed, 29 Oct 2025 17:02:59 +0100 [thread overview]
Message-ID: <20251029-nolibc-uapi-types-v1-9-e79de3b215d8@weissschuh.net> (raw)
In-Reply-To: <20251029-nolibc-uapi-types-v1-0-e79de3b215d8@weissschuh.net>
A custom 'struct timespec' 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 definition.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/include/nolibc/arch-s390.h | 3 +++
tools/include/nolibc/types.h | 9 ++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s390.h
index 6237211385c0..1e87ac42ab9c 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 <linux/signal.h>
#include <linux/unistd.h>
diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index 16c6e9ec9451..4f5a25567e5c 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -13,9 +13,16 @@
#include "std.h"
#include <linux/mman.h>
#include <linux/stat.h>
-#include <linux/time.h>
#include <linux/wait.h>
+struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+};
+#define _STRUCT_TIMESPEC
+
+#include <linux/time.h>
+
/* 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.51.1.dirty
next prev parent reply other threads:[~2025-10-29 16:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 16:02 [PATCH 00/12] tools/nolibc: always use 64-bit ino_t, off_t and time-related types Thomas Weißschuh
2025-10-29 16:02 ` [PATCH 01/12] tools/nolibc: use 64-bit ino_t Thomas Weißschuh
2025-10-29 16:02 ` [PATCH 02/12] tools/nolibc: handle 64-bit off_t for llseek Thomas Weißschuh
2025-10-30 14:56 ` Arnd Bergmann
2025-10-29 16:02 ` [PATCH 03/12] tools/nolibc: prefer the llseek syscall Thomas Weißschuh
2025-10-29 16:02 ` [PATCH 04/12] tools/nolibc: use 64-bit off_t Thomas Weißschuh
2025-10-29 16:02 ` [PATCH 05/12] tools/nolibc: remove now superfluous overflow check in llseek Thomas Weißschuh
2025-10-30 14:58 ` Arnd Bergmann
2025-10-29 16:02 ` [PATCH 06/12] tools/nolibc: remove more __nolibc_enosys() fallbacks Thomas Weißschuh
2025-10-29 16:02 ` [PATCH 07/12] tools/nolibc: prefer explicit 64-bit time-related system calls Thomas Weißschuh
2025-10-30 14:44 ` Arnd Bergmann
2025-10-29 16:02 ` [PATCH 08/12] tools/nolibc: gettimeofday(): avoid libgcc 64-bit divisions Thomas Weißschuh
2025-10-30 14:57 ` Arnd Bergmann
2025-11-02 8:31 ` Willy Tarreau
2025-11-02 9:27 ` Thomas Weißschuh
2025-11-02 9:49 ` Willy Tarreau
2025-10-29 16:02 ` Thomas Weißschuh [this message]
2025-10-30 14:46 ` [PATCH 09/12] tools/nolibc: use a custom struct timespec Arnd Bergmann
2025-11-02 8:36 ` Willy Tarreau
2025-11-02 8:40 ` Willy Tarreau
2025-11-02 9:41 ` Thomas Weißschuh
2025-11-02 9:50 ` Willy Tarreau
2025-10-29 16:03 ` [PATCH 10/12] tools/nolibc: always use 64-bit time types Thomas Weißschuh
2025-10-29 16:03 ` [PATCH 11/12] selftests/nolibc: test compatibility of timespec and __kernel_timespec Thomas Weißschuh
2025-10-29 16:03 ` [PATCH 12/12] tools/nolibc: remove time conversions Thomas Weißschuh
2025-10-30 14:58 ` Arnd Bergmann
2025-11-02 8:44 ` [PATCH 00/12] tools/nolibc: always use 64-bit ino_t, off_t and time-related types Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251029-nolibc-uapi-types-v1-9-e79de3b215d8@weissschuh.net \
--to=linux@weissschuh.net \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®