Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/lib/lib-signals.h @ 9595:166a188f9165 HEAD
mbox: Fields weren't being added to cache file during message saving.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 30 Jul 2010 16:55:58 +0100 |
parents | 3d2a48f73f86 |
children |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
4906
diff
changeset
|
1 #ifndef LIB_SIGNALS_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
4906
diff
changeset
|
2 #define LIB_SIGNALS_H |
0 | 3 |
3620
3360cc019737
Implemented new signal handling framework, which makes handling signals much
Timo Sirainen <tss@iki.fi>
parents:
2880
diff
changeset
|
4 #include <signal.h> |
3360cc019737
Implemented new signal handling framework, which makes handling signals much
Timo Sirainen <tss@iki.fi>
parents:
2880
diff
changeset
|
5 |
8882
9f3968f49ceb
lib-signals: Changed callback API to return siginfo_t.
Timo Sirainen <tss@iki.fi>
parents:
8367
diff
changeset
|
6 typedef void signal_handler_t(const siginfo_t *si, void *context); |
0 | 7 |
8883
5361cb6afe9e
When a process is killed, show the signal code and the sending process's pid and uid.
Timo Sirainen <tss@iki.fi>
parents:
8882
diff
changeset
|
8 /* Convert si_code to string */ |
8922
3d2a48f73f86
Compile fix to NetBSD: Don't use si_code which is a macro.
Timo Sirainen <tss@iki.fi>
parents:
8883
diff
changeset
|
9 const char *lib_signal_code_to_str(int signo, int sicode); |
8883
5361cb6afe9e
When a process is killed, show the signal code and the sending process's pid and uid.
Timo Sirainen <tss@iki.fi>
parents:
8882
diff
changeset
|
10 |
3620
3360cc019737
Implemented new signal handling framework, which makes handling signals much
Timo Sirainen <tss@iki.fi>
parents:
2880
diff
changeset
|
11 /* Set signal handler for specific signal. If delayed is TRUE, the handler |
4903
204d7edc7cdc
Added context parameter type safety checks for most callback APIs.
Timo Sirainen <tss@iki.fi>
parents:
4252
diff
changeset
|
12 will be called later, ie. not as a real signal handler. */ |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3620
diff
changeset
|
13 void lib_signals_set_handler(int signo, bool delayed, |
3620
3360cc019737
Implemented new signal handling framework, which makes handling signals much
Timo Sirainen <tss@iki.fi>
parents:
2880
diff
changeset
|
14 signal_handler_t *handler, void *context); |
4903
204d7edc7cdc
Added context parameter type safety checks for most callback APIs.
Timo Sirainen <tss@iki.fi>
parents:
4252
diff
changeset
|
15 /* Ignore given signal. */ |
204d7edc7cdc
Added context parameter type safety checks for most callback APIs.
Timo Sirainen <tss@iki.fi>
parents:
4252
diff
changeset
|
16 void lib_signals_ignore(int signo, bool restart_syscalls); |
3620
3360cc019737
Implemented new signal handling framework, which makes handling signals much
Timo Sirainen <tss@iki.fi>
parents:
2880
diff
changeset
|
17 void lib_signals_unset_handler(int signo, |
3360cc019737
Implemented new signal handling framework, which makes handling signals much
Timo Sirainen <tss@iki.fi>
parents:
2880
diff
changeset
|
18 signal_handler_t *handler, void *context); |
3360cc019737
Implemented new signal handling framework, which makes handling signals much
Timo Sirainen <tss@iki.fi>
parents:
2880
diff
changeset
|
19 |
8367
0d49326397b4
Added lib_signals_reset_ioloop() for handling signals with multiple ioloops.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
20 /* Remove and add the internal I/O handler back. This is necessary to get |
0d49326397b4
Added lib_signals_reset_ioloop() for handling signals with multiple ioloops.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
21 the delayed signals to work when using multiple I/O loops. */ |
0d49326397b4
Added lib_signals_reset_ioloop() for handling signals with multiple ioloops.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
22 void lib_signals_reset_ioloop(void); |
0d49326397b4
Added lib_signals_reset_ioloop() for handling signals with multiple ioloops.
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
23 |
3620
3360cc019737
Implemented new signal handling framework, which makes handling signals much
Timo Sirainen <tss@iki.fi>
parents:
2880
diff
changeset
|
24 void lib_signals_init(void); |
3360cc019737
Implemented new signal handling framework, which makes handling signals much
Timo Sirainen <tss@iki.fi>
parents:
2880
diff
changeset
|
25 void lib_signals_deinit(void); |
0 | 26 |
27 #endif |