[−][src]Struct linux_taskstats::taskstats
This is custom copy of the generated struct taskstats from linux version 3.10.0 and in this crate
this type is used to read binary data transferred from linux kernel.
The reason of doing this despite the bindgen generates rust bindings including struct taskstats
is due to potential corruption of on-memory struct layout likely caused by old clang version.
ref: https://github.com/rust-lang/rust-bindgen/issues/867
Specifically, when bindgen generates struct taskstats with older clang version, the resulting
struct defined in generated rust source code contains size padding as the last member of the struct
causing offset of members after ac_uid to shift 4-byte or more and the result data becomes unreliable.
The bindgen generated definition works well in environment that uses newer clang versions, but I
decided to use copied definition of this struct for the time being by following considerations:
- The struct definition rarely evolves.
- Returning corrupted data silently is critical and much worse than not providing from the beginning.
- If user of this crate still needs to access the exactly original definition generated by
bindgen, it might still be possible by casting type to__bindgen_taskstatsexported by this crate.
Fields
version: c_ushortac_exitcode: c_uintac_flag: c_ucharac_nice: c_ucharcpu_count: c_ulonglongcpu_delay_total: c_ulonglongblkio_count: c_ulonglongblkio_delay_total: c_ulonglongswapin_count: c_ulonglongswapin_delay_total: c_ulonglongcpu_run_real_total: c_ulonglongcpu_run_virtual_total: c_ulonglongac_comm: [c_char; 32]ac_sched: c_ucharac_pad: [c_uchar; 3]__unused_padding: u32ac_uid: c_uintac_gid: c_uintac_pid: c_uintac_ppid: c_uintac_btime: c_uintac_etime: c_ulonglongac_utime: c_ulonglongac_stime: c_ulonglongac_minflt: c_ulonglongac_majflt: c_ulonglongcoremem: c_ulonglongvirtmem: c_ulonglonghiwater_rss: c_ulonglonghiwater_vm: c_ulonglongread_char: c_ulonglongwrite_char: c_ulonglongread_syscalls: c_ulonglongwrite_syscalls: c_ulonglongread_bytes: c_ulonglongwrite_bytes: c_ulonglongcancelled_write_bytes: c_ulonglongnvcsw: c_ulonglongnivcsw: c_ulonglongac_utimescaled: c_ulonglongac_stimescaled: c_ulonglongcpu_scaled_run_real_total: c_ulonglongfreepages_count: c_ulonglongfreepages_delay_total: c_ulonglongTrait Implementations
Auto Trait Implementations
impl RefUnwindSafe for taskstats
impl Send for taskstats
impl Sync for taskstats
impl Unpin for taskstats
impl UnwindSafe for taskstats
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,