[BRLTTY] gettimeofday
Dave Mielke
dave at mielke.cc
Mon Jun 18 09:20:56 EDT 2012
[quoted lines by Vladimir 'φ-coder/phcoder' Serbinenko on 2012/06/18 at 14:39 +0200]
>Previously it was discussed how to make an equivalent of gettimeofday to
>work on GRUB.
Yes. You may wish to check timing:getCurrentTime() to see if we got it right
for grub.
>Now, I've realized that the current code using gettimeofday is wrong since the
>date gives no guaranty of being monotonic, and especially it isn't if someone
>runs "date" or "ntpdate" which is common operation, especially on systems
>where the RTC battery is failing.
And during daylight saving time switches. :-)
>brltty should use time/gettimeofday only for timestamping logs and
>CLOCK_MONOTONIC (probably with some wrapper to make other monotonic clock
>sources easy to add) for all timing and timeout purposes.
Yes, thanks, for timeouts that's an excellent point. I doubt CLOCK_MONOTONIC
existed way back whenever, but, yes, we really should fix this. We can always
code the current method as a fallback for builds on old systems.
What should we be using within the Grub environment for this?
--
Dave Mielke | 2213 Fox Crescent | The Bible is the very Word of God.
Phone: 1-613-726-0014 | Ottawa, Ontario | 2011 May 21 is the End of Salvation.
EMail: dave at mielke.cc | Canada K2A 1H7 | http://Mielke.cc/now.html
http://FamilyRadio.com/ | http://Mielke.cc/bible/
More information about the BRLTTY
mailing list