Question:

Which is true about the fork ( ) system call ?

Show Hint

Think of fork() like a biological cell division. One process splits into two identical "cells" (processes). Use the return value to tell them apart: 0 for the child, and the Child's PID for the parent.
Updated On: Jun 6, 2026
  • It allocates memory
  • It creates a child process
  • It creates a program
  • It creates machine code
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

The fork() system call is one of the most fundamental operations in UNIX-like operating systems for process management. 1. Primary Function: When a process calls fork(), the operating system creates a new process. This new process is called the child process, and the process that initiated the call is the parent process. 2. Mechanism of fork(): The child process is an exact duplicate of the parent process. It inherits:
• The parent's address space (code, data, and stack).
• Open file descriptors.
• Environment variables. After the call, both processes continue execution from the instruction immediately following the fork() call. 3. Why other options are incorrect:
(1) Memory Allocation: While fork() requires the OS to allocate memory for the new process, its primary purpose is process creation. malloc() is specifically for memory allocation.
(3) Program Creation: Programs are files on a disk. fork() creates a running instance (process).
(4) Machine Code: Machine code is created by compilers, not system calls.
Was this answer helpful?
0
0

Top CUET PG Data Science A.I Cyber Security and Computer Sci. Questions

View More Questions

Top CUET PG Operating Systems Questions

View More Questions