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/tests/timer/timer_test.c b/tests/timer/timer_test.c
index 1aeab45..6308113 100644
--- a/tests/timer/timer_test.c
+++ b/tests/timer/timer_test.c
@@ -87,7 +87,7 @@
 			fprintf(stderr, "timer_test: OOM!\n");
 			return;
 		}
-		gettimeofday(&v->start, NULL);
+		osmo_gettimeofday(&v->start, NULL);
 		v->timer.cb = secondary_timer_fired;
 		v->timer.data = v;
 		unsigned int seconds = (random() % 10) + 1;
@@ -108,7 +108,7 @@
 	struct test_timer *v = data, *this, *tmp;
 	struct timeval current, res, precision = { 1, 0 };
 
-	gettimeofday(&current, NULL);
+	osmo_gettimeofday(&current, NULL);
 
 	timersub(&current, &v->stop, &res);
 	if (timercmp(&res, &precision, >)) {