Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started