Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

CLOCK_MONOTONIC is affected by NTP skewing but should still always increase monotonically (i.e. never decrease)


What happens if someone makes an honest mistake (or is just malicious) and makes their NTP server run fast?


It's system dependent but Linux will generally speed up or slow down the time advancement until the delta from adjtime(...) matches up:

https://linux.die.net/man/2/clock_gettime

   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.
https://linux.die.net/man/3/adjtime

   If the adjustment in delta is positive, then the system clock is speeded up by some small percentage (i.e., by adding a small amount of time to the clock value in each second) until the adjustment has been completed. If the adjustment in delta is negative, then the clock is slowed down in a similar fashion.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: