Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 4 : 0 / 0

Advertisement

Detailed Solution

सही उत्तर 0 / 0 है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

On success, the fork() system call returns which value to the newly created child process? / सफल होने पर fork() सिस्टम कॉल नव-निर्मित चाइल्ड प्रक्रिया को कौन-सा मान लौटाता है?

1.
The child's own PID / चाइल्ड का स्वयं का PID
2.
The parent's PID / पैरेंट का PID
3.
-1 / -1
4.
0 / 0

Correct Answer: 0 / 0

fork() returns twice: 0 to the child (so it knows it is the child) and the child's PID to the parent (so the parent can track/wait on it); it returns -1 to the parent on failure, with no child created. / fork() दो बार लौटता है: चाइल्ड को 0 (ताकि वह जान सके कि वह चाइल्ड है) और पैरेंट को चाइल्ड का PID (ताकि पैरेंट उसे ट्रैक/wait कर सके); विफलता पर बिना चाइल्ड बनाए पैरेंट को -1 लौटता है।

Downloaded from PrepSnap (prepsnap.in)