16 #include <sys/types.h> 19 # include <sys/wait.h> 35 #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined (__NetBSD__) 36 # define ASSAIOSIG SIGIO 38 # define ASSAIOSIG SIGPOLL 84 if (signum_ == SIGINT) {
126 if (signum_ == SIGUSR1) {
128 DL((
TRACE,
"signal count = %d\n", m_count));
164 if (signum_ == SIGUSR2) {
166 DL((
TRACE,
"signal count = %d\n", m_count));
200 if (signum_ == SIGCHLD && wait(NULL) != -1) {
201 m_child_exit_flag = 1;
234 if (signum_ == SIGALRM) {
242 sig_atomic_t
alarmed () {
return m_alarm_flag; }
278 #endif // !defined(WIN32) int handle_signal(int signum_)
Receive ALRM signal.
sig_atomic_t m_graceful_quit
flag that indicates whether signal was caught.
sig_atomic_t graceful_quit()
Indicates whether graceful quit signal has been raised by the signal handler.
SIGUSR1Handler()
Constructor.
SIGCHLDHandler()
Constructor.
SIGINTHandler handles SIGINT signal.
int handle_signal(int signum_)
Receive CHLD signal.
sig_atomic_t m_child_exit_flag
Child exit's state.
sig_atomic_t received_count() const
Report count of received signals.
#define DL(X)
A macro for writing debug message to the Logger.
sig_atomic_t m_count
Received signals count.
SIGALRMHandler()
Constructor.
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
sig_atomic_t m_count
Received signals count.
int handle_signal(int signum_)
Receive SIGINT signal.
A collection of assert function wrappers.
Class SIGPOLLHandler handles SIGPOLL signal.
An abstract interface for handling I/O events, timers, and such.
Class SigHandler(s) messages.
sig_atomic_t child_exited()
Did child exit?
int handle_signal(int signum_)
Catch USR1 signal and increment count.
int handle_signal(int signum_)
Catch and absorb SIGPOLL signal.
SIGPOLLHandler()
Constructor.
SIGINTHandler()
constructor
void resetState()
Reset child's exit state.
sig_atomic_t m_alarm_flag
Indicator whether alarm gone off yet.
Class SIGCHLDHandler handles SIGCHLD signal.
void resetState()
Reset internal state.
sig_atomic_t received_count() const
Report count of received signals.
void resetState()
Reset state of the object to initial.
int handle_signal(int signum_)
Catch USR2 signal and increment count.
void resetState()
Set received signals count back to 0.
void resetState()
Set received signals count back to 0.
SIGUSR2Handler()
Constructor.
Class SIGUSR2Handler handles SIGUSR2 signal.
Class SIGALRMHandler handles SIGALRM signal.
sig_atomic_t alarmed()
Has alarm gone off?