|
Ninja
|
Subprocess wraps a single async subprocess. More...
#include <subprocess.h>
Public Member Functions | |
| bool | Done () const |
| ExitStatus | Finish () |
| Returns ExitSuccess on successful process exit, ExitInterrupted if the process was interrupted, ExitFailure if it otherwise failed. More... | |
| const std::string & | GetOutput () const |
| ~Subprocess () | |
Private Member Functions | |
| void | OnPipeReady () |
| bool | Start (struct SubprocessSet *set, const std::string &command) |
| Subprocess (bool use_console) | |
Private Attributes | |
| std::string | buf_ |
| int | fd_ |
| pid_t | pid_ |
| bool | use_console_ |
Friends | |
| struct | SubprocessSet |
Subprocess wraps a single async subprocess.
It is entirely passive: it expects the caller to notify it when its fds are ready for reading, as well as call Finish() to reap the child once done() is true.
Definition at line 42 of file subprocess.h.
| Subprocess::~Subprocess | ( | ) |
Definition at line 43 of file subprocess-posix.cc.
|
private |
Definition at line 39 of file subprocess-posix.cc.
| bool Subprocess::Done | ( | ) | const |
| ExitStatus Subprocess::Finish | ( | ) |
Returns ExitSuccess on successful process exit, ExitInterrupted if the process was interrupted, ExitFailure if it otherwise failed.
Definition at line 150 of file subprocess-posix.cc.
References ExitFailure, ExitInterrupted, ExitSuccess, Fatal(), and pid_.
Referenced by TEST_F(), RealCommandRunner::WaitForCommand(), and ~Subprocess().
| const string & Subprocess::GetOutput | ( | ) | const |
Definition at line 183 of file subprocess-posix.cc.
References buf_.
Referenced by TEST_F(), and RealCommandRunner::WaitForCommand().
|
private |
Definition at line 137 of file subprocess-posix.cc.
|
private |
Definition at line 51 of file subprocess-posix.cc.
References environ, Fatal(), fd_, pid_, SetCloseOnExec(), and use_console_.
Referenced by SubprocessSet::Add().
|
friend |
Definition at line 76 of file subprocess.h.
|
private |
Definition at line 58 of file subprocess.h.
Referenced by GetOutput(), and OnPipeReady().
|
private |
Definition at line 71 of file subprocess.h.
Referenced by Done(), OnPipeReady(), Start(), and ~Subprocess().
|
private |
Definition at line 72 of file subprocess.h.
Referenced by Finish(), Start(), and ~Subprocess().
|
private |
Definition at line 74 of file subprocess.h.
Referenced by Start().
1.8.14