Struct procfs::Process[][src]

pub struct Process {
    pub stat: Stat,
    pub owner: u32,
    // some fields omitted
}

Represents a process in /proc/<pid>.

The stat structure is pre-populated because it's useful info, but other data is loaded on demand (and so might fail, if the process no longer exist).

Fields

Process status, based on the /proc/<pid>/stat file.

The user id of the owner of this process

Methods

impl Process
[src]

Tries to create a Process based on a PID.

This can fail if the process doesn't exist, or if you don't have permission to access it.

Returns a Process for the currently running process.

This is done by using the /proc/self symlink

Returns the complete command line for the process, unless the process is a zombie.

Returns the process ID for this process.

Is this process still alive?

The the current working directory of the process. This done by dereferencing the /proc/pid/cwd symbolic link.

In a multithreaded process, the contents of this symbolic link are not available if the main thread has already terminated (typically by calling pthread_exit(3)).

Permission to dereference or read (readlink(2)) this symbolic link is governed by a ptrace access mode PTRACE_MODE_READ_FSCREDS check;

Gets the current environment for the process. This is done by reading the /proc/pid/environ file.

The actual path of the executed command, taken by resolving the /proc/pid/exe symbolic link.

Under Linux 2.2 and later, this symbolic link contains the actual pathname of the executed command. If the pathname has been unlinked, the symbolic link will contain the string '(deleted)' appended to the original pathname. In a multithreaded process, the contents of this symbolic link are not available if the main thread has already terminated (typically by calling pthread_exit(3)).

Return the Io stats for this process, based on the /proc/pid/io file.

(since kernel 2.6.20)

Return a list of the currently mapped memory regions and their access permissions, based on the /proc/pid/maps file.

Gets a list of open file descriptors for a process

Lists which memory segments are written to the core dump in the event that a core dump is performed.

By default, the following bits are set: 0, 1, 4 (if the CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS kernel configuration option is enabled), and 5. This default can be modified at boot time using the core dump_filter boot option.

This function will return ProcResult::NotFound if the coredump_filter file can't be found. If it returns ProcResult::Ok(None) then the process has no coredump_filter

Gets the process's autogroup membership

(since Linux 2.6.38 and requires CONFIG_SCHED_AUTOGROUP)

Get the process's auxiliary vector

(since 2.6.0-test7)

impl Process
[src]

Describes control groups to which the process with the corresponding PID belongs.

The displayed information differs for cgroupsversion 1 and version 2 hierarchies.

Trait Implementations

impl Debug for Process
[src]

Formats the value using the given formatter. Read more

impl Clone for Process
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Process

impl Sync for Process