From 87fade88bd8471d0459a306255403e854122120e Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 26 Feb 2018 19:42:22 +0100 Subject: timer: Introduce osmo_clock_gettime to override clock_gettime Change-Id: I5bebc6e01fc9d238065bc2517058f0ba85620349 --- include/osmocom/core/timer.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/osmocom/core') 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 +#include #include #include @@ -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); + /*! @} */ -- cgit v1.2.3