#![allow(dead_code)]
#![allow(unused_imports)]
extern crate libc;
extern crate sysctl;
use sysctl::Sysctl;
#[derive(Debug)]
#[repr(C)]
struct ClockInfo {
hz: libc::c_int,
tick: libc::c_int,
spare: libc::c_int,
stathz: libc::c_int,
profhz: libc::c_int,
}
#[cfg(any(target_os = "macos", target_os = "freebsd"))]
fn main() {
let oid: Vec<i32> = vec![libc::CTL_KERN, libc::KERN_CLOCKRATE];
let val: Box<ClockInfo> = sysctl::Ctl { oid }.value_as().expect("could not get value");
println!("{:?}", val);
}
#[cfg(any(target_os = "linux", target_os = "android"))]
fn main() {
println!("This operation is not supported on Linux.");
}