Question: pids3.c Do the question in linux I already give you the question, it says copy the pids3 to pids4 and the command lines to answer

 pids3.c Do the question in linux I already give you the

pids3.c

question, it says copy the pids3 to pids4 and the command lines

Do the question in linux

I already give you the question, it says copy the pids3 to pids4 and the command lines to answer the question, pids3 is already given you

Copy pids3.c to pids4.c Use the man pages to see what the "wait" system call does (section 2). e.g. > man 2' wait use the wait function to guarantee pids4.c will get its birth-parent's pid by not allowing the parent to die while the child is still running. Make sure to use "wait", and don't use any "sleep" commands at all. Where did you put the wait function call? what was the exact syntax you used? what headers does wait require? #define _GNU_SOURCE //for Ubuntu #include #include #include int main (void) { int pid, fpid, ppid; fpid = fork (); printf ("fpid is is %d ", fpid); if (fpid > 0) { pid = getpido; ppid = getppido; printf (" This is parent. My pid %d. My parent's pid %d ", pid, ppid); else if (fpid == 0) { pid = getpido; ppid = get ppido; printf " This is child. My pid %d. My parent's pid %d ", pid, ppid); else { printf ("fork failed "); } } return (0)

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!