/// Get time of specific clock.
///
/// # Examples
///
/// ```
/// let mut tp = nc::timespec_t::default();
/// let ret = unsafe { nc::clock_gettime(nc::CLOCK_REALTIME_COARSE, &mut tp) };
/// assert!(ret.is_ok());
/// assert!(tp.tv_sec > 0);
/// ```
pub unsafe fn clock_gettime(which_clock: clockid_t, tp: &mut timespec_t) -> Result<(), Errno> {
let which_clock = which_clock as usize;
let tp_ptr = tp as *mut timespec_t as usize;
syscall2(SYS_CLOCK_GETTIME, which_clock, tp_ptr).map(drop)
}