Question
Consider the following code for signaling and signal handlers in parent and child processes, respectively. int x, y; void catch ctic (ant sig num) (x
Consider the following code for signaling and signal handlers in parent and child processes, respectively.
int x, y;
void catch ctic (ant sig num)
(x = 1: y = 1:1
void catch_user (int sig_num)
{x = 2; y = 2; ]
int main
{ signal(SIGINT, catch _ctic);
signal(SIGRTMIN, catch_user);
int pid = fork ();
if (pid != 0)
[kill (pid, SIGINT);
kill (pid, SIGTMIN);
else { scan"%d", &x); // read 5
scanf(*%d", &y); // read 6 printf (*(%d,%din", x, y);
}
wait();
}
What may be the printouts for (x,y) in the program above?
A. (1,1)
B. (2.2)
C. (1.2)
D. (2,1)
E. (1.6)
F. (2.6)
G. (5.1)
H. (5.2)
I. (5.6)
Your answer should be the labels) of all the above that apply, in alphabetical order with no space (e.g., ABD).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started