.
This commit is contained in:
@ -19,9 +19,16 @@ void handler(int sig, siginfo_t* info, void* context) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
|
||||
SIGS context = {.sa_flags = SA_SIGINFO, .sa_sigaction = handler};
|
||||
while(1)
|
||||
pause();
|
||||
sigaction(SIGUSR1, &context, NULL);
|
||||
sigaction(SIGUSR2, &context, NULL);
|
||||
|
||||
while(1){
|
||||
printf("The program is running...\n");
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user