(id: ClockId)
| 23 | #[inline] |
| 24 | #[must_use] |
| 25 | pub(crate) fn clock_getres(id: ClockId) -> Timespec { |
| 26 | #[cfg(target_pointer_width = "32")] |
| 27 | unsafe { |
| 28 | let mut result = MaybeUninit::<Timespec>::uninit(); |
| 29 | if let Err(err) = ret(syscall!(__NR_clock_getres_time64, id, &mut result)) { |
| 30 | // See the comments in `clock_gettime_via_syscall` about emulation. |
| 31 | debug_assert_eq!(err, io::Errno::NOSYS); |
| 32 | clock_getres_old(id, &mut result); |
| 33 | } |
| 34 | result.assume_init() |
| 35 | } |
| 36 | #[cfg(target_pointer_width = "64")] |
| 37 | unsafe { |
| 38 | let mut result = MaybeUninit::<Timespec>::uninit(); |
| 39 | ret_infallible(syscall!(__NR_clock_getres, id, &mut result)); |
| 40 | result.assume_init() |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | #[cfg(target_pointer_width = "32")] |
| 45 | unsafe fn clock_getres_old(id: ClockId, result: &mut MaybeUninit<Timespec>) { |
nothing calls this directly
no test coverage detected