summaryrefslogtreecommitdiff
path: root/sig.c
blob: 2b5ab5ecadd20d76e0913ebbe7539f85eedbee03 (plain)
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
#include <stdio.h>
#include <signal.h>

#include "sig.h"

void register_signal(int signal, void (*handler)(int))
{
	sigset_t block_mask;
	struct sigaction saction;

	sigfillset(&block_mask);

	saction.sa_handler = handler;
	saction.sa_mask = block_mask;
	saction.sa_flags = SA_RESTART;

	sigaction(signal, &saction, NULL);
}

void register_signal_f(int signal, void (*handler)(int), int flags)
{
	sigset_t block_mask;
	struct sigaction saction;

	sigfillset(&block_mask);

	saction.sa_handler = handler;
	saction.sa_mask = block_mask;
	saction.sa_flags = flags;

	sigaction(signal, &saction, NULL);
}
s?h=nds-private-remove&id=e58383b803499bd623b737070038af94d0b8a3c7'>bpf: Use bpf_map_delete_elem() from the libraryMickaël Salaün5-26/+16 2017-02-10bpf: Use bpf_map_lookup_elem() from the libraryMickaël Salaün6-50/+39 2017-02-10bpf: Use bpf_map_update_elem() from the libraryMickaël Salaün6-91/+99 2017-02-10bpf: Use bpf_load_program() from the libraryMickaël Salaün6-32/+17 2017-02-10bpf: Always test unprivileged programsMickaël Salaün2-6/+64 2017-02-10bpf: Change the include directory for selftestMickaël Salaün1-1/+1 2017-02-10tools: Sync {,tools/}include/uapi/linux/bpf.hMickaël Salaün1-1/+22 2017-02-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller