[PATCH 16/20] lib/cobalt: timerfd: Move time64 related services to wrappers_time64.c

Florian Bezdeka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <20260220-wip-flo-fix-time64-32bit-native-v1-16-731c773e72cc@siemens.com>
Code movement only.

Signed-off-by: Florian Bezdeka <[email protected]>
---
 lib/cobalt/timerfd.c         | 39 ---------------------------------------
 lib/cobalt/wrappers_time64.c | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/lib/cobalt/timerfd.c b/lib/cobalt/timerfd.c
index 70e9a4e0743d503bb4b57d17ed7c77713bebf946..5fa1f1eaa3902293c81600431fb2d97557c671d2 100644
--- a/lib/cobalt/timerfd.c
+++ b/lib/cobalt/timerfd.c
@@ -17,7 +17,6 @@
  */
 
 #include <errno.h>
-#include <unistd.h>
 #include <sys/timerfd.h>
 #include <asm/xenomai/syscall.h>
 #include "internal.h"
@@ -35,41 +34,3 @@ COBALT_IMPL(int, timerfd_create, (int clockid, int flags))
 	return fd;
 }
 
-COBALT_IMPL_TIME64(int, timerfd_settime, __timerfd_settime64,
-		   (int fd, int flags, const struct itimerspec *new_value,
-		    struct itimerspec *old_value))
-{
-	int ret;
-
-#ifdef XN_USE_TIME64_SYSCALL
-	long sc_nr = sc_cobalt_timerfd_settime64;
-#else
-	long sc_nr = sc_cobalt_timerfd_settime;
-#endif
-
-	ret = -XENOMAI_SYSCALL4(sc_nr, fd, flags, new_value, old_value);
-	if (ret == 0)
-		return ret;
-	
-	errno = ret;
-	return -1;
-}
-
-COBALT_IMPL_TIME64(int, timerfd_gettime, __timerfd_gettime64,
-		   (int fd, struct itimerspec *curr_value))
-{
-	int ret;
-
-#ifdef XN_USE_TIME64_SYSCALL
-	long sc_nr = sc_cobalt_timerfd_gettime64;
-#else
-	long sc_nr = sc_cobalt_timerfd_gettime;
-#endif
-
-	ret = -XENOMAI_SYSCALL2(sc_nr, fd, curr_value);
-	if (ret == 0)
-		return ret;
-	
-	errno = ret;
-	return -1;
-}
diff --git a/lib/cobalt/wrappers_time64.c b/lib/cobalt/wrappers_time64.c
index b4714f22ce3d632cf11456838854df9093b83902..bcb954c1f85b93f24ceb59999e57e4c935b2171f 100644
--- a/lib/cobalt/wrappers_time64.c
+++ b/lib/cobalt/wrappers_time64.c
@@ -1043,3 +1043,42 @@ COBALT_IMPL_TIME64(int, timer_gettime, __timer_gettime64,
 
 	return -1;
 }
+
+COBALT_IMPL_TIME64(int, timerfd_settime, __timerfd_settime64,
+		   (int fd, int flags, const struct itimerspec *new_value,
+		    struct itimerspec *old_value))
+{
+	int ret;
+
+#ifdef XN_USE_TIME64_SYSCALL
+	long sc_nr = sc_cobalt_timerfd_settime64;
+#else
+	long sc_nr = sc_cobalt_timerfd_settime;
+#endif
+
+	ret = -XENOMAI_SYSCALL4(sc_nr, fd, flags, new_value, old_value);
+	if (ret == 0)
+		return ret;
+
+	errno = ret;
+	return -1;
+}
+
+COBALT_IMPL_TIME64(int, timerfd_gettime, __timerfd_gettime64,
+		   (int fd, struct itimerspec *curr_value))
+{
+	int ret;
+
+#ifdef XN_USE_TIME64_SYSCALL
+	long sc_nr = sc_cobalt_timerfd_gettime64;
+#else
+	long sc_nr = sc_cobalt_timerfd_gettime;
+#endif
+
+	ret = -XENOMAI_SYSCALL2(sc_nr, fd, curr_value);
+	if (ret == 0)
+		return ret;
+
+	errno = ret;
+	return -1;
+}

-- 
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.