#[cfg(target_os = "linux")]
pub mod process;
#[cfg(target_os = "linux")]
pub mod capability;
#[cfg(target_os = "linux")]
pub mod inotify;
#[cfg(target_os = "linux")]
pub mod net_connect;
#[cfg(target_os = "linux")]
#[allow(unsafe_code)]
pub fn now_monotonic_ns() -> u64 {
let mut ts = libc::timespec {
tv_sec: 0,
tv_nsec: 0,
};
let ret = unsafe { libc::clock_gettime(libc::CLOCK_MONOTONIC, &mut ts) };
if ret != 0 {
return 0;
}
(ts.tv_sec as u64).saturating_mul(1_000_000_000) + (ts.tv_nsec as u64)
}
#[cfg(not(target_os = "linux"))]
pub fn now_monotonic_ns() -> u64 {
0
}