Question: Q1. Write an application which creates a process to execute another application in the executable file /home/hello. Your parent process should wait the termination of

 Q1. Write an application which creates a process to execute another

Q1. Write an application which creates a process to execute another application in the executable file "/home/hello". Your parent process should wait the termination of the child process. Also parent should print "PARENT is WAITING" to the screen before the child process finishes. Child does not print anything to the screen except the standard output of hello application. Note that you only need to write the main method. Q2. Write a possible output of the following application (assume that all libraries are included correctly). int main () \{ pid_t n, int x=2; n= fork(); if (n>0) \} x=x+7; wait(NULL); \} else if( n==0){ execlp("/bin/ls", "ls", NULL); x=x+10; \} printf("x is \%d n,x); 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!