Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

whereis fork? /usr/share/ma/man3/fork.3am.gz Fig 3.8 #include #include #include int main() { pid_t pid; /* fork a child process */ pid = fork (); if (pid

image text in transcribed

whereis fork? /usr/share/ma/man3/fork.3am.gz

Fig 3.8

#include

#include

#include

int main()

{

pid_t pid;

/* fork a child process */

pid = fork();

if (pid

fprintf(stderr, "Fork Failed");

return 1;

}

else if (pid == 0) { /* child process */

execlp(/bin/ls,ls,NULL);

}

else { /* parent process */

/* parent will wait for the child to complete */

wait(NULL);

printf("Child Complete");

}

return 0;

}

Q1. In this question, you will go through Section 3.3.1 entitled: "Process Creation" in your textbook. Next, in your Linux VM, go to the directory "ch3. Find and read the C program corresponding to Figure 3.8. Revise this code, so its child process can display the online manual for the facility "fork". Compile your code and run it. Q1. In this question, you will go through Section 3.3.1 entitled: "Process Creation" in your textbook. Next, in your Linux VM, go to the directory "ch3. Find and read the C program corresponding to Figure 3.8. Revise this code, so its child process can display the online manual for the facility "fork". Compile your code and run it

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

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

ISBN: 0619064625, 978-0619064624

More Books

Students also viewed these Databases questions

Question

What was the positive value of Max Weber's model of "bureaucracy?"

Answered: 1 week ago

Question

2. How should this be dealt with by the organisation?

Answered: 1 week ago

Question

explain what is meant by the term fair dismissal

Answered: 1 week ago