46 static volatile int global_got_sigint = 0;
54 signal_handle_sigint (
int signo)
56 global_got_sigint = 1;
69 struct sigaction act, oact;
71 sigemptyset (&act.sa_mask);
77 global_got_sigint = 0;
78 act.sa_handler = signal_handle_sigint;
85 if (sigaction (signo, &act, &oact) < 0)
86 avr_warning (
"Failed to install signal handler: sig=%d: %s\n", signo,
99 struct sigaction act, oact;
101 sigemptyset (&act.sa_mask);
103 act.sa_handler = SIG_DFL;
107 if (sigaction (signo, &act, &oact) < 0)
108 avr_warning (
"Failed to restore default signal handler: sig=%d: %s\n",
109 signo, strerror (errno));
126 res = global_got_sigint;
127 global_got_sigint = 0;
void signal_watch_start(int signo)
Start watching for the occurrance of the given signal.
void signal_reset(int signo)
Clear the flag which indicates that a signal has ocurred.
#define avr_warning(fmt, args...)
Print a warning message to stderr.
void signal_watch_stop(int signo)
Stop watching signal.
int signal_has_occurred(int signo)
Check to see if a signal has occurred.