scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1typedef unsigned int sigset_t ; 
 2typedef struct siginfo siginfo_t ; 
 3
 4struct sigaction { 
 5	union { 
 6		void (*__sa_handler)(int); 
 7		void (*__sa_sigaction)(int, siginfo_t *, void *) ; 
 8	} __sigaction_u ; 
 9
10	sigset_t sa_mask ; 
11	int sa_flags ; 
12};
13
14static int
15_sigaction(int num, struct sigaction *sa, struct sigaction *osa)
16{
17	return num != 3 ? -1 : 0;
18}
19
20static void
21(*signal(int signum, void (* func) (int)))(int) 
22{
23	struct sigaction osa , sa = { 
24		.__sigaction_u.__sa_handler = func, 
25	}; 
26
27	if (_sigaction(signum, &sa, &osa ) < 0 ) 
28		return ((void (*)(int)) -1) ; 
29
30	return osa.__sigaction_u.__sa_handler ; 
31}
32
33static void
34sighdl(int signo)
35{
36}
37
38int
39main(void)
40{
41	signal(3, sighdl);
42
43	return 0;
44}