Question 91 · 334 in bank
A developer is working on a project using a Linux tool that enables writing processes to obtain these required results: ✑ If the process is unsuccessful, a negative value is returned. ✑ If the process is successful, 0 value is returned to the child process, and the process ID is sent to the parent process. Which component results from this operation?
Show answer
Answer: D
Explanation
The Linux tool described in the question is most likely the fork() system call, which creates a new process by duplicating the calling process. When fork() is called, it returns a process ID (PID) to the parent process and a value of 0 to the child process. If an error occurs during the fork() call, a negative value is returned. Therefore, the operation described in the question results in a new process being created by the parent process, and the process ID being sent to the parent process. This is what the fork() system call does in Linux.
Source: Adapted from community discussion — drdecker100
