40 #define SIGHDL_XCPU 0x01
41 #define SIGHDL_ALRM 0x02
43 #define SIGHDL_USR1 0x01
44 #define SIGHDL_USR2 0x02
47 volatile uint8_t
USR = 0;
91 struct sigaction sig_param;
94 sig_param.sa_handler =
sighdl;
95 sigemptyset(&sig_param.sa_mask);
96 sig_param.sa_flags = SA_RESTART;
97 if (sigaction(SIGALRM, &sig_param, 0) < 0)
100 itv.it_value.tv_sec = (*sec);
101 itv.it_value.tv_usec = 0;
102 itv.it_interval.tv_sec = 0;
103 itv.it_interval.tv_usec = 0;
104 return setitimer(ITIMER_REAL, &itv, 0);
111 struct sigaction sig_param;
114 sig_param.sa_handler =
sighdl;
115 sigemptyset(&sig_param.sa_mask);
116 sig_param.sa_flags = SA_RESTART;
117 return sigaction(SIGXCPU, &sig_param, 0);
124 struct sigaction sig_param;
127 sig_param.sa_handler =
sighdl;
128 sigemptyset(&sig_param.sa_mask);
129 sig_param.sa_flags = SA_RESTART;
130 if (sigaction(SIGUSR1, &sig_param, 0) < 0)
132 return sigaction(SIGUSR2, &sig_param, 0);
void sighdl(int sig_code)
int sighdl_trap_cpulimit()
int sighdl_set_timeout(int *sec)