Module: xenomai-3
Branch: next
Commit: 2fc2d7a19e1ae8fbc71c77f210389e8f9e1f2ddd
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2fc2d7a19e1ae8fbc71c77f210389e8f9e1f2ddd

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Feb 12 18:20:40 2018 +0100

lib/cobalt: add clock_adjtime() syscall

---

 include/cobalt/time.h      |    3 +++
 lib/cobalt/clock.c         |   15 +++++++++++++++
 lib/cobalt/cobalt.wrappers |    1 +
 3 files changed, 19 insertions(+)

diff --git a/include/cobalt/time.h b/include/cobalt/time.h
index fed8957..9bafe34 100644
--- a/include/cobalt/time.h
+++ b/include/cobalt/time.h
@@ -39,6 +39,9 @@ COBALT_DECL(int, clock_gettime(clockid_t clock_id,
 COBALT_DECL(int, clock_settime(clockid_t clock_id,
                               const struct timespec *tp));
 
+COBALT_DECL(int, clock_adjtime(clockid_t clock_id,
+                              struct timex *tx));
+
 COBALT_DECL(int, clock_nanosleep(clockid_t clock_id,
                                 int flags,
                                 const struct timespec *rqtp,
diff --git a/lib/cobalt/clock.c b/lib/cobalt/clock.c
index 7b4ef54..11fd1aa 100644
--- a/lib/cobalt/clock.c
+++ b/lib/cobalt/clock.c
@@ -246,6 +246,21 @@ COBALT_IMPL(int, clock_settime, (clockid_t clock_id, const 
struct timespec *tp))
        return 0;
 }
 
+/* @apitags{unrestricted} */
+
+COBALT_IMPL(int, clock_adjtime, (clockid_t clock_id, struct timex *tx))
+{
+       int ret;
+
+       ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_adjtime, clock_id, tx);
+       if (ret < 0) {
+               errno = ret;
+               return -1;
+       }
+
+       return ret;
+}
+
 /**
  * Sleep some amount of time.
  *
diff --git a/lib/cobalt/cobalt.wrappers b/lib/cobalt/cobalt.wrappers
index a0448bd..f63a170 100644
--- a/lib/cobalt/cobalt.wrappers
+++ b/lib/cobalt/cobalt.wrappers
@@ -25,6 +25,7 @@
 --wrap clock_getres
 --wrap clock_gettime
 --wrap clock_settime
+--wrap clock_adjtime
 --wrap clock_nanosleep
 --wrap nanosleep
 --wrap pthread_mutex_init


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to