Messages in this thread | | | Date | Wed, 04 Jun 2008 21:05:11 +0100 | From | Jeremy Fitzhardinge <> | Subject | Re: [PATCH 1/6] UML - Deal with host time going backwards |
| |
Jeff Dike wrote: > On Wed, Jun 04, 2008 at 03:31:58PM +0100, Jeremy Fitzhardinge wrote: > >> Shouldn't UML use a monotonic host clock for guest timekeeping? >> > > Indeed, Eric pointed out the posix timers, which I had forgotten > about. On the face of it, a monotonic timer should do the trick, but > it's not obvious how to get it to behave like a monotonic > gettimeofday...
You can either read the monotonic clock directly, or use it as a time source for a monotonic timer. clock_gettime(CLOCK_MONOTONIC, &ts) will return the time in ns, and you can just feed that directly into the guest as a clocksource.
J
| |