pub struct Task {
pub pid: i32,
pub tid: i32,
/* private fields */
}
Expand description
A task (aka Thread) inside of a Process
Created by Process::tasks
, tasks in
general are similar to Processes and should have mostly the same fields.
Fields§
§pid: i32
The ID of the process that this task belongs to
tid: i32
The task ID
Implementations§
source§impl Task
impl Task
sourcepub fn stat(&self) -> ProcResult<Stat>
pub fn stat(&self) -> ProcResult<Stat>
Thread info from /proc/<pid>/task/<tid>/stat
Many of the returned fields will be the same as the parent process, but some fields like utime
and stime
will be per-task
sourcepub fn status(&self) -> ProcResult<Status>
pub fn status(&self) -> ProcResult<Status>
Thread info from /proc/<pid>/task/<tid>/status
Many of the returned fields will be the same as the parent process
sourcepub fn io(&self) -> ProcResult<Io>
pub fn io(&self) -> ProcResult<Io>
Thread IO info from /proc/<pid>/task/<tid>/io
This data will be unique per task.
sourcepub fn schedstat(&self) -> ProcResult<Schedstat>
pub fn schedstat(&self) -> ProcResult<Schedstat>
Thread scheduler info from /proc/<pid>/task/<tid>/schedstat
This data will be unique per task.
sourcepub fn children(&self) -> ProcResult<Vec<u32>>
pub fn children(&self) -> ProcResult<Vec<u32>>
Thread children from /proc/<pid>/task/<tid>/children
WARNING: This interface is not reliable unless all the child processes are stoppped or frozen. If a child task exits while the file is being read, non-exiting children may be omitted. See the procfs(5) man page for more information.
This data will be unique per task.
sourcepub fn read<T: FromRead>(&self, path: &str) -> ProcResult<T>
pub fn read<T: FromRead>(&self, path: &str) -> ProcResult<T>
Parse a file relative to the task proc structure.