[PATCH v2 16/20] lib/cobalt: timerfd: 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-16-7caefce29bcd@siemens.com> |
Code movement only. Signed-off-by: Florian Bezdeka <[email protected]> --- lib/cobalt/timerfd.c | 39 --------------------------------------- lib/cobalt/wrappers_time64.c | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 40 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 138058b55adb0e735452c09a745920726dd6ec0f..cd7f05197dc3a9b8aca71d9e0a7468933a220ebf 100644 --- a/lib/cobalt/wrappers_time64.c +++ b/lib/cobalt/wrappers_time64.c @@ -2,7 +2,7 @@ /* * Copyright (C) 2026 Florian Bezdeka <[email protected]>. - * Copyright (C) 2010 Gilles Chanteperdrix <[email protected]>. + * Copyright (C) 2010, 2013 Gilles Chanteperdrix <[email protected]>. * Copyright (C) 2005 Philippe Gerum <[email protected]>. */ @@ -1051,3 +1051,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