I have been looking for an answer to this one but no clear documentation yet.
The CLOCK_MONOTONIC
from clock_gettime
man page says that it's affected by incremental adjustments performed by adjtime
and NTP
CLOCK_MONOTONIC
Clock that cannot be set and represents monotonic time since some unspecified starting point. This clock is not affected by discontinuous jumps in the system time (e.g., if the system administrator manually changes the clock), but is affected by the incremental adjustments performed by adjtime(3) and NTP
What is not clear to me is that is it affected by all sorts of adjustments made by NTP or just the small adjustements ?
Say if there is a big time jump made by NTP, if the system was way off the clock, will CLOCK_MONOTONIC
reflect that ?
I am not sure which of the following system calls NTP makes to adjust the time on my Cent OS system
A quick test showed no change in monotonic clock output even though NTP made the system jump by 10 hours.
Even making the time jump by clock_settime
call didn't affect MONOTONIC time