Exercise III
1) Modify the program presented below (sinais-iii.c) to meet the following
requirements:
• The program should initially block the SIGINT and SIGQUIT signals.
• Additionally, the new processes must have the SIGTSTP signal blocked.
• The SIGTERM signal must be ignored in all processes.
• The void myHandler(int signum) function must be defined as the handler
for the SIGCHLD signal in the initial process, before any new process is created.
The disposition for the SIGCHLD should be the default in the processes created by
this program.
int main() {
while(1) {
wait_something();
pid_t r = fork();
if(r == 0) {
do_something();
return(0);
}
}
return(0);
}
Note: in the final exam you will not be able to test your code on a computer, so, in this
context, the operation of the myHandler, wait_something and do_something
functions is irrelevant to the resolution of the exercise.