Skip to content

Commit 4100016

Browse files
Anirudh Mathukumillimathukumillia
authored andcommitted
Use CLOCK_BOOTTIME for Instant in Fuchsia/Android
Fuchsia and Android both want Instants to progress during periods of suspension, and thus must use CLOCK_BOOTTIME as the backing reference clock.
1 parent 0af3039 commit 4100016

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/std/src/time.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,17 @@ use crate::sys_common::{FromInner, IntoInner};
118118
/// | SOLID | `get_tim` |
119119
/// | WASI | [__wasi_clock_time_get (Monotonic Clock)] |
120120
/// | Windows | [QueryPerformanceCounter] |
121+
/// | Android | [clock_gettime (Boottime Clock)] |
122+
/// | Fuchsia | [zx_clock_get_boot] |
121123
///
122124
/// [currently]: crate::io#platform-specific-behavior
123125
/// [QueryPerformanceCounter]: https://docs.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter
124126
/// [`insecure_time` usercall]: https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.insecure_time
125127
/// [timekeeping in SGX]: https://edp.fortanix.com/docs/concepts/rust-std/#codestdtimecode
126128
/// [__wasi_clock_time_get (Monotonic Clock)]: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#clock_time_get
127129
/// [clock_gettime (Monotonic Clock)]: https://linux.die.net/man/3/clock_gettime
130+
/// [clock_gettime (Boottime Clock)]: https://linux.die.net/man/2/clock_gettime
131+
/// [zx_clock_get_boot]: https://fuchsia.dev/reference/syscalls/clock_get_boot
128132
///
129133
/// **Disclaimer:** These system calls might change over time.
130134
///

0 commit comments

Comments
 (0)