Lines Matching refs:evsignal
213 int evsignal, void (__cdecl *handler)(int)) in evsig_set_handler_() argument
227 if (evsignal >= sig->sh_old_max) { in evsig_set_handler_()
228 int new_max = evsignal + 1; in evsig_set_handler_()
230 __func__, evsignal, sig->sh_old_max)); in evsig_set_handler_()
245 sig->sh_old[evsignal] = mm_malloc(sizeof *sig->sh_old[evsignal]); in evsig_set_handler_()
246 if (sig->sh_old[evsignal] == NULL) { in evsig_set_handler_()
258 if (sigaction(evsignal, &sa, sig->sh_old[evsignal]) == -1) { in evsig_set_handler_()
260 mm_free(sig->sh_old[evsignal]); in evsig_set_handler_()
261 sig->sh_old[evsignal] = NULL; in evsig_set_handler_()
265 if ((sh = signal(evsignal, handler)) == SIG_ERR) { in evsig_set_handler_()
267 mm_free(sig->sh_old[evsignal]); in evsig_set_handler_()
268 sig->sh_old[evsignal] = NULL; in evsig_set_handler_()
271 *sig->sh_old[evsignal] = sh; in evsig_set_handler_()
278 evsig_add(struct event_base *base, evutil_socket_t evsignal, short old, short events, void *p) in evsig_add() argument
283 EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG); in evsig_add()
301 event_debug(("%s: %d: changing signal handler", __func__, (int)evsignal)); in evsig_add()
302 if (evsig_set_handler_(base, (int)evsignal, evsig_handler) == -1) { in evsig_add()
324 evsig_restore_handler_(struct event_base *base, int evsignal) in evsig_restore_handler_() argument
334 if (evsignal >= sig->sh_old_max) { in evsig_restore_handler_()
341 sh = sig->sh_old[evsignal]; in evsig_restore_handler_()
342 sig->sh_old[evsignal] = NULL; in evsig_restore_handler_()
344 if (sigaction(evsignal, sh, NULL) == -1) { in evsig_restore_handler_()
349 if (signal(evsignal, *sh) == SIG_ERR) { in evsig_restore_handler_()
361 evsig_del(struct event_base *base, evutil_socket_t evsignal, short old, short events, void *p) in evsig_del() argument
363 EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG); in evsig_del()
366 __func__, EV_SOCK_ARG(evsignal))); in evsig_del()
373 return (evsig_restore_handler_(base, (int)evsignal)); in evsig_del()