[CRIU] [PATCH 2/2] timerfd: add support for CLOCK_BOOTTTIME

Tycho Andersen tycho.andersen at canonical.com
Thu Oct 6 15:27:57 PDT 2016


>From https://lwn.net/Articles/428176/:

"CLOCK_BOOTTIME is identical to CLOCK_MONOTONIC, except it also
includes any time spent in suspend (as currently measured by
read_persistent_clock()). This allows applications to get a
suspend aware monotonic clock."

So, I *think* all we have to do is allow the constant, because the only
handling that is different is how the kernel tracks the time.

The motivation for adding this is that new versions of systemd-resolved
(like what will ship in ubuntu 16.10) seems to open a BOOTTIME fd.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
CC: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/include/timerfd.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/criu/include/timerfd.h b/criu/include/timerfd.h
index f31d7a1..2e42a74 100644
--- a/criu/include/timerfd.h
+++ b/criu/include/timerfd.h
@@ -39,6 +39,7 @@ extern int is_timerfd_link(char *link);
 static inline int verify_timerfd(TimerfdEntry *tfe)
 {
 	if (tfe->clockid != CLOCK_REALTIME &&
+	    tfe->clockid != CLOCK_BOOTTIME &&
 	    tfe->clockid != CLOCK_MONOTONIC) {
 		pr_err("Unknown clock type %d for %#x\n", tfe->clockid, tfe->id);
 		return -1;
-- 
2.9.3



More information about the CRIU mailing list