blob: 6556446ad3c8a3e2ec4999e15a7355bb484bd562 [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>
16#include <types/signal.h>
Willy Tarreaudd2f85e2012-09-02 22:34:23 +020017#include <types/task.h>
Willy Tarreau8f38bd02009-05-10 08:53:33 +020018
19extern int signal_queue_len;
20extern struct signal_descriptor signal_state[];
Willy Tarreau24f4efa2010-08-27 17:56:48 +020021extern struct pool_head *pool2_sig_handlers;
Willy Tarreau8f38bd02009-05-10 08:53:33 +020022
Willy Tarreaud0807c32010-08-27 18:26:11 +020023void signal_handler(int sig);
Willy Tarreau8f38bd02009-05-10 08:53:33 +020024void __signal_process_queue();
Willy Tarreau24f4efa2010-08-27 17:56:48 +020025int signal_init();
26void deinit_signals();
27struct sig_handler *signal_register_fct(int sig, void (*fct)(struct sig_handler *), int arg);
28struct sig_handler *signal_register_task(int sig, struct task *task, int reason);
29void signal_unregister_handler(struct sig_handler *handler);
30void signal_unregister_target(int sig, void *target);
Willy Tarreau8f38bd02009-05-10 08:53:33 +020031
32static inline void signal_process_queue()
33{
34 if (unlikely(signal_queue_len > 0))
35 __signal_process_queue();
36}
Willy Tarreau24f4efa2010-08-27 17:56:48 +020037
38/*
39 * Local variables:
40 * c-indent-level: 8
41 * c-basic-offset: 8
42 * End:
43 */