[Olsr-users] 0.5.6 Routes disappear after 4 mins of uptime, then all OK - suspect clock sync

John Hay (spam-protected)
Tue Sep 2 21:16:27 CEST 2008


On Tue, Sep 02, 2008 at 07:24:01PM +0200, Bernd Petrovitsch wrote:
...
> Not really:
> gettimeofday(2) and time(2) return the current date+time (read: that
> what the device thinks it is) or some representation of it.
> The problem with that is that it is not continuous because
> ntp/ntpdate/rdate/the admin/daylight-saving-time/... may change speed
> and value at any time (and I purposely ignore leap seconds).
> These values are great for syslog and other time values which refer to
> the rest of the planet.
> 
> For timeouts in select/poll/sleep/timers in general one wants a steady
> clock without jumps. And times(2) is the only portable sys-call I know
> of.

What about clock_gettime(2)? According to the FreeBSD man page it is
part of IEEE Std 1003.1b-1993 (``POSIX.1'').

> BTW do we have requirements on precision?

clock_gettime(2) give down to nanosecond level, which should be ok for
a while I guess. :-)

> 
> > Maybe we could put a "olsr_time()" function into the machine specific
> > parts that results a sane and exact clock ?
> 
> Better is at least "olsr_times()" to not confuse it with time(2).

-- 
John Hay -- (spam-protected) / (spam-protected)




More information about the Olsr-users mailing list