#include <OW_Exec.hpp>
Collaboration diagram for OW_NAMESPACE::PopenStreams:
Public Member Functions | |
PopenStreams () | |
~PopenStreams () | |
PopenStreams (const PopenStreams &src) | |
PopenStreams & | operator= (const PopenStreams &src) |
UnnamedPipeRef | in () const |
Get a write-only pipe to the process's stdin. | |
void | in (const UnnamedPipeRef &pipe) |
Set a pipe to the process's stdin. | |
UnnamedPipeRef | out () const |
Get a read-only pipe to the process's stdout. | |
void | out (const UnnamedPipeRef &pipe) |
Set a pipe to the process's stdout. | |
UnnamedPipeRef | err () const |
Get a read-only pipe to the process's stderr. | |
void | err (const UnnamedPipeRef &pipe) |
Set a pipe to the process's stderr. | |
Array< UnnamedPipeRef > | extraPipes () const |
Get additional pipes that may be connected to the process. | |
void | setExtraPipes (const Array< UnnamedPipeRef > &pipes) |
Set additional pipes that may be connected to the process. | |
ProcId | pid () const |
Get the process's pid. | |
void | pid (ProcId newPid) |
Set the process's pid. | |
int | getExitStatus (UInt32 wait_initial, UInt32 wait_close, UInt32 wait_term) |
Waits for the process to terminate and returns its exit status. | |
int | getExitStatus () |
Same as getExitStatus(0, 10*1000, 10*1000);. | |
void | setProcessStatus (int ps) |
Sets the process's exit status. | |
Private Attributes | |
IntrusiveReference< PopenStreamsImpl > | m_impl |
Friends | |
bool | operator== (const PopenStreams &x, const PopenStreams &y) |
Definition at line 57 of file OW_Exec.hpp.
|
Definition at line 344 of file OW_Exec.cpp. |
|
Definition at line 349 of file OW_Exec.cpp. |
|
Definition at line 418 of file OW_Exec.cpp. |
|
Set a pipe to the process's stderr.
Definition at line 378 of file OW_Exec.cpp. References m_impl. |
|
Get a read-only pipe to the process's stderr.
Definition at line 373 of file OW_Exec.cpp. References m_impl. |
|
Get additional pipes that may be connected to the process.
Definition at line 383 of file OW_Exec.cpp. References m_impl. |
|
Same as getExitStatus(0, 10*1000, 10*1000);.
Definition at line 403 of file OW_Exec.cpp. References m_impl. |
|
Waits for the process to terminate and returns its exit status. Takes increasingly severe measures to ensure that the process dies -- the following steps are taken in order until termination is detected: 1. If wait_initial > 0, waits wait_initial seconds for the process to die on its own. 2. If wait_close > 0, closes the input and output pipes and then waits wait_close seconds for the process to die. 3. If wait_term > 0, sends process a SIGTERM signal and waits wait_term seconds for it to die. 4. Sends the process a SIGKILL signal. In steps 1-3 the function returns as soon as termination is detected. After calling this function the object is basically useless, except that if the function is called again it will return the same exit status without going through the above steps. Note to maintainers: it is important that if wait_close == 0 then the pipes are NOT closed. Wait times are no larger than 4294967 seconds.
Definition at line 408 of file OW_Exec.cpp. References m_impl. Referenced by OW_NAMESPACE::runHelper(). |
|
Set a pipe to the process's stdin.
Definition at line 358 of file OW_Exec.cpp. References m_impl. |
|
Get a write-only pipe to the process's stdin.
Definition at line 353 of file OW_Exec.cpp. References m_impl. Referenced by OW_NAMESPACE::runHelper(), and OW_NAMESPACE::Exec::safePopen(). |
|
Definition at line 423 of file OW_Exec.cpp. References m_impl. |
|
Set a pipe to the process's stdout.
Definition at line 368 of file OW_Exec.cpp. References m_impl. |
|
Get a read-only pipe to the process's stdout.
Definition at line 363 of file OW_Exec.cpp. References m_impl. |
|
Set the process's pid.
Definition at line 398 of file OW_Exec.cpp. References m_impl. |
|
Get the process's pid. If the process's exit status has already been read by calling getExitStatus(), then this will return -1 Definition at line 393 of file OW_Exec.cpp. References m_impl. |
|
Set additional pipes that may be connected to the process.
Definition at line 388 of file OW_Exec.cpp. References m_impl. |
|
Sets the process's exit status. This function is used by Exec::gatherOutput() Definition at line 413 of file OW_Exec.cpp. References m_impl. |
|
Definition at line 430 of file OW_Exec.cpp. |
|
Definition at line 154 of file OW_Exec.hpp. Referenced by err(), extraPipes(), getExitStatus(), in(), operator=(), OW_NAMESPACE::operator==(), out(), pid(), setExtraPipes(), and setProcessStatus(). |