diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-07-19 10:44:45 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-07-19 10:44:45 -0700 |
commit | f544509c01970f4143526e7e85bc02b3b1799a8a (patch) | |
tree | fae21bd74c7b4f632a5ef216362e777c01b4356a /vdso/vdso.cc | |
parent | 0e040ba6e87f5fdcb23854909aad39aa1883925f (diff) | |
parent | 2d11fa05f7b705f74c737f5a59fe40414bb6f8d8 (diff) |
Merge pull request #450 from Pixep:feature/add-clock-boottime-as-monotonic
PiperOrigin-RevId: 258996346
Diffstat (limited to 'vdso/vdso.cc')
-rw-r--r-- | vdso/vdso.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vdso/vdso.cc b/vdso/vdso.cc index 6265ad217..8bb80a7a4 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; + case CLOCK_BOOTTIME: + // Fallthrough, CLOCK_BOOTTIME is an alias for CLOCK_MONOTONIC case CLOCK_MONOTONIC: ret = ClockMonotonic(ts); break; @@ -122,7 +124,8 @@ extern "C" int __kernel_clock_getres(clockid_t clock, struct timespec* res) { switch (clock) { case CLOCK_REALTIME: - case CLOCK_MONOTONIC: { + case CLOCK_MONOTONIC: + case CLOCK_BOOTTIME: { res->tv_sec = 0; res->tv_nsec = 1; break; |