forked from acassen/keepalived
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignals.h
67 lines (58 loc) · 1.99 KB
/
signals.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* Soft: Keepalived is a failover program for the LVS project
* <www.linuxvirtualserver.org>. It monitor & manipulate
* a loadbalanced server pool using multi-layer checks.
*
* Part: signals.c include file.
*
* Author: Kevin Lindsay, <[email protected]>
* Alexandre Cassen, <[email protected]>
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Copyright (C) 2001-2017 Alexandre Cassen, <[email protected]>
*/
#ifndef _SIGNALS_H
#define _SIGNALS_H
#include "config.h"
#include <signal.h>
#include <stdbool.h>
#include "scheduler.h"
#define SIGJSON (SIGRTMIN + 2)
#ifdef THREAD_DUMP
#define SIGTDUMP (SIGRTMAX)
#endif
#define SIGSTATS_CLEAR (SIGRTMAX - 1)
#ifndef _ONE_PROCESS_DEBUG_
#endif
static inline int
sigmask_func(int how, const sigset_t *set, sigset_t *oldset)
{
#ifdef _WITH_PTHREADS_
return pthread_sigmask(how, set, oldset);
#else
return sigprocmask(how, set, oldset);
#endif
}
/* Prototypes */
extern int get_signum(const char *);
extern void signal_set(int, void (*) (void *, int), void *);
extern void signal_ignore(int);
extern int signal_handler_init(void);
extern void signal_handler_destroy(void);
extern void signal_handler_script(void);
extern void add_signal_read_thread(thread_master_t *);
extern void cancel_signal_read_thread(void);
extern void set_sigxcpu_handler(void);
#ifdef THREAD_DUMP
extern void register_signal_thread_addresses(void);
#endif
#endif