Commit 851b0440 authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

timerfd: add support for CLOCK_BOOTTTIME

>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: 's avatarTycho Andersen <tycho.andersen@canonical.com>
CC: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent caf933bf
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment