Question: solve missing statement in c language problem 2 and problem 3 2. The followingrogam forkl) a child process. Then the child process outputs the parent

solve missing statement in c language problem 2 and problem 3

solve missing statement in c language problem 2 and problem 3 2.

The followingrogam forkl) a child process. Then the child process outputs the

2. The followingrogam forkl) a child process. Then the child process outputs the parent process ID, delivers sign:al SIG KLLtothe parent process and after that, the child process outputs its parent process ID aga statements or parts of the statements are missing in the program. Please add necessary (parts of) statements to complete t. (25 pts) #include #include #include int main(void) ( int Ho; pid t Pid, Parent Pid int status, statush switch(Pid fork() case-1 perror The fork failed!: break Parent, Pid Tent tPrd, slGH#A.vwese o),pH-Ot case O: atr.pyhalo) kt ( Parent Pr, SlGy exitl default: for (i-0 printf"96An", i); break; return 0; 3. Here are some statements ofa parent proces. The parent proces receives a child process exiing status and outputs e status information. If the child process terminates by a nal he parent process showsthesignal number. The status definition shows in the table below. The first ow means that the child process terminates normally while the second row means that the child process terminates by signal.Some statements or parts of the statements are missing in the program. Please add necessary (parts of statements to complete it (20 pts) Byte 3 Byte2 Byte 1Byte o Exit code unsigned mask Do0g0OOOr int status, valueOfStatus if (fork()0) ) else prinfChild process teminates normally.n else printf("Child process terminates by a signal, %din", value-Status); 2. The followingrogam forkl) a child process. Then the child process outputs the parent process ID, delivers sign:al SIG KLLtothe parent process and after that, the child process outputs its parent process ID aga statements or parts of the statements are missing in the program. Please add necessary (parts of) statements to complete t. (25 pts) #include #include #include int main(void) ( int Ho; pid t Pid, Parent Pid int status, statush switch(Pid fork() case-1 perror The fork failed!: break Parent, Pid Tent tPrd, slGH#A.vwese o),pH-Ot case O: atr.pyhalo) kt ( Parent Pr, SlGy exitl default: for (i-0 printf"96An", i); break; return 0; 3. Here are some statements ofa parent proces. The parent proces receives a child process exiing status and outputs e status information. If the child process terminates by a nal he parent process showsthesignal number. The status definition shows in the table below. The first ow means that the child process terminates normally while the second row means that the child process terminates by signal.Some statements or parts of the statements are missing in the program. Please add necessary (parts of statements to complete it (20 pts) Byte 3 Byte2 Byte 1Byte o Exit code unsigned mask Do0g0OOOr int status, valueOfStatus if (fork()0) ) else prinfChild process teminates normally.n else printf("Child process terminates by a signal, %din", value-Status)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!