Aller au contenu
Bienvenue sur la nouvelle documentation de CppUtils !

Encapsulates the execution status of a child process.

Wraps the POSIX wait status integer and provides friendly inspection methods for exit codes, abnormal termination signals, and detailed diagnostic causes.

constexpr explicit ProcessStatus::ProcessStatus(int rawStatus = 0) noexcept;

Constructs a ProcessStatus from a raw POSIX wait status integer.

ParamètreDescription
rawStatusInteger returned by waitpid / wait.
[[nodiscard]] constexpr auto ProcessStatus::raw() const noexcept -> int;

Returns the raw POSIX status code.

Retourne : Raw status integer.

[[nodiscard]] constexpr auto ProcessStatus::isExited() const noexcept -> bool;

Checks if the process terminated normally via exit() or returning from main().

Retourne : True if the process exited normally.

[[nodiscard]] constexpr auto ProcessStatus::getExitCode() const noexcept -> int;

Returns the exit code of the process if it terminated normally.

Retourne : Exit status integer (0-255).

[[nodiscard]] constexpr auto ProcessStatus::isSignaled() const noexcept -> bool;

Checks if the process was terminated by an unhandled signal.

Retourne : 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.

Retourne : Strongly-typed Signal enumerator.

[[nodiscard]] constexpr auto ProcessStatus::isCoreDumped() const noexcept -> bool;

Checks if the process generated a core dump upon abnormal termination.

Retourne : 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.

Retourne : Signal name (e.g. “SIGSEGV”), or empty string view if not signaled.

[[nodiscard]] constexpr auto ProcessStatus::getTerminalSignalExplanation() const noexcept -> std::string_view;

Returns a diagnostic explanation of the termination signal if signaled.

Retourne : Signal explanation, or empty string view if not signaled or unknown.

[[nodiscard]] auto ProcessStatus::getSignalDescription() const -> std::string;

Formats a comprehensive diagnostic string describing the terminating signal.

Retourne : Formatted string such as “SIGSEGV (11) : Segmentation fault (…)”, or empty string if not signaled.