use Boottime clock on linux
authorJoey Hess <joeyh@joeyh.name>
Wed, 3 Jul 2024 22:44:38 +0000 (18:44 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 3 Jul 2024 22:44:38 +0000 (18:44 -0400)
commite9bd03fc4b21c4cb06e79403c83a35c29a19c7cd
tree14c6b3439dd11092c8f4e9b213477d1536304372
parent5b6150e5d57e2010b27237836c5bf9aafe70bebf
use Boottime clock on linux

Better to advance while suspended, that way a stale content retention
lock will expire while suspended.

The fallback the Monotonic to support older kernels assumes that there
are not systems where Boottime sometimes succeeds and sometimes fails.
If that ever happened, the clock would probably not monotonically
advance as it read from different clocks on different calls! I don't see
any indication in clock_gettime(2) errono list that it can fail
intermittently so probably this is ok.
Utility/MonotonicClock.hs