Which Unix/Linux system call creates a new process by duplicating the calling process?

Prepare for the GATE General Aptitude and CS Test. Study with comprehensive multiple-choice questions, each equipped with hints and explanations. Master your exam!

Multiple Choice

Which Unix/Linux system call creates a new process by duplicating the calling process?

Explanation:
In Unix-like systems, the call that creates a new process by duplicating the calling process is fork. When you fork, the operating system makes a new process—the child—that is almost an exact copy of the parent at that moment. Both processes continue execution from right after the fork, but they have separate process contexts. The return value lets you tell them apart: the parent receives the child’s process ID, while the child receives zero. If something goes wrong, the call returns a negative value. This is different from the other system calls. Exec does not create a new process; it replaces the current process image with a new program. Kill sends a signal to one or more processes, not creating new ones. Wait makes the calling process pause until a child changes state (like finishing), again without creating anything new.

In Unix-like systems, the call that creates a new process by duplicating the calling process is fork. When you fork, the operating system makes a new process—the child—that is almost an exact copy of the parent at that moment. Both processes continue execution from right after the fork, but they have separate process contexts. The return value lets you tell them apart: the parent receives the child’s process ID, while the child receives zero. If something goes wrong, the call returns a negative value.

This is different from the other system calls. Exec does not create a new process; it replaces the current process image with a new program. Kill sends a signal to one or more processes, not creating new ones. Wait makes the calling process pause until a child changes state (like finishing), again without creating anything new.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy