______ system call creates new process in Unix.
2018
______ system call creates new process in Unix.
- A.
create
- B.
create new
- C.
fork
- D.
fork new
Attempted by 832 students.
Show answer & explanation
Correct answer: C
Answer: fork
Key idea: fork duplicates the calling process to create a new (child) process.
What fork does: creates a child process that is a copy of the parent (same code, data, and open file descriptors).
Return values: fork returns the child's process ID (positive integer) in the parent, returns 0 in the child, and returns -1 on error (setting errno).
Common usage: programs often call exec (one of the exec family) in the child after fork to run a different program; the parent may wait for the child using wait or waitpid.
Clarification: 'create', 'create new', and 'fork new' are not Unix system calls for creating processes. There is a file-creation call spelled creat (without the final 'e'), which creates files, not processes.
A video solution is available for this question — log in and enroll to watch it.