Question: Now modify the code of prog5.c to make it do the following: a) Have the child process return a value of 75 (to simulate that

Now modify the code of prog5.c to make it do the following: a) Have the child process return a value of 75 (to simulate that it encountered a database connection issue). b) Have the parent process detect that it returned a non-zero value by printing it. The output of prog5.o should look something like: I am the parent process (PID: 3852). I created a child process with PID 3853 I am the child process (PID: 3853). Unable to open connection to database I am the parent process (PID: 3852). Status of child process is 75 nain of process with PID 3852 ends Note that you have to use wait: int status = 0; wait(&status); And to print the value of status you can use the WEXITSTATUS macro: WEXITSTATUS(status) Include prog4.c and a snapshot of the output with you submission. #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
