Fork a child process.
More...
#include <childprocess.h>
|
| void | waitError () |
| |
| virtual int | main ()=0 |
| | Main function to be called in the child process after it has forked. More...
|
| |
| wibble::sys::ChildProcess::ChildProcess |
( |
) | |
|
|
inline |
| virtual wibble::sys::ChildProcess::~ChildProcess |
( |
) | |
|
|
inlinevirtual |
| int wibble::sys::ChildProcess::exitStatus |
( |
) | |
|
| pid_t wibble::sys::ChildProcess::fork |
( |
) | |
|
For a subprocess to run proc.
| pid_t wibble::sys::ChildProcess::forkAndRedirect |
( |
int * |
stdinfd = 0, |
|
|
int * |
stdoutfd = 0, |
|
|
int * |
stderrfd = 0 |
|
) |
| |
Fork a subprocess to run proc.
If one of the std*fd variables is non-null, create a pipe connected to the corresponding file descriptor of the child process and store the parent end in the std*fd variable.
| void wibble::sys::ChildProcess::kill |
( |
int |
signal) | |
|
Send the given signal to the process.
| virtual int wibble::sys::ChildProcess::main |
( |
) | |
|
|
protectedpure virtual |
Main function to be called in the child process after it has forked.
Implemented in wibble::sys::Exec.
| pid_t wibble::sys::ChildProcess::pid |
( |
) | |
const |
|
inline |
Get the pid of the child process or (pid_t)-1 if no child is running.
Note: while ChildProcess::kill() has a safeguard against killing pid -1, if you are going to run ::kill on the output of pid() make sure to check what is the semanthics of kill() when pid is -1.
References _pid.
| bool wibble::sys::ChildProcess::running |
( |
) | |
|
| int wibble::sys::ChildProcess::wait |
( |
) | |
|
Wait for the child to finish, returing its exit status.
Return -1 if no child is running. TODO: gracefully handle the EINTR error code
| int wibble::sys::ChildProcess::wait |
( |
struct rusage * |
ru) | |
|
Wait for the child to finish, returing its exit status and storing resource usage informations in `ru'.
Return -1 if no child is running. TODO: gracefully handle the EINTR error code
| void wibble::sys::ChildProcess::waitError |
( |
) | |
|
|
protected |
| void wibble::sys::ChildProcess::waitForSuccess |
( |
) | |
|
| pid_t wibble::sys::ChildProcess::_pid |
|
protected |
| int wibble::sys::ChildProcess::m_status |
|
protected |
The documentation for this class was generated from the following file: