process-cpp
3.0.0
A simple convenience library for handling processes in C++11.
|
The Stat struct encapsulates status information about a process. More...
#include <stat.h>
Public Attributes | |
pid_t | pid = 1 |
The process ID. More... | |
std::string | executable |
The filename of the executable, in parentheses. More... | |
State | state = State::undefined |
State of the process. More... | |
pid_t | parent = -1 |
The PID of the parent. More... | |
pid_t | process_group = -1 |
The process group ID of the process. More... | |
int | session_id = -1 |
The session ID of the process. More... | |
int | tty_nr = -1 |
The controlling terminal of the process. More... | |
int | controlling_process_group = -1 |
The ID of the foreground process group of the controlling terminal of the process. More... | |
unsigned int | kernel_flags = 0 |
The kernel flags word of the process. More... | |
long unsigned int | minor_faults_count = 0 |
The number of minor faults the process has made which have not required loading a memory page from disk. More... | |
long unsigned int | minor_faults_count_by_children = 0 |
The number of minor faults that the process's waited-for children have made. More... | |
long unsigned int | major_faults_count = 0 |
The number of major faults the process has made which have required loading a memory page from disk. More... | |
long unsigned int | major_faults_count_by_children = 0 |
The number of major faults that the process's waited-for children have made. More... | |
struct { | |
long unsigned int user = 0 | |
Amount of time that this process has been scheduled in user mode, [clock ticks]. More... | |
long unsigned int system = 0 | |
Amount of time that this process has been scheduled in kernel mode, [clock ticks]. More... | |
long unsigned int user_for_children = 0 | |
Amount of time that this process's waited-for children have been scheduled in user mode, [clock ticks]. More... | |
long unsigned int system_for_children = 0 | |
Amount of time that this process's waited-for children have been scheduled in kernel mode, [clock ticks]. More... | |
} | time |
long int | priority = 0 |
long int | nice = 0 |
The nice value (see setpriority(2)), a value in the range 19 (low priority) to -20 (high priority). More... | |
long int | thread_count = 0 |
Number of threads in this process (since Linux 2.6). More... | |
long int | time_before_next_sig_alarm = 0 |
The time in jiffies before the next SIGALRM is sent to the process due to an interval timer. Since kernel 2.6.17, this field is no longer maintained, and is hard coded as 0. More... | |
long int | start_time = 0 |
The time the process started after system boot. In kernels before Linux 2.6, this value was expressed in jiffies. Since Linux 2.6, the value is expressed in clock ticks (divide by sysconf(_SC_CLK_TCK)). More... | |
struct { | |
long unsigned int virt = 0 | |
Virtual memory size in bytes. More... | |
long unsigned int resident_set = 0 | |
Resident Set Size: number of pages the process has in real memory. This is just the pages which count toward text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out. More... | |
long unsigned int resident_set_limit = 0 | |
Current soft limit in bytes on the rss of the process; see the description of RLIMIT_RSS in getrlimit(2). More... | |
} | size |
struct { | |
long unsigned int start_code = 0 | |
The address above which program text can run. More... | |
long unsigned int end_code = 0 | |
The address below which program text can run. More... | |
long unsigned int start_stack = 0 | |
The address of the start (i.e., bottom) of the stack. More... | |
long unsigned int stack_pointer = 0 | |
The current value of ESP (stack pointer), as found in the kernel stack page for the process. More... | |
long unsigned int instruction_pointer = 0 | |
The current EIP (instruction pointer). More... | |
} | addresses |
struct { | |
long unsigned int pending = 0 | |
The bitmap of pending signals, displayed as a decimal number. Obsolete, because it does not provide information on real-time signals; use /proc/[pid]/status instead. More... | |
long unsigned int blocked = 0 | |
The bitmap of blocked signals, displayed as a decimal number. Obsolete, because it does not provide information on real-time signals; use /proc/[pid]/status instead. More... | |
long unsigned int ignored = 0 | |
The bitmap of ignored signals, displayed as a decimal number. Obsolete, because it does not provide information on real-time signals; use /proc/[pid]/status instead. More... | |
long unsigned int caught = 0 | |
The bitmap of caught signals, displayed as a decimal number. Obsolete, because it does not provide information on real-time signals; use /proc/[pid]/status instead. More... | |
} | signals |
long unsigned int | channel = 0 |
This is the "channel" in which the process is waiting. It is the address of a system call, and can be looked up in a namelist if you need a textual name. (If you have an up-to-date /etc/psdatabase, then try ps -l to see the WCHAN field in action.) More... | |
long unsigned int | swap_count = 0 |
Number of pages swapped (not maintained). More... | |
long unsigned int | swap_count_children = 0 |
Cumulative nswap for child processes (not maintained). More... | |
int | exit_signal = -1 |
Signal to be sent to parent when we die. More... | |
int | cpu_count = -1 |
CPU number last executed on. More... | |
unsigned int | realtime_priority = 0 |
Real-time scheduling priority, a number in the range 1 to 99 for processes scheduled under a real-time policy, or 0, for non-real-time processes (see sched_setscheduler(2)). More... | |
unsigned int | scheduling_policy = 0 |
Scheduling policy (see sched_setscheduler(2)). Decode using the SCHED_* constants in linux/sched.h. More... | |
long long unsigned int | aggregated_block_io_delays = 0 |
Aggregated block I/O delays, measured in clock ticks (centiseconds). More... | |
long unsigned int | guest_time = 0 |
Guest time of the process (time spent running a virtual CPU for a guest operating system), measured in clock ticks. More... | |
long unsigned int | guest_time_children = 0 |
Guest time of the process's children, measured in clock ticks. More... | |
The Stat struct encapsulates status information about a process.
struct { ... } core::posix::linux::proc::process::Stat::addresses |
Referenced by core::posix::linux::proc::process::operator>>().
long long unsigned int core::posix::linux::proc::process::Stat::aggregated_block_io_delays = 0 |
Aggregated block I/O delays, measured in clock ticks (centiseconds).
Definition at line 109 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::blocked = 0 |
The bitmap of blocked signals, displayed as a decimal number. Obsolete, because it does not provide information on real-time signals; use /proc/[pid]/status instead.
Definition at line 98 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::caught = 0 |
The bitmap of caught signals, displayed as a decimal number. Obsolete, because it does not provide information on real-time signals; use /proc/[pid]/status instead.
Definition at line 100 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::channel = 0 |
This is the "channel" in which the process is waiting. It is the address of a system call, and can be looked up in a namelist if you need a textual name. (If you have an up-to-date /etc/psdatabase, then try ps -l to see the WCHAN field in action.)
Definition at line 102 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
int core::posix::linux::proc::process::Stat::controlling_process_group = -1 |
The ID of the foreground process group of the controlling terminal of the process.
Definition at line 50 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
int core::posix::linux::proc::process::Stat::cpu_count = -1 |
CPU number last executed on.
Definition at line 106 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::end_code = 0 |
The address below which program text can run.
Definition at line 90 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
std::string core::posix::linux::proc::process::Stat::executable |
The filename of the executable, in parentheses.
Definition at line 44 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
int core::posix::linux::proc::process::Stat::exit_signal = -1 |
Signal to be sent to parent when we die.
Definition at line 105 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::guest_time = 0 |
Guest time of the process (time spent running a virtual CPU for a guest operating system), measured in clock ticks.
Definition at line 110 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::guest_time_children = 0 |
Guest time of the process's children, measured in clock ticks.
Definition at line 111 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::ignored = 0 |
The bitmap of ignored signals, displayed as a decimal number. Obsolete, because it does not provide information on real-time signals; use /proc/[pid]/status instead.
Definition at line 99 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::instruction_pointer = 0 |
The current EIP (instruction pointer).
Definition at line 93 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
unsigned int core::posix::linux::proc::process::Stat::kernel_flags = 0 |
The kernel flags word of the process.
Definition at line 51 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::major_faults_count = 0 |
The number of major faults the process has made which have required loading a memory page from disk.
Definition at line 54 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::major_faults_count_by_children = 0 |
The number of major faults that the process's waited-for children have made.
Definition at line 55 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::minor_faults_count = 0 |
The number of minor faults the process has made which have not required loading a memory page from disk.
Definition at line 52 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::minor_faults_count_by_children = 0 |
The number of minor faults that the process's waited-for children have made.
Definition at line 53 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long int core::posix::linux::proc::process::Stat::nice = 0 |
The nice value (see setpriority(2)), a value in the range 19 (low priority) to -20 (high priority).
Definition at line 77 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
pid_t core::posix::linux::proc::process::Stat::parent = -1 |
The PID of the parent.
Definition at line 46 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::pending = 0 |
The bitmap of pending signals, displayed as a decimal number. Obsolete, because it does not provide information on real-time signals; use /proc/[pid]/status instead.
Definition at line 97 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
pid_t core::posix::linux::proc::process::Stat::pid = 1 |
The process ID.
Definition at line 43 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long int core::posix::linux::proc::process::Stat::priority = 0 |
(Explanation for Linux 2.6) For processes running a real-time scheduling policy (policy below; see sched_setscheduler(2)), this is the negated scheduling priority, minus one; that is, a number in the range -2 to -100, corresponding to real-time priorities 1 to 99. For processes running under a non-real-time scheduling policy, this is the raw nice value (setpriority(2)) as represented in the kernel. The kernel stores nice values as numbers in the range 0 (high) to 39 (low), corresponding to the user-visible nice range of -20 to 19.
Before Linux 2.6, this was a scaled value based on the scheduler weighting given to this process.
Definition at line 76 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
pid_t core::posix::linux::proc::process::Stat::process_group = -1 |
The process group ID of the process.
Definition at line 47 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
unsigned int core::posix::linux::proc::process::Stat::realtime_priority = 0 |
Real-time scheduling priority, a number in the range 1 to 99 for processes scheduled under a real-time policy, or 0, for non-real-time processes (see sched_setscheduler(2)).
Definition at line 107 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::resident_set = 0 |
Resident Set Size: number of pages the process has in real memory. This is just the pages which count toward text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out.
Definition at line 84 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::resident_set_limit = 0 |
Current soft limit in bytes on the rss of the process; see the description of RLIMIT_RSS in getrlimit(2).
Definition at line 85 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
unsigned int core::posix::linux::proc::process::Stat::scheduling_policy = 0 |
Scheduling policy (see sched_setscheduler(2)). Decode using the SCHED_* constants in linux/sched.h.
Definition at line 108 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
int core::posix::linux::proc::process::Stat::session_id = -1 |
The session ID of the process.
Definition at line 48 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
struct { ... } core::posix::linux::proc::process::Stat::signals |
Referenced by core::posix::linux::proc::process::operator>>().
struct { ... } core::posix::linux::proc::process::Stat::size |
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::stack_pointer = 0 |
The current value of ESP (stack pointer), as found in the kernel stack page for the process.
Definition at line 92 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::start_code = 0 |
The address above which program text can run.
Definition at line 89 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::start_stack = 0 |
The address of the start (i.e., bottom) of the stack.
Definition at line 91 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long int core::posix::linux::proc::process::Stat::start_time = 0 |
The time the process started after system boot. In kernels before Linux 2.6, this value was expressed in jiffies. Since Linux 2.6, the value is expressed in clock ticks (divide by sysconf(_SC_CLK_TCK)).
Definition at line 80 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
State core::posix::linux::proc::process::Stat::state = State::undefined |
State of the process.
Definition at line 45 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::swap_count = 0 |
Number of pages swapped (not maintained).
Definition at line 103 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::swap_count_children = 0 |
Cumulative nswap for child processes (not maintained).
Definition at line 104 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::system = 0 |
Amount of time that this process has been scheduled in kernel mode, [clock ticks].
Definition at line 59 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::system_for_children = 0 |
Amount of time that this process's waited-for children have been scheduled in kernel mode, [clock ticks].
Definition at line 61 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long int core::posix::linux::proc::process::Stat::thread_count = 0 |
Number of threads in this process (since Linux 2.6).
Definition at line 78 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
struct { ... } core::posix::linux::proc::process::Stat::time |
Referenced by core::posix::linux::proc::process::operator>>().
long int core::posix::linux::proc::process::Stat::time_before_next_sig_alarm = 0 |
The time in jiffies before the next SIGALRM is sent to the process due to an interval timer. Since kernel 2.6.17, this field is no longer maintained, and is hard coded as 0.
Definition at line 79 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
int core::posix::linux::proc::process::Stat::tty_nr = -1 |
The controlling terminal of the process.
Definition at line 49 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::user = 0 |
Amount of time that this process has been scheduled in user mode, [clock ticks].
Definition at line 58 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::user_for_children = 0 |
Amount of time that this process's waited-for children have been scheduled in user mode, [clock ticks].
Definition at line 60 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().
long unsigned int core::posix::linux::proc::process::Stat::virt = 0 |
Virtual memory size in bytes.
Definition at line 83 of file stat.h.
Referenced by core::posix::linux::proc::process::operator>>().