add osmo_gettimeofday as a shim around gettimeofday

This allows feeding a custom time for unit tests by overriding
osmo_gettimeofday.

Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h
index 6730bfe..dbda13f 100644
--- a/include/osmocom/core/timer.h
+++ b/include/osmocom/core/timer.h
@@ -29,6 +29,7 @@
 #pragma once
 
 #include <sys/time.h>
+#include <stdbool.h>
 
 #include <osmocom/core/linuxlist.h>
 #include <osmocom/core/linuxrbtree.h>
@@ -83,4 +84,14 @@
 int osmo_timers_update(void);
 int osmo_timers_check(void);
 
+int osmo_gettimeofday(struct timeval *tv, struct timezone *tz);
+
+/**
+ * timer override
+ */
+
+extern bool osmo_gettimeofday_override;
+extern struct timeval osmo_gettimeofday_override_time;
+void osmo_gettimeofday_override_add(time_t secs, suseconds_t usecs);
+
 /*! @} */