cloudius-systems / osv

OSv, a new operating system for the cloud.
osv.io
Other
4.12k stars 605 forks source link

clock_gettime: support CLOCK_MONOTONIC_COARSE and CLOCK_MONOTONIC_RAW #1251

Closed wkozaczuk closed 1 year ago

wkozaczuk commented 1 year ago

Newer versions of Linux kernel implement specific versions of the monotonic clock and some applications especially statically linked executables or glibc rely on them. This patch makes OSv pretend it implements both CLOCK_MONOTONIC_COARSE and CLOCK_MONOTONIC_RAW by using the same implementation as CLOCK_MONOTONIC.

This patch also enhances clock_getres() to support CLOCK_MONOTONIC_COARSE, CLOCK_MONOTONIC_RAW and CLOCK_BOOTTIME.