Question: LINUX : ------------------------------- Write a pseudo code that prints failed when a fork() is failed and prints child in the child process, if a fork

LINUX:

LINUX: ------------------------------- Write a pseudo code that prints failed when a fork()

is failed and prints child in the child process, if a fork

-------------------------------

Write a pseudo code that prints failed when a fork() is failed and prints child in the child process, if a fork is successful.

#/pthread > void work(char * name) { printf("%s process ", name); int main (0 time_t now; pid t pid; if ((p.d = fork() ) 0) //parent process work ("main"); sleep(10); printf"bye parentIn"); else if (pid0) // child process work ("child"); sleep(20); printf"bye child ")

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!