/// Nanoseconds. Must be less than 1_000_000_000. pub tv_nsec: Nsecs,
}
/// A type for the `tv_sec` field of [`Timespec`]. #[cfg(not(fix_y2038))] #[allow(deprecated)] pubtype Secs = c::time_t;
/// A type for the `tv_sec` field of [`Timespec`]. #[cfg(fix_y2038)] pubtype Secs = i64;
/// A type for the `tv_sec` field of [`Timespec`]. #[cfg(any(
fix_y2038,
linux_raw,
all(libc, target_arch = "x86_64", target_pointer_width = "32")
))] pubtype Nsecs = i64;
/// A type for the `tv_nsec` field of [`Timespec`]. #[cfg(all(
not(fix_y2038),
libc,
not(all(target_arch = "x86_64", target_pointer_width = "32"))
))] pubtype Nsecs = c::c_long;
/// On 32-bit glibc platforms, `timespec` has anonymous padding fields, which /// Rust doesn't support yet (see `unnamed_fields`), so we define our own /// struct with explicit padding, with bidirectional `From` impls. #[cfg(fix_y2038)] #[repr(C)] #[derive(Debug, Clone)] pub(crate) struct LibcTimespec { pub(crate) tv_sec: Secs,
// `tv_nsec` needs to be able to hold nanoseconds up to a second.
t.tv_nsec = 999_999_999_u32 as _;
assert_eq!(t.tv_nsec as u64, 999_999_999_u64);
// `tv_sec` needs to be able to hold more than 32-bits of seconds.
t.tv_sec = 0x1_0000_0000_u64 as _;
assert_eq!(t.tv_sec as u64, 0x1_0000_0000_u64);
}
// Test that our workarounds are needed. #[cfg(fix_y2038)] #[test] #[allow(deprecated)] fn test_fix_y2038() {
assert_eq_size!(libc::time_t, u32);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.