Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <signal.h>
- #include <unistd.h>
- #include <string.h>
- void handleSigusr1() {
- puts("Received SIGUSR1");
- }
- int main(int argc, char *argv[]) {
- struct sigaction sa;
- memset(&sa, 0, sizeof(struct sigaction));
- sa.sa_handler = &handleSigusr1;
- if (sigaction(SIGUSR1, &sa, NULL)) {
- perror("sigaction");
- exit(1);
- }
- while (1) {
- sleep(1);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement