Waking systems from suspend
Posted Mar 18, 2011 3:49 UTC (Fri) by kevinm
Parent article: Waking systems from suspend
Stopping CLOCK_MONOTONIC during suspend was a mistake - it should always have had the semantics described for CLOCK_BOOTTIME. POSIX is *very* clear on this:
If the Monotonic Clock option is supported, all implementations shall support a clock_id of CLOCK_MONOTONIC defined in <time.h>. This clock represents the monotonic clock for the system. For this clock, the value returned by clock_gettime() represents the amount of time (in seconds and nanoseconds) since an unspecified point in the past (for example, system start-up time, or the Epoch). This point does not change after system start-up time. The value of the CLOCK_MONOTONIC clock cannot be set via clock_settime(). This function shall fail if it is invoked with a clock_id argument of CLOCK_MONOTONIC.
The most common use of CLOCK_MONOTONIC is to determine the time that has elapsed between two events. With the current Linux CLOCK_MONOTONIC, this will give an incorrect result if system suspend happens between the two events.
to post comments)