Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 1 | /* |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 2 | * include/proto/signal.h |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 3 | * Asynchronous signal delivery functions. |
| 4 | * |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 5 | * Copyright 2000-2010 Willy Tarreau <w@1wt.eu> |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 6 | * |
| 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 Faulet | b79a94c | 2017-05-30 15:34:30 +0200 | [diff] [blame] | 16 | #include <common/hathreads.h> |
| 17 | |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 18 | #include <types/signal.h> |
Willy Tarreau | dd2f85e | 2012-09-02 22:34:23 +0200 | [diff] [blame] | 19 | #include <types/task.h> |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 20 | |
| 21 | extern int signal_queue_len; |
| 22 | extern struct signal_descriptor signal_state[]; |
Willy Tarreau | bafbe01 | 2017-11-24 17:34:44 +0100 | [diff] [blame] | 23 | extern struct pool_head *pool_head_sig_handlers; |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 24 | |
Christopher Faulet | 9dcf9b6 | 2017-11-13 10:34:01 +0100 | [diff] [blame] | 25 | __decl_hathreads(extern HA_SPINLOCK_T signals_lock); |
Christopher Faulet | b79a94c | 2017-05-30 15:34:30 +0200 | [diff] [blame] | 26 | |
Willy Tarreau | d0807c3 | 2010-08-27 18:26:11 +0200 | [diff] [blame] | 27 | void signal_handler(int sig); |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 28 | void __signal_process_queue(); |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 29 | int signal_init(); |
| 30 | void deinit_signals(); |
| 31 | struct sig_handler *signal_register_fct(int sig, void (*fct)(struct sig_handler *), int arg); |
| 32 | struct sig_handler *signal_register_task(int sig, struct task *task, int reason); |
| 33 | void signal_unregister_handler(struct sig_handler *handler); |
| 34 | void signal_unregister_target(int sig, void *target); |
William Lallemand | d3801c1 | 2018-09-11 10:06:23 +0200 | [diff] [blame] | 35 | void haproxy_unblock_signals(); |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 36 | |
| 37 | static inline void signal_process_queue() |
| 38 | { |
| 39 | if (unlikely(signal_queue_len > 0)) |
| 40 | __signal_process_queue(); |
| 41 | } |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 42 | |
| 43 | /* |
| 44 | * Local variables: |
| 45 | * c-indent-level: 8 |
| 46 | * c-basic-offset: 8 |
| 47 | * End: |
| 48 | */ |