Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/std/src/sys/unix/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ mod inner {

impl Instant {
pub fn now() -> Instant {
Instant { t: now(libc::CLOCK_MONOTONIC) }
Instant { t: now(libc::CLOCK_BOOTTIME) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLOCK_BOOTTIME isn't supported on Linux <= 2.6.39, but Rust supports Linux >= 2.6.32. This should check if -EINVAL is returned and fall back to CLOCK_MONOTONIC if so.

}

pub const fn zero() -> Instant {
Expand Down