diff options
author | Dmitry Antipov <dantipov@cloudlinux.com> | 2022-10-25 11:30:34 +0300 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2022-11-12 21:14:48 +0100 |
commit | 1af745d033678333752afcd8724f5d6351561b4e (patch) | |
tree | b67297abda6067ca1609c338f74bbcc07332730a /evsignal-internal.h | |
parent | 9e346936d47a3a461f8ebaedabb2975bef3babf5 (diff) | |
download | libevent-1af745d033678333752afcd8724f5d6351561b4e.tar.gz |
signal: new signal handling backend based on signalfd
Linux-specific signal handling backend based on signalfd(2)
system call, and public function event_base_get_signal_method()
to obtain an underlying kernel signal handling mechanism.
Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Diffstat (limited to 'evsignal-internal.h')
-rw-r--r-- | evsignal-internal.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/evsignal-internal.h b/evsignal-internal.h index 5cff03b5..5ccf7d15 100644 --- a/evsignal-internal.h +++ b/evsignal-internal.h @@ -45,6 +45,10 @@ struct evsig_info { int ev_signal_added; /* Count of the number of signals we're currently watching. */ int ev_n_signals_added; +#ifdef EVENT__HAVE_SYS_SIGNALFD_H + /* EV_READ events used to wakeup corresponding EV_SIGNAL ones. */ + struct event *ev_sigevent[NSIG]; +#endif /* EVENT__HAVE_SYS_SIGNALFD_H */ /* Array of previous signal handler objects before Libevent started * messing with them. Used to restore old signal handlers. */ @@ -56,8 +60,17 @@ struct evsig_info { /* Size of sh_old. */ int sh_old_max; }; + +#ifdef EVENT__HAVE_SYS_SIGNALFD_H +int sigfd_init_(struct event_base *); +#else /* no signalfd() */ +static inline int +sigfd_init_(struct event_base *base) { return -1; } +#endif /* have signalfd() */ + int evsig_init_(struct event_base *); void evsig_dealloc_(struct event_base *); +int evsig_ensure_saved_(struct evsig_info *, int); void evsig_set_base_(struct event_base *base); void evsig_free_globals_(void); |