Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a)What, to whom and how many values a fork system call returns? b)Assuming there is no syntax error, what is the output for the following

a)What, to whom and how many values a fork system call returns?

b)Assuming there is no syntax error, what is the output for the following C program for linux? All of you may need to put screenshot of your PC in which Terminal login must be your arid number.
int main()
{      pid_t  fork_return;
fork_return = fork();
if (fork_return == 0) {
execlp("/bin/ls", "ls", NULL);
printf("Child process ID: %d", getpid());
     exit(0);
}
else { wait (NULL);
printf("Parent process ID: %d", getpid());
}
return 0;
}

Step by Step Solution

3.46 Rating (153 Votes )

There are 3 Steps involved in it

Step: 1

Fork Fork system call is used to create a new process This newly created p... 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

Modern Operating Systems

Authors: Andrew S. Tanenbaum, Herbert Bos

4th edition

013359162X, 978-0133591620

More Books

Students also viewed these Programming questions

Question

Discuss the primary sources of nonverbal communication.

Answered: 1 week ago