1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Take a look at the license at the top of the repository in the LICENSE file.
use ;
// definitions come from:
// https://github.com/freebsd/freebsd-src/blob/main/lib/libdevstat/devstat.h
// https://github.com/freebsd/freebsd-src/blob/main/sys/sys/devicestat.h
// #[repr(C)]
// pub(crate) struct statinfo {
// pub(crate) cp_time: [c_long; CPUSTATES as usize],
// pub(crate) tk_nin: c_long,
// pub(crate) tk_nout: c_long,
// pub(crate) dinfo: *mut devinfo,
// pub(crate) snap_time: c_long_double,
// }
pub const DEVSTAT_READ: usize = 0x01;
pub const DEVSTAT_WRITE: usize = 0x02;
// pub(crate) const DSM_NONE: c_int = 0;
// pub(crate) const DSM_TOTAL_BYTES_READ: c_int = 2;
// pub(crate) const DSM_TOTAL_BYTES_WRITE: c_int = 3;
// extern "C" {
// pub(crate) fn devstat_compute_statistics(current: *mut devstat, previous: *mut devstat, etime: c_long_double, ...) -> c_int;
// }
unsafe extern "C"