✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Dado el siguiente código C, ¿qué sucede si se le envía al proceso la señal SIGUSR1
?
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main(void) {
sigset_t set, oset;
/* Mask to block signals SIGUSR1 and SIGUSR2. */
sigemptyset(&set);
sigaddset(&set, SIGUSR1);
sigaddset(&set, SIGUSR2);
/* Blocking of signals SIGUSR1 and SIGUSR2 in the process. */
if (sigprocmask(SIG_BLOCK, &set, &oset) < 0) {
perror("sigprocmask");
exit(EXIT_FAILURE);
}
printf("Waiting signals (PID = %d)\n", getpid());
printf("SIGUSR1 and SIGUSR2 are blocked\n");
pause();
printf("End of program\n");
exit(EXIT_SUCCESS);
}
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!