Skip to content

Instantly share code, notes, and snippets.

@kunigami

kunigami/signal_handler.c

Last active Mar 4, 2020
Embed
What would you like to do?
void sigint_handler(int sig) {
write(0, "Ahhh! SIGINT!\n", 14);
}
int main(void) {
void sigint_handler(int sig); /* prototype */
struct sigaction sa;
sa.sa_handler = sigint_handler;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaction(SIGINT, &sa, NULL);
...
}
@kunigami

This comment has been minimized.

Copy link
Owner Author

@kunigami kunigami commented Mar 4, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.