folly::ProcessReturnCode

Class to wrap a process return code.

Synopsis

Declared in <folly/Subprocess.h>

class ProcessReturnCode;

Enums

NameDescription
State Lifecycle state of the process wrapped by a ProcessReturnCode.

Member Functions

NameDescription
ProcessReturnCode [constructor]Constructors
operator= Assignment operators
coreDumped Was a core file generated? Only valid if state() == KILLED; throws otherwise.
enforce Helper function to enforce a precondition based on this. Throws std::logic_error if in an unexpected state.
exitStatus Exit status. Only valid if state() == EXITED; throws otherwise.
exited Whether the process has exited.
killSignal Signal that caused the process's termination. Only valid if state() == KILLED; throws otherwise.
killed Whether the process was killed by a signal.
notStarted Whether the process has not been started.
running Whether the process is currently running.
state Process state. One of: NOT_STARTED: process hasn't been started successfully RUNNING: process is currently running EXITED: process exited (successfully or not) KILLED: process was killed by a signal.
str String representation; one of "not started" "running" "exited with status <status>" "killed by signal <signal>" "killed by signal <signal> (core dumped)"
succeeded Process exited normally with a zero exit status

Static Member Functions

NameDescription
make Creates a ProcessReturnCode from a raw wait() status.
makeNotStarted Creates a ProcessReturnCode in the NOT_STARTED state.
makeRunning Creates a ProcessReturnCode in the RUNNING state.