Question:

In UNIX, which system call is used for inter process communication via shared memory ?

Show Hint

UNIX IPC calls often start with the resource type: shm for Shared Memory, msg for Message Queues, and sem for Semaphores.
Updated On: Aug 6, 2026
  • pipe ( )
  • msgget ( )
  • shmget ( )
  • semctl ( )
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Concept:
• Inter-Process Communication (IPC) refers to the mechanisms provided by an operating system to allow processes to manage shared data.
• System V IPC in UNIX provides three main mechanisms: Message Queues, Semaphores, and Shared Memory.

Step 1:
Identify the function of each provided system call

pipe(): Creates a unidirectional data channel that can be used for interprocess communication. It does not involve "shared memory" in the architectural sense.
msgget(): Used to get a message queue identifier. This belongs to the Message Queue IPC mechanism.
semctl(): Provides semaphore control operations (like initialization or deletion). This belongs to the Semaphore IPC mechanism.
shmget(): Stands for "shared memory get". It is used to allocate a System V shared memory segment.

Step 2:
Explain the Shared Memory workflow in UNIX
To use shared memory, a process typically follows these steps:
shmget(): Create the segment and get a unique ID.
shmat(): Attach the memory segment to the process's address space.
shmdt(): Detach the segment when finished.
shmctl(): Delete or modify the segment.

Step 3:
Conclusion
Among the options, shmget() is the primary system call associated with establishing shared memory IPC.
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