diff options
author | Adrien Leravat <Pixep@users.noreply.github.com> | 2019-06-21 22:40:16 -0700 |
---|---|---|
committer | Adrien Leravat <Pixep@users.noreply.github.com> | 2019-06-24 21:14:38 -0700 |
commit | 3688e6e99d16b0c6ecb7c8b3528a541ce6afe3a7 (patch) | |
tree | 594793c2f2fb2fc702cfa22ee57b3ad902219181 /vdso | |
parent | e9ea7230f7dc70d3e1bb5ae32b6927209cafb465 (diff) |
Add CLOCK_BOOTTIME as a CLOCK_MONOTONIC alias
Makes CLOCK_BOOTTIME available with
* clock_gettime
* timerfd_create
* clock_gettime vDSO
CLOCK_BOOTTIME is implemented as an alias to CLOCK_MONOTONIC.
CLOCK_MONOTONIC already keeps track of time across save
and restore. This is the closest possible behavior to Linux
CLOCK_BOOTIME, as there is no concept of suspend/resume.
Updates google/gvisor#218
Diffstat (limited to 'vdso')
-rw-r--r-- | vdso/vdso.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vdso/vdso.cc b/vdso/vdso.cc index 6265ad217..0bded13ac 100644 --- a/vdso/vdso.cc +++ b/vdso/vdso.cc @@ -33,6 +33,8 @@ int __common_clock_gettime(clockid_t clock, struct timespec* ts) { ret = ClockRealtime(ts); break; + // Fallthrough, CLOCK_BOOTTIME is an alias for CLOCK_MONOTONIC + case CLOCK_BOOTTIME: case CLOCK_MONOTONIC: ret = ClockMonotonic(ts); break; |