All Exams Test series for 1 year @ ₹349 only
Question

Match List I with List II

List I

List II

System calls

Description

A.

fork()

I.

Sends a signal from one process to another process

B.

exec()

II.

Indicates termination of the current process

C.

kill()

III.

Loads the specified program in the memory

D.

exit()

IV.

Creates a child process

Choose the correct answer from the options given below :

The correct answer is

A ‐ IV, B ‐ III, C ‐ I, D ‐ II

Understanding Operating System System Calls

System calls are the interface between a user program and the operating system. They allow user programs to request services from the kernel, such as creating processes, managing memory, and performing I/O operations. This question asks us to match common process-related system calls with their functions.

Matching OS System Calls to Their Functions

Let's analyze each system call provided in List I and match it with the correct description from List II.

  • fork(): This system call is used to create a new process, which is a copy of the calling process. The new process is called the child process, and the calling process is called the parent process. Therefore, fork() corresponds to "Creates a child process".
  • exec(): This system call replaces the current process's image with a new program. It loads the new program into the current process's memory space and starts its execution from the beginning. It does not create a new process; it replaces the existing one. Therefore, exec() corresponds to "Loads the specified program in the memory".
  • kill(): Despite its name, the kill() system call is not necessarily used to terminate a process (though it can be). Its primary function is to send a signal to a specified process. Signals are a form of inter-process communication (IPC) and can be used for various purposes, including notifying a process of an event or requesting it to terminate gracefully (like with SIGTERM) or forcefully (like with SIGKILL). Therefore, kill() corresponds to "Sends a signal from one process to another process".
  • exit(): This system call is used by a process to terminate itself. It performs necessary cleanup, such as closing open files, freeing memory, and informing the parent process about its termination status. Therefore, exit() corresponds to "Indicates termination of the current process".

Based on this analysis, we can establish the following correct matches:

System Call (List I) Description (List II)
A. fork() IV. Creates a child process
B. exec() III. Loads the specified program in the memory
C. kill() I. Sends a signal from one process to another process
D. exit() II. Indicates termination of the current process

This matching gives us the combination: A - IV, B - III, C - I, D - II.

Verifying the Option

Comparing our correct matching (A - IV, B - III, C - I, D - II) with the given options, we find that it matches one of the options precisely.

  • Option 1: A - II, B - III, C - IV, D - I (Incorrect)
  • Option 2: A - IV, B - III, C - I, D - II (Correct)
  • Option 3: A - IV, B - I, C - II, D - III (Incorrect)
  • Option 4: A - IV, B - III, C - II, D - I (Incorrect)

Thus, the correct option is the one listing A as IV, B as III, C as I, and D as II.

Revision Table: Key OS System Calls

System Call Primary Function Result
fork() Process creation Creates a new, identical child process
exec() Process replacement Replaces the current process image with a new program
kill() Signal sending Sends a signal to another process
exit() Process termination Causes the current process to terminate

Additional Information on Process Management

Process management is a core function of an operating system. It involves creating, scheduling, terminating, and coordinating processes. The system calls discussed above are fundamental to process management in Unix-like operating systems.

  • Process Creation: The fork() system call is the standard way to create a new process. After fork(), both the parent and child processes continue execution from the point of the fork() call. They typically differ based on the return value of fork() (0 for the child, process ID of the child for the parent).
  • Process Replacement: Often, a child process created by fork() needs to run a different program. The exec() family of system calls (like execve, execlp, etc.) is used for this. An exec() call overlays the new program image onto the existing process memory, and execution begins from the new program's entry point.
  • Process Termination: A process can terminate voluntarily by calling exit(), or it can be terminated involuntarily by a signal (e.g., receiving a SIGKILL signal) or by the operating system (e.g., due to a fatal error). The wait() system call is used by a parent process to wait for a child process to terminate and retrieve its exit status.
  • Inter-Process Communication (IPC) via Signals: Signals are a limited form of IPC used to notify a process of an event. The kill() system call sends a signal. Processes can install signal handlers to respond to specific signals, although some signals (like SIGKILL) cannot be caught or ignored.

Understanding these basic system calls is crucial for comprehending how programs execute and interact within an operating system environment.

Was this answer helpful?

Important Questions from Process

  1. A computer system has 7 tape drives. There are ‘n’ processes competing for them. Each process may need 2 tape drives. What is the maximum value of ‘n’ for which the system is guaranteed to be deadlock free?

  2. Identify the circumstances under which pre-emptive CPU scheduling is used:

    (a) A process switches from Running state to Ready state

    (b) A process switches from Waiting state to Ready state

    (c) A process completes its execution

    (d) A process switches from Ready to Waiting state

    Choose the correct option:

  3. Assuming that the system call fork () never fails, consider the following C programs P1 and P2 executed on a UNIX / Linux system:

    /*P1*/

    Int main() {

    fork ():

    fork () ;

    fork () ;

    Printf(“Happy\n”);

    }

    /*P2*/

    Int main() {

    fork ();

    Printf(“Happy\n”);

    fork ()

    Printf(“Happy\n”);

    fork () ;

    Printf(“Happy\n”);

    }

    Statement I: P1 displays "Happy" 8 times.

    Statement II: P2 displays "Happy" 12 times.

    In the light of the above statements, choose the correct answer from the options given below

  4. ________ system call creates new process in Unix.

  5. The processes that are residing in main memory and are ready and waiting to be executed, are kept on a list called

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App