diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-02-26 19:42:22 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-03-01 12:33:02 +0000 |
commit | 87fade88bd8471d0459a306255403e854122120e (patch) | |
tree | 1f090b3419983d8d08c72bfd67895f7fec679dd3 /include/osmocom/core | |
parent | 721aa6ded9c736e3cc5b20824dd58b1af4f4a907 (diff) |
timer: Introduce osmo_clock_gettime to override clock_gettime
Change-Id: I5bebc6e01fc9d238065bc2517058f0ba85620349
Diffstat (limited to 'include/osmocom/core')
-rw-r--r-- | include/osmocom/core/timer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index 4958efb3..caf4c678 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -40,6 +40,7 @@ #pragma once #include <sys/time.h> +#include <time.h> #include <stdbool.h> #include <osmocom/core/linuxlist.h> @@ -87,6 +88,7 @@ int osmo_timers_update(void); int osmo_timers_check(void); int osmo_gettimeofday(struct timeval *tv, struct timezone *tz); +int osmo_clock_gettime(clockid_t clk_id, struct timespec *tp); /* * timer override @@ -96,4 +98,8 @@ extern bool osmo_gettimeofday_override; extern struct timeval osmo_gettimeofday_override_time; void osmo_gettimeofday_override_add(time_t secs, suseconds_t usecs); +void osmo_clock_override_enable(clockid_t clk_id, bool enable); +void osmo_clock_override_add(clockid_t clk_id, time_t secs, long nsecs); +struct timespec *osmo_clock_override_gettimespec(clockid_t clk_id); + /*! @} */ |