xref: /third_party/rust/crates/rustix/src/time/mod.rs (revision b8a62b91)
1//! Time-related operations.
2
3mod clock;
4#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
5#[cfg(feature = "time")]
6mod timerfd;
7
8// TODO: Convert WASI'S clock APIs to use handles rather than ambient clock
9// identifiers, update `wasi-libc`, and then add support in `rustix`.
10#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
11pub use clock::clock_getres;
12#[cfg(not(target_os = "wasi"))]
13pub use clock::{clock_gettime, clock_gettime_dynamic, ClockId, DynamicClockId};
14pub use clock::{Nsecs, Secs, Timespec};
15#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
16#[cfg(feature = "time")]
17pub use timerfd::{
18    timerfd_create, timerfd_gettime, timerfd_settime, Itimerspec, TimerfdClockId, TimerfdFlags,
19    TimerfdTimerFlags,
20};
21