Last active
March 4, 2020 23:31
-
-
Save kunigami/c3099e49e5a673b4276bee400a1bc2c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: https://beej.us/guide/bgipc/html/multi/signals.html