FreeNOS
|
ProcessClient provides information about all processes on the local core. More...
#include <ProcessClient.h>
Data Structures | |
struct | Info |
Process information. More... | |
Public Types | |
enum | Result { Success, NotFound, IOError } |
Result codes. More... | |
typedef struct ProcessClient::Info | Info |
Process information. More... | |
Public Member Functions | |
ProcessID | getProcessID () const |
Get current process identifier. More... | |
ProcessID | getParentID () const |
Get parent process identifier. More... | |
Result | processInfo (const ProcessID pid, Info &info) const |
Get process information by its ID. More... | |
Result | processInfo (const String program, Info &info) const |
Get process information by its program name. More... | |
ProcessID | findProcess (const String program) const |
Find a process by its program name. More... | |
Static Public Attributes | |
static const Size | MaximumProcesses = MAX_PROCS |
Maximum number of processes. More... | |
Static Private Attributes | |
static const ProcessID | m_pid = ProcessCtl(SELF, GetPID, 0) |
Our own process identifier. More... | |
static const ProcessID | m_parent = ProcessCtl(SELF, GetParent, 0) |
Our parent process identifier. More... | |
ProcessClient provides information about all processes on the local core.
Definition at line 39 of file ProcessClient.h.
typedef struct ProcessClient::Info ProcessClient::Info |
Process information.
Find a process by its program name.
Returns the information for the first process that is running the given program.
program | Path to the program |
Definition at line 92 of file ProcessClient.cpp.
References ANY, ProcessInfo::id, ProcessClient::Info::kernelState, processInfo(), and Success.
ProcessID ProcessClient::getParentID | ( | ) | const |
Get parent process identifier.
Definition at line 32 of file ProcessClient.cpp.
References m_parent.
Referenced by getppid().
ProcessID ProcessClient::getProcessID | ( | ) | const |
Get current process identifier.
Definition at line 27 of file ProcessClient.cpp.
References m_pid.
Referenced by getpid(), and setupRandomizer().
ProcessClient::Result ProcessClient::processInfo | ( | const ProcessID | pid, |
ProcessClient::Info & | info | ||
) | const |
Get process information by its ID.
Definition at line 37 of file ProcessClient.cpp.
References ProcessClient::Info::command, InfoPID, IOError, ProcessClient::Info::kernelState, m_pid, NotFound, API::NotFound, ProcessCtl(), MemoryMap::range(), API::Read, ProcessInfo::state, Success, API::Success, ProcessClient::Info::textState, MemoryMap::UserArgs, Memory::Range::virt, and VMCopy().
Referenced by ProcessList::exec(), findProcess(), and processInfo().
ProcessClient::Result ProcessClient::processInfo | ( | const String | program, |
ProcessClient::Info & | info | ||
) | const |
Get process information by its program name.
Returns the information for the first process that is running the given program.
program | Path to the program |
info | Process information output |
Definition at line 76 of file ProcessClient.cpp.
References ProcessClient::Info::command, String::equals(), MaximumProcesses, NotFound, processInfo(), and Success.
|
staticprivate |
Our parent process identifier.
Definition at line 130 of file ProcessClient.h.
Referenced by getParentID().
|
staticprivate |
Our own process identifier.
Definition at line 127 of file ProcessClient.h.
Referenced by getProcessID(), and processInfo().
Maximum number of processes.
Definition at line 44 of file ProcessClient.h.
Referenced by ProcessList::exec(), and processInfo().