aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-10-20 12:48:04 +0200
committerHarald Welte <laforge@gnumonks.org>2017-10-23 17:53:11 +0000
commit1fa8dfbaf42a4341255b3bbef3c8a3c574e8c477 (patch)
tree9e6da064c7cf387e753e9e536344a602d5f6b190
parent4b45669761234ff23769c4d376b04b3003d4bea9 (diff)
Expand osmo_gettimeofday() docs
-rw-r--r--src/timer_gettimeofday.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/timer_gettimeofday.c b/src/timer_gettimeofday.c
index 1bf714e..4298805 100644
--- a/src/timer_gettimeofday.c
+++ b/src/timer_gettimeofday.c
@@ -33,7 +33,13 @@ struct timeval osmo_gettimeofday_override_time = { 23, 424242 };
/*! shim around gettimeofday to be able to set the time manually.
* To override, set osmo_gettimeofday_override == true and set the desired
- * current time in osmo_gettimeofday_override_time. */
+ * current time in osmo_gettimeofday_override_time.
+ *
+ * N. B: gettimeofday() is affected by discontinuous jumps in the system time
+ * (e.g., if the system administrator manually changes the system time).
+ * Hence this should NEVER be used for elapsed time computation.
+ * Instead, clock_gettime(CLOCK_MONOTONIC, ..) should be used for that (with similar shim if necessary).
+ */
int osmo_gettimeofday(struct timeval *tv, struct timezone *tz)
{
if (osmo_gettimeofday_override) {