[PATCH v2 05/20] lib/cobalt: Introduce wrappers_time64.c

Florian Bezdeka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <20260302-wip-flo-fix-time64-32bit-native-v2-5-7caefce29bcd@siemens.com>
All COBALT_IMPL_TIME64() services will be moved afterwards - step by
step - into the newly introduced wrappers_time64.c. At the end that
should allow us to compile libcobalt with time64_t support leaving
the native time_t services in place.

Currently, all native time_t services are replaced by the 64 bit
variants. That is OK as long as applications are rebuild after
libcobalt, but we try to remove this limitation now.

Signed-off-by: Florian Bezdeka <[email protected]>
---
 lib/cobalt/Makefile.am       |  3 ++-
 lib/cobalt/wrappers_time64.c | 12 ++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/cobalt/Makefile.am b/lib/cobalt/Makefile.am
index 0a8041dc30efae3eebacd376ac72f4b317f621b3..68900c35104ff9bd94d1cb7534dfdc10b9795a18 100644
--- a/lib/cobalt/Makefile.am
+++ b/lib/cobalt/Makefile.am
@@ -43,7 +43,8 @@ libcobalt_la_SOURCES =		\
 	timerfd.c		\
 	trace.c			\
 	umm.c			\
-	wrappers.c
+	wrappers.c		\
+	wrappers_time64.c
 
 libcobalt_la_CPPFLAGS =			\
 	@XENO_COBALT_CFLAGS@		\
diff --git a/lib/cobalt/wrappers_time64.c b/lib/cobalt/wrappers_time64.c
new file mode 100644
index 0000000000000000000000000000000000000000..6ae0c6d162b4cd1468d30ea46e6da6bb14e3c174
--- /dev/null
+++ b/lib/cobalt/wrappers_time64.c
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: LGPL-2.0-or-later
+
+/*
+ * Copyright (C) 2026 Florian Bezdeka <[email protected]>.
+ */
+
+/*
+ * Magic ahead:
+ * This file is compiled twice in case y2038/time64_t support is necessary
+ * and requested. The first time with time64_t and a second time with native
+ * time_t.
+ */

-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.