[PATCH v2 14/20] lib/cobalt: signal: Move time64 related services to wrappers_time64.c

Florian Bezdeka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <20260302-wip-flo-fix-time64-32bit-native-v2-14-7caefce29bcd@siemens.com>
Code movement only.

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

diff --git a/lib/cobalt/signal.c b/lib/cobalt/signal.c
index 6e40a36803190ad05b7b4a1ce4fab9108b59c56d..b5c0865e95eb571f3bbf67ce29ffc73b9ddf11ef 100644
--- a/lib/cobalt/signal.c
+++ b/lib/cobalt/signal.c
@@ -16,12 +16,13 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
+#include <asm/xenomai/syscall.h>
+
 #include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <pthread.h>
 #include <signal.h>
-#include <asm/xenomai/syscall.h>
 
 COBALT_IMPL(int, sigwait, (const sigset_t *set, int *sig))
 {
@@ -53,29 +54,6 @@ COBALT_IMPL(int, sigwaitinfo, (const sigset_t *set, siginfo_t *si))
 	return ret;
 }
 
-COBALT_IMPL_TIME64(int, sigtimedwait, __sigtimedwait64,
-		   (const sigset_t *set, siginfo_t *si,
-		    const struct timespec *timeout))
-{
-	int ret, oldtype;
-
-	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
-
-#ifdef __USE_TIME_BITS64
-	ret = XENOMAI_SYSCALL3(sc_cobalt_sigtimedwait64, set, si, timeout);
-#else
-	ret = XENOMAI_SYSCALL3(sc_cobalt_sigtimedwait, set, si, timeout);
-#endif
-	if (ret < 0) {
-		errno = -ret;
-		ret = -1;
-	}
-
-	pthread_setcanceltype(oldtype, NULL);
-
-	return ret;
-}
-
 COBALT_IMPL(int, sigpending, (sigset_t *set))
 {
 	int ret;
diff --git a/lib/cobalt/wrappers_time64.c b/lib/cobalt/wrappers_time64.c
index fd5ee105aa03c1e9d5b3c80236aa3a789656bfda..42f8088922286ed991a8ba9bdb3f63c19e51a0ee 100644
--- a/lib/cobalt/wrappers_time64.c
+++ b/lib/cobalt/wrappers_time64.c
@@ -910,3 +910,26 @@ COBALT_IMPL_TIME64(int, sem_timedwait, __sem_timedwait64,
 
 	return 0;
 }
+
+COBALT_IMPL_TIME64(int, sigtimedwait, __sigtimedwait64,
+		   (const sigset_t *set, siginfo_t *si,
+		    const struct timespec *timeout))
+{
+	int ret, oldtype;
+
+	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
+
+#ifdef __USE_TIME_BITS64
+	ret = XENOMAI_SYSCALL3(sc_cobalt_sigtimedwait64, set, si, timeout);
+#else
+	ret = XENOMAI_SYSCALL3(sc_cobalt_sigtimedwait, set, si, timeout);
+#endif
+	if (ret < 0) {
+		errno = -ret;
+		ret = -1;
+	}
+
+	pthread_setcanceltype(oldtype, NULL);
+
+	return ret;
+}

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