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> |
| 16 | #include <types/signal.h> |
Willy Tarreau | dd2f85e | 2012-09-02 22:34:23 +0200 | [diff] [blame] | 17 | #include <types/task.h> |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 18 | |
| 19 | extern int signal_queue_len; |
| 20 | extern struct signal_descriptor signal_state[]; |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 21 | extern struct pool_head *pool2_sig_handlers; |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 22 | |
Willy Tarreau | d0807c3 | 2010-08-27 18:26:11 +0200 | [diff] [blame] | 23 | void signal_handler(int sig); |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 24 | void __signal_process_queue(); |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 25 | int signal_init(); |
| 26 | void deinit_signals(); |
| 27 | struct sig_handler *signal_register_fct(int sig, void (*fct)(struct sig_handler *), int arg); |
| 28 | struct sig_handler *signal_register_task(int sig, struct task *task, int reason); |
| 29 | void signal_unregister_handler(struct sig_handler *handler); |
| 30 | void signal_unregister_target(int sig, void *target); |
Willy Tarreau | 8f38bd0 | 2009-05-10 08:53:33 +0200 | [diff] [blame] | 31 | |
| 32 | static inline void signal_process_queue() |
| 33 | { |
| 34 | if (unlikely(signal_queue_len > 0)) |
| 35 | __signal_process_queue(); |
| 36 | } |
Willy Tarreau | 24f4efa | 2010-08-27 17:56:48 +0200 | [diff] [blame] | 37 | |
| 38 | /* |
| 39 | * Local variables: |
| 40 | * c-indent-level: 8 |
| 41 | * c-basic-offset: 8 |
| 42 | * End: |
| 43 | */ |