[Openais] changing gettimeofday to times

Steven Dake sdake at redhat.com
Mon Nov 13 11:20:23 PST 2006


If the system time is changed while openais is running the timing system
gets all out of wack.  This is because gettimeofday returns the current
time, instead of the number of msec since boot and is used in the tlist
code.

There is a mechanism to determine the number of msec since boot which
appears to be portable.  The posix API is "times" which returns the
number of clock ticks since system boot.

The Linux man page says times returns a time value from some time in the
past but on linux this is the system boot time.

On BSD or Solaris, is this also the case?  I don't have the man pages to
check these systems and would like a portable solution.  The other
possibility is getitimer and setitimer or the posix timer_gettime
absolute time but I think these posix APIs are not supported on all
platforms.

Regards
-steve




More information about the Openais mailing list