[MERGED] libosmocore[master]: Expand osmo_gettimeofday() docs

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Oct 23 17:53:11 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: Expand osmo_gettimeofday() docs
......................................................................


Expand osmo_gettimeofday() docs

Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c
Related: OS#2586
---
M src/timer_gettimeofday.c
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
 
 /*! 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) {

-- 
To view, visit https://gerrit.osmocom.org/4367
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list