diff options
Diffstat (limited to 'vendor/rustix/src/clockid.rs')
-rw-r--r-- | vendor/rustix/src/clockid.rs | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/vendor/rustix/src/clockid.rs b/vendor/rustix/src/clockid.rs index 033444d9c..b392d6a14 100644 --- a/vendor/rustix/src/clockid.rs +++ b/vendor/rustix/src/clockid.rs @@ -11,18 +11,22 @@ use crate::fd::BorrowedFd; /// [`clock_gettime`]: crate::time::clock_gettime #[cfg(not(any(apple, target_os = "wasi")))] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] -#[cfg_attr(not(target_os = "dragonfly"), repr(i32))] +#[cfg_attr(not(any(target_os = "aix", target_os = "dragonfly")), repr(i32))] #[cfg_attr(target_os = "dragonfly", repr(u64))] +#[cfg_attr(target_os = "aix", repr(i64))] #[non_exhaustive] pub enum ClockId { /// `CLOCK_REALTIME` + #[doc(alias = "CLOCK_REALTIME")] Realtime = bitcast!(c::CLOCK_REALTIME), /// `CLOCK_MONOTONIC` + #[doc(alias = "CLOCK_MONOTONIC")] Monotonic = bitcast!(c::CLOCK_MONOTONIC), /// `CLOCK_UPTIME` #[cfg(any(freebsdlike, target_os = "openbsd"))] + #[doc(alias = "CLOCK_UPTIME")] Uptime = c::CLOCK_UPTIME, /// `CLOCK_PROCESS_CPUTIME_ID` @@ -32,6 +36,7 @@ pub enum ClockId { target_os = "redox", target_os = "vita" )))] + #[doc(alias = "CLOCK_PROCESS_CPUTIME_ID")] ProcessCPUTime = c::CLOCK_PROCESS_CPUTIME_ID, /// `CLOCK_THREAD_CPUTIME_ID` @@ -41,19 +46,48 @@ pub enum ClockId { target_os = "redox", target_os = "vita" )))] + #[doc(alias = "CLOCK_THREAD_CPUTIME_ID")] ThreadCPUTime = c::CLOCK_THREAD_CPUTIME_ID, /// `CLOCK_REALTIME_COARSE` #[cfg(any(linux_kernel, target_os = "freebsd"))] + #[doc(alias = "CLOCK_REALTIME_COARSE")] RealtimeCoarse = c::CLOCK_REALTIME_COARSE, /// `CLOCK_MONOTONIC_COARSE` #[cfg(any(linux_kernel, target_os = "freebsd"))] + #[doc(alias = "CLOCK_MONOTONIC_COARSE")] MonotonicCoarse = c::CLOCK_MONOTONIC_COARSE, /// `CLOCK_MONOTONIC_RAW` #[cfg(linux_kernel)] + #[doc(alias = "CLOCK_MONOTONIC_RAW")] MonotonicRaw = c::CLOCK_MONOTONIC_RAW, + + /// `CLOCK_REALTIME_ALARM` + #[cfg(linux_kernel)] + #[doc(alias = "CLOCK_REALTIME_ALARM")] + RealtimeAlarm = bitcast!(c::CLOCK_REALTIME_ALARM), + + /// `CLOCK_TAI`, available on Linux >= 3.10 + #[cfg(all(linux_kernel, feature = "linux_4_11"))] + #[doc(alias = "CLOCK_TAI")] + Tai = bitcast!(c::CLOCK_TAI), + + /// `CLOCK_BOOTTIME` + /// + /// On FreeBSD, use [`Self::Uptime`], as `CLOCK_BOOTTIME` is an alias for + /// `CLOCK_UPTIME`. + /// + /// [`Self::Uptime`]: https://docs.rs/rustix/*/x86_64-unknown-freebsd/rustix/time/enum.ClockId.html#variant.Uptime + #[cfg(any(linux_kernel, target_os = "fuchsia", target_os = "openbsd"))] + #[doc(alias = "CLOCK_BOOTTIME")] + Boottime = bitcast!(c::CLOCK_BOOTTIME), + + /// `CLOCK_BOOTTIME_ALARM` + #[cfg(any(linux_kernel, target_os = "fuchsia"))] + #[doc(alias = "CLOCK_BOOTTIME_ALARM")] + BoottimeAlarm = bitcast!(c::CLOCK_BOOTTIME_ALARM), } /// `CLOCK_*` constants for use with [`clock_gettime`]. @@ -70,15 +104,19 @@ pub enum ClockId { #[non_exhaustive] pub enum ClockId { /// `CLOCK_REALTIME` + #[doc(alias = "CLOCK_REALTIME")] Realtime = c::CLOCK_REALTIME, /// `CLOCK_MONOTONIC` + #[doc(alias = "CLOCK_MONOTONIC")] Monotonic = c::CLOCK_MONOTONIC, /// `CLOCK_PROCESS_CPUTIME_ID` + #[doc(alias = "CLOCK_PROCESS_CPUTIME_ID")] ProcessCPUTime = c::CLOCK_PROCESS_CPUTIME_ID, /// `CLOCK_THREAD_CPUTIME_ID` + #[doc(alias = "CLOCK_THREAD_CPUTIME_ID")] ThreadCPUTime = c::CLOCK_THREAD_CPUTIME_ID, } @@ -99,24 +137,28 @@ pub enum DynamicClockId<'a> { /// Linux dynamic clocks. Dynamic(BorrowedFd<'a>), - /// `CLOCK_REALTIME_ALARM`, available on Linux >= 3.0 + /// `CLOCK_REALTIME_ALARM` #[cfg(linux_kernel)] + #[doc(alias = "CLOCK_REALTIME_ALARM")] RealtimeAlarm, /// `CLOCK_TAI`, available on Linux >= 3.10 #[cfg(linux_kernel)] + #[doc(alias = "CLOCK_TAI")] Tai, - /// `CLOCK_BOOTTIME`, available on Linux >= 2.6.39 + /// `CLOCK_BOOTTIME` #[cfg(any( freebsdlike, linux_kernel, target_os = "fuchsia", target_os = "openbsd" ))] + #[doc(alias = "CLOCK_BOOTTIME")] Boottime, - /// `CLOCK_BOOTTIME_ALARM`, available on Linux >= 2.6.39 + /// `CLOCK_BOOTTIME_ALARM` #[cfg(any(linux_kernel, target_os = "fuchsia"))] + #[doc(alias = "CLOCK_BOOTTIME_ALARM")] BoottimeAlarm, } |