devela::_dep::nc::call

Function clock_nanosleep

pub unsafe fn clock_nanosleep(
    which_clock: i32,
    flags: i32,
    request: &timespec_t,
    remain: Option<&mut timespec_t>,
) -> Result<(), i32> 
Available on crate feature dep_nc only.
Expand description

High resolution sleep with a specific clock.

§Examples

let t = nc::timespec_t {
    tv_sec: 1,
    tv_nsec: 0,
};
let ret = unsafe { nc::clock_nanosleep(nc::CLOCK_MONOTONIC, 0, &t, None) };
assert!(ret.is_ok());