The class implements working with POSIX signals.
More...
#include <PosixSignal.h>
|
typedef std::function< void(unsigned
int)> | Handler |
|
|
static void | send (long pid, const std::string name) |
|
static void | send (const Poco::Thread &thread, const std::string &name) |
|
static void | ignore (const std::string &name) |
|
static void | handle (const std::string &name, Handler handler) |
|
static void | trapFatal () |
|
|
static unsigned int | byName (const std::string &name) |
|
static void | send (long pid, unsigned int num) |
|
static void | send (const Poco::Thread &thread, unsigned int num) |
|
static void | ignore (unsigned int num) |
|
static void | handle (unsigned int num, Handler handler) |
|
The class implements working with POSIX signals.
unsigned int PosixSignal::byName |
( |
const std::string & |
name | ) |
|
|
staticprotected |
Translate name of a signal to its internal representation.
void PosixSignal::handle |
( |
const std::string & |
name, |
|
|
Handler |
handler |
|
) |
| |
|
static |
Install a handler for the given signal name.
- Parameters
-
name | Name of the signal to handle |
handler | Handler to be used |
static void BeeeOn::PosixSignal::ignore |
( |
const std::string & |
name | ) |
|
|
static |
Ignore the selected signal to not influence the current process (SIG_IGN).
- Parameters
-
name | Name of the signal to be ignored |
static void BeeeOn::PosixSignal::send |
( |
long |
pid, |
|
|
const std::string |
name |
|
) |
| |
|
static |
Send signal to a process of the given pid.
- Parameters
-
pid | Process ID |
name | Name of the signal to send (e.g. SIGUSR1) |
static void BeeeOn::PosixSignal::send |
( |
const Poco::Thread & |
thread, |
|
|
const std::string & |
name |
|
) |
| |
|
static |
Send signal to a thread owning by this process. We assume that the Poco::Thread is using pthread internally. The implementation calls pthread_kill() to send the signal to the proper thread.
- Parameters
-
thread | Thread to send the signal to |
name | Name of the signal to send |
void PosixSignal::trapFatal |
( |
| ) |
|
|
static |
Install appropriate handlers for the most fatal signals like SIGSEGV, SIGBUS, etc. The application would provide some more information during the actual crash. The handlers terminates the application by calling _exit().
The documentation for this class was generated from the following files:
- /var/lib/jenkins/workspace/beeeon-gateway-master/base/src/util/PosixSignal.h
- /var/lib/jenkins/workspace/beeeon-gateway-master/base/src/util/PosixSignal.cpp