blob: aaa23f6333e07d312edb4e8c4e209f3551873f90 [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>
Willy Tarreau3f567e42020-05-28 15:29:19 +020015#include <haproxy/thread.h>
Christopher Fauletb79a94c2017-05-30 15:34:30 +020016
Willy Tarreau8f38bd02009-05-10 08:53:33 +020017#include <types/signal.h>
Willy Tarreaudd2f85e2012-09-02 22:34:23 +020018#include <types/task.h>
Willy Tarreau8f38bd02009-05-10 08:53:33 +020019
20extern int signal_queue_len;
21extern struct signal_descriptor signal_state[];
22
Willy Tarreauaf613e82020-06-05 08:40:51 +020023__decl_thread(extern HA_SPINLOCK_T signals_lock);
Christopher Fauletb79a94c2017-05-30 15:34:30 +020024
Willy Tarreaud0807c32010-08-27 18:26:11 +020025void signal_handler(int sig);
Willy Tarreau8f38bd02009-05-10 08:53:33 +020026void __signal_process_queue();
Willy Tarreau24f4efa2010-08-27 17:56:48 +020027void deinit_signals();
28struct sig_handler *signal_register_fct(int sig, void (*fct)(struct sig_handler *), int arg);
29struct sig_handler *signal_register_task(int sig, struct task *task, int reason);
30void signal_unregister_handler(struct sig_handler *handler);
31void signal_unregister_target(int sig, void *target);
William Lallemand31a1c1d2018-11-20 17:36:52 +010032void signal_unregister(int sig);
William Lallemandd3801c12018-09-11 10:06:23 +020033void haproxy_unblock_signals();
Willy Tarreau8f38bd02009-05-10 08:53:33 +020034
35static inline void signal_process_queue()
36{
37 if (unlikely(signal_queue_len > 0))
38 __signal_process_queue();
39}
Willy Tarreau24f4efa2010-08-27 17:56:48 +020040
41/*
42 * Local variables:
43 * c-indent-level: 8
44 * c-basic-offset: 8
45 * End:
46 */