nc 0.9.8

Access system calls directly
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Set time.
///
/// # Examples
///
/// ```
/// let t = 1611630530;
/// let ret = unsafe { nc::stime(&t) };
/// assert!(ret.is_err());
/// assert_eq!(ret, Err(nc::EPERM));
/// ```
pub unsafe fn stime(t: &time_t) -> Result<(), Errno> {
    let t_ptr = core::ptr::from_ref(t) as usize;
    unsafe { syscall1(SYS_STIME, t_ptr).map(drop) }
}