A helper class of Fork.
More...
#include <Fork.h>
A helper class of Fork.
Definition at line 58 of file Fork.h.
◆ ChildStatusHandler()
| ASSA::ChildStatusHandler::ChildStatusHandler |
( |
| ) |
|
|
inline |
◆ caught()
| bool ASSA::ChildStatusHandler::caught |
( |
| ) |
const |
|
inline |
- Returns
- true if the signal has been caught; false otherwise
Definition at line 73 of file Fork.h.
References m_caught.
◆ exit_status()
| int ASSA::ChildStatusHandler::exit_status |
( |
| ) |
const |
|
inline |
- Returns
- -1 if failed on wait(); otherwise an exit status of the child process as returned by either RETURN or EXIT
Definition at line 69 of file Fork.h.
References m_exit_status.
◆ handle_signal()
| int ChildStatusHandler::handle_signal |
( |
int | signum_ | ) |
|
|
virtual |
Signal handler callback.
- Returns
- 0 on success, -1 on error
Reimplemented from ASSA::EventHandler.
Definition at line 134 of file Fork.cpp.
136{
138 DL((
FORK,
"Caught signal # %d\n", signum_));
139
140 if (signum_ == SIGCHLD) {
141 int status;
143 pid_t ret = ::wait (&status);
144 DL((
FORK,
"wait() = %d (PID)\n", ret));
145
146 if (ret > 0 && (WIFEXITED (status))) {
148 }
149 else {
151 }
152 }
153
155 return 0;
156}
#define DL(X)
A macro for writing debug message to the Logger.
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
@ FORK
Class Fork messages.
References DL, ASSA::FORK, m_caught, m_exit_status, and trace_with_mask.
◆ m_caught
| bool ASSA::ChildStatusHandler::m_caught |
|
private |
◆ m_exit_status
| int ASSA::ChildStatusHandler::m_exit_status |
|
private |
The documentation for this class was generated from the following files: