Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

Find each product. 4(0)

Answered: 1 week ago