|
myMPD
Internal API documentation
|
Signal handling. More...
#include "compile_time.h"#include "src/lib/signal.h"#include "src/lib/api.h"#include "src/lib/event.h"#include "src/lib/log.h"#include "src/lib/msg_queue.h"#include <errno.h>#include <pthread.h>#include <string.h>#include <sys/eventfd.h>#include <unistd.h>
Functions | |
| static const char * | signal_name (int signo) |
| static void | signal_handler (int signo) |
| bool | signal_eventfd_init (void) |
| int | signal_eventfd_get (void) |
| bool | signal_eventfd_handler (void) |
| void | signal_eventfd_close (void) |
Variables | |
| sig_atomic_t | s_signal_received |
| Signal received indicator. | |
| static int | signal_eventfd = -1 |
| Eventfd for signal handling. | |
Signal handling.
| void signal_eventfd_close | ( | void | ) |
Closes the eventfd and sets it to -1.
| int signal_eventfd_get | ( | void | ) |
Returns the signal eventfd.
| bool signal_eventfd_handler | ( | void | ) |
Handles the signal_eventfd event.
| bool signal_eventfd_init | ( | void | ) |
Initializes the eventfd and installs a minimal signal handler for SIGTERM, SIGINT, and SIGHUP.
|
static |
Minimal signal handler that writes to the eventfd to wake up the main loop.
| signo | signal number |
|
static |
Looks up the name of a signal number
| signo | signal number |