sinf 0.1.0

Library for obtaining in-depth system information at both the hardware and software levels
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![allow(non_camel_case_types, dead_code)]

use libc::{c_int, c_void};

// Definitions come from: https://github.com/freebsd/freebsd-src/blob/main/lib/libdevstat/devstat.h

pub(crate) const DEVSTAT_READ: usize = 0x01;
pub(crate) const DEVSTAT_WRITE: usize = 0x02;

#[link(name = "geom")]
unsafe extern "C" {
    pub(crate) fn geom_stats_open() -> c_int;
    pub(crate) fn geom_stats_snapshot_get() -> *mut c_void;
    pub(crate) fn geom_stats_snapshot_next(arg: *mut c_void) -> *mut libc::devstat;
    pub(crate) fn geom_stats_snapshot_reset(arg: *mut c_void);
    pub(crate) fn geom_stats_snapshot_free(arg: *mut c_void);
}