blob: 0806d04225871ac6ca1afc94b2f08916f47298f5 [file] [log] [blame]
Willy Tarreau8f38bd02009-05-10 08:53:33 +02001/*
Willy Tarreau24f4efa2010-08-27 17:56:48 +02002 * include/proto/signal.h
Willy Tarreau8f38bd02009-05-10 08:53:33 +02003 * Asynchronous signal delivery functions.
4 *
Willy Tarreau24f4efa2010-08-27 17:56:48 +02005 * Copyright 2000-2010 Willy Tarreau <w@1wt.eu>
Willy Tarreau8f38bd02009-05-10 08:53:33 +02006 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 *
12 */
13
14#include <signal.h>
15#include <common/standard.h>
Christopher Fauletb79a94c2017-05-30 15:34:30 +020016#include <common/hathreads.h>
17
Willy Tarreau8f38bd02009-05-10 08:53:33 +020018#include <types/signal.h>
Willy Tarreaudd2f85e2012-09-02 22:34:23 +020019#include <types/task.h>
Willy Tarreau8f38bd02009-05-10 08:53:33 +020020
21extern int signal_queue_len;
22extern struct signal_descriptor signal_state[];
Willy Tarreaubafbe012017-11-24 17:34:44 +010023extern struct pool_head *pool_head_sig_handlers;
Willy Tarreau8f38bd02009-05-10 08:53:33 +020024
Christopher Faulet9dcf9b62017-11-13 10:34:01 +010025__decl_hathreads(extern HA_SPINLOCK_T signals_lock);
Christopher Fauletb79a94c2017-05-30 15:34:30 +020026
Willy Tarreaud0807c32010-08-27 18:26:11 +020027void signal_handler(int sig);
Willy Tarreau8f38bd02009-05-10 08:53:33 +020028void __signal_process_queue();
Willy Tarreau24f4efa2010-08-27 17:56:48 +020029int signal_init();
30void deinit_signals();
31struct sig_handler *signal_register_fct(int sig, void (*fct)(struct sig_handler *), int arg);
32struct sig_handler *signal_register_task(int sig, struct task *task, int reason);
33void signal_unregister_handler(struct sig_handler *handler);
34void signal_unregister_target(int sig, void *target);
William Lallemand31a1c1d2018-11-20 17:36:52 +010035void signal_unregister(int sig);
William Lallemandd3801c12018-09-11 10:06:23 +020036void haproxy_unblock_signals();
Willy Tarreau8f38bd02009-05-10 08:53:33 +020037
38static inline void signal_process_queue()
39{
40 if (unlikely(signal_queue_len > 0))
41 __signal_process_queue();
42}
Willy Tarreau24f4efa2010-08-27 17:56:48 +020043
44/*
45 * Local variables:
46 * c-indent-level: 8
47 * c-basic-offset: 8
48 * End:
49 */