devela::_dep::nc

Function settimeofday

pub unsafe fn settimeofday(
    timeval: &timeval_t,
    tz: Option<&timezone_t>,
) -> Result<(), i32> 
Available on crate feature dep_nc only.
Expand description

Set system time and timezone.

let tv = nc::timeval_t {
    tv_sec: 1,
    tv_usec: 0,
};
let ret = unsafe { nc::settimeofday(&tv, None) };
assert!(ret.is_err());
assert_eq!(ret, Err(nc::EPERM));