lkml.org 
[lkml]   [2008]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-06-04 22:09    [W:0.639 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site