Question

standard UNIX fork() return child's pit to the parent and returns 0 to the child. Instead,...

standard UNIX fork() return child's pit to the parent and returns 0 to the child. Instead, imagine that fork() returns 0 to the parent and returns parent's pid to the child. What would be a potential issue with this semantic?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

According to the general fork() function. The purpose of fork() is to create a new process, in which becomes the child process of the parent. It returns a process ID.

Below are different values returned by fork().

  • If fork() returns a negative value, the creation of a child process was unsuccessful.
  • fork() returns a zero to the newly created child process.
  • fork() returns a positive value, the process ID of the child process, to the parent.

But the given scenario is distinct.Normally the fork() returns 0 to the parent and in turn child PID from the parent.

Here assuming fork() returns 0 to parent and returns parent's PID to the child means the function fork() is recursively applying on a single process and no child is being created.

For a unique process the same fork() function is calling again and again.If a child got created means compulsorily it will act as dual under same address space and returns child PID to parent process.

Add a comment
Know the answer?
Add Answer to:
standard UNIX fork() return child's pit to the parent and returns 0 to the child. Instead,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT