rustix/backend/linux_raw/system/
types.rs

1use crate::ffi;
2use core::mem::size_of;
3
4/// `sysinfo`
5#[non_exhaustive]
6#[repr(C)]
7pub struct Sysinfo {
8    /// Seconds since boot
9    pub uptime: ffi::c_long,
10    /// 1, 5, and 15 minute load averages
11    pub loads: [ffi::c_ulong; 3],
12    /// Total usable main memory size
13    pub totalram: ffi::c_ulong,
14    /// Available memory size
15    pub freeram: ffi::c_ulong,
16    /// Amount of shared memory
17    pub sharedram: ffi::c_ulong,
18    /// Memory used by buffers
19    pub bufferram: ffi::c_ulong,
20    /// Total swap space size
21    pub totalswap: ffi::c_ulong,
22    /// Swap space still available
23    pub freeswap: ffi::c_ulong,
24    /// Number of current processes
25    pub procs: ffi::c_ushort,
26
27    pub(crate) pad: ffi::c_ushort,
28
29    /// Total high memory size
30    pub totalhigh: ffi::c_ulong,
31    /// Available high memory size
32    pub freehigh: ffi::c_ulong,
33    /// Memory unit size in bytes
34    pub mem_unit: ffi::c_uint,
35
36    pub(crate) f: [u8; 20 - 2 * size_of::<ffi::c_long>() - size_of::<ffi::c_int>()],
37}
38
39pub(crate) type RawUname = linux_raw_sys::system::new_utsname;