CppUtils::System::ProcessStatus
CLASSEncapsulates the execution status of a child process.
Description
Section titled “Description”Wraps the POSIX wait status integer and provides friendly inspection methods for exit codes, abnormal termination signals, and detailed diagnostic causes.
Public methods
Section titled “Public methods”Constructs a ProcessStatus from a raw POSIX wait status integer.
| Parameter | Description |
|---|---|
rawStatus | Integer returned by waitpid / wait. |
Returns the raw POSIX status code.
Returns: Raw status integer.
Checks if the process terminated normally via exit() or returning from main().
Returns: True if the process exited normally.
Returns the exit code of the process if it terminated normally.
Returns: Exit status integer (0-255).
Checks if the process was terminated by an unhandled signal.
Returns: True if the process was terminated by a signal.
[[nodiscard]] constexpr auto ProcessStatus::getTerminalSignal() const noexcept -> std::optional<Signal>;Returns the signal that caused the process to terminate.
Returns: Strongly-typed Signal enumerator.
Checks if the process generated a core dump upon abnormal termination.
Returns: True if a core dump was produced.
[[nodiscard]] constexpr auto ProcessStatus::getTerminalSignalName() const noexcept -> std::string_view;Returns the symbolic name of the termination signal if signaled.
Returns: Signal name (e.g. “SIGSEGV”), or empty string view if not signaled.