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);
}
class='commit-info'> authorDavid S. Miller <davem@davemloft.net>2017-02-11 02:31:11 -0500 committerDavid S. Miller <davem@davemloft.net>2017-02-11 02:31:11 -0500 commit35eeacf1820a08305c2b0960febfa190f5a6dd63 (patch) treef1227c7384ee01d3f029cc5f82223234e6456c5f /tools/perf/builtin-config.c parentbed45f79a2afc9d7c279b880dfcac8f27d513b50 (diff)parent1ee18329fae936089c6c599250ae92482ff2b81f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'tools/perf/builtin-config.c')