🎓 BookMCQ
← Back to 2. Operating System Structure

📝 Types of System Calls in operating system (30 MCQs)

Functional Categories of Operating System System Calls

System calls are commonly classified according to the operating system services they request. Major categories include process control, file management, device management, information maintenance, communication, and protection. Each category connects applications with a specific kernel responsibility, allowing programs to create processes, manipulate files, access devices, obtain system information, exchange data, and enforce controlled resource access through standard programming interfaces.

Why System Calls Are Classified by Their Operations

Applications perform different activities and therefore require distinct kernel facilities. Separating system calls into functional categories clarifies their purpose and supports organised programming interfaces. Process operations must manage execution and resources, while file operations concern persistent data and communication calls exchange information. These categories describe service purposes rather than requiring every operating system to implement identical names or interfaces.

Process, File, Device, Information, and Communication Calls

Process-control calls create, execute, and terminate processes; file-management calls open, read, write, and close files. Device-management calls request device operations or configuration. Information-maintenance calls retrieve system data and update attributes. Communication calls establish channels and transfer messages, while protection calls manage permissions and access rights. Their implementation depends on the operating system and supported hardware.

Combining Process Control and File Management Operations

Consider a Unix-like application that creates a child process using fork(), executes another program using exec(), and waits using wait(). The running program may then open a file through open(), retrieve data through read(), and close it through close(). These operations illustrate different system-call categories collaborating within one application workflow.

System Call Categories and Application Requirements

These categories support virtually every application, from text editors and databases to network servers and administrative utilities. Their separation allows specialised kernel subsystems to manage different resources. However, a system-call category does not guarantee identical behaviour across platforms, and some operations require multiple calls. Excessive system-call activity can also increase privilege-transition and processing overhead.

Misconceptions About System Call Classification

'Every file operation belongs to process control' is incorrect because file management handles file access and modification. 'Communication calls only work across different computers' is incorrect because processes can communicate on one machine. 'System calls in one category always have identical names across operating systems' is incorrect because interfaces differ between platforms.

Exam Focus: Classifying System Calls by Function

Practise assigning operations to process control, file management, device management, information maintenance, communication, and protection. Recognise examples such as fork(), exec(), wait(), open(), read(), write(), and close() in Unix-like systems. Questions may ask you to identify the appropriate category, distinguish related operations, or trace several calls within a process and file-handling sequence.

Key Terms of System Call Categories

  • Process control - Manages process execution and termination.
  • File management - Controls file operations.
  • Device management - Requests device operations.
  • Information maintenance - Retrieves or updates system information.
  • Communication - Exchanges data between processes.
  • Protection - Controls resource permissions.
10
Easy
10
Medium
10
Hard

📝 All Types of System Calls in operating system MCQs

Q1. A word-processing application creates a child process to handle printing, waits for that process to finish, and then continues editing. Which system-call category covers these operations?

A.File management
B.Process control ✅
C.Device management
D.Information maintenance
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Process-control calls create, execute, synchronize, and terminate processes. Operations such as fork(), wait(), and exit() control execution and relationships between processes. They let programs manage their lifecycle through controlled kernel services.

Q2. A backup program needs to create a destination file, read the source, write copied bytes, and close both files. Which category supplies these operations?

A.Communication
B.Protection
C.File management ✅
D.Information maintenance
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: File-management calls support creating, opening, reading, writing, repositioning, closing, and deleting files. A backup utility uses these operations to access file contents and maintain the destination copy safely through standard operating-system interfaces.

Q3. A printer utility asks the operating system to reserve a printer, send data to it, and release it afterward. Which category best describes these requests?

A.Device management ✅
B.Process control
C.Information maintenance
D.File management
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Device-management calls request, release, read, write, or configure hardware devices. The operating system coordinates access to the printer and controls it through a protected driver interface, preventing applications from directly controlling shared hardware.

Q4. A monitoring utility requests the current process identifier and the current system time. Which system-call category provides this type of data?

A.Communication
B.File management
C.Protection
D.Information maintenance ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: Information-maintenance calls obtain or update system and process attributes, including identifiers, time, date, and system information. They report administrative facts without directly transferring file data or creating processes, supporting monitoring and system administration.

Q5. Two processes on the same computer need to exchange messages through a kernel-managed message queue. Which system-call category is involved?

A.Device management
B.Communication ✅
C.Process control
D.File management
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Communication calls allow processes to exchange information using mechanisms such as pipes, message queues, sockets, or shared memory. A message queue provides kernel-managed delivery between cooperating processes without requiring direct access to each other's memory.

Q6. An administrator changes a file's access permissions so that ordinary users can read it but cannot modify it. Which system-call category is most directly involved?

A.Protection ✅
B.Communication
C.Process control
D.Device management
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Protection calls control access to resources by checking identities, permissions, and privileges. Changing a file's access mode alters which operations users may perform, helping enforce the system's security policy across users and processes.

Q7. A command interpreter launches an application by creating a process and loading a program into it. Which pair of operations is most closely associated with this task?

A.read() and write()
B.chmod() and access()
C.fork() and exec() ✅
D.send() and receive()
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Process creation and program replacement are commonly performed with fork() followed by exec(). The first creates a child process, while the second loads a new executable image into that process.

Q8. A program needs to determine whether a file exists and retrieve its size and modification time without reading its contents. Which operation is most appropriate?

A.A process wait operation
B.A file-attribute query such as stat() ✅
C.A device-release operation
D.A message-send operation
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: A file-attribute query such as stat() retrieves metadata including file type, size, permissions, and timestamps. It obtains these attributes without reading file data, keeping metadata inspection separate from content transfer through the file interface.

Q9. A process wants to send a short block of data to another process through a pipe. Which operation does the sending process normally use?

A.read() on the pipe's read end
B.wait() on the receiving process
C.write() on the pipe's write end ✅
D.chmod() on the pipe
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: A process sends data through a pipe by writing bytes to its write end. The receiving process obtains those bytes by reading from the corresponding read end, using the operating system's communication mechanism.

Q10. A system utility asks the operating system to return the machine's host name and kernel release information. Which category includes this request?

A.Information maintenance ✅
B.Device management
C.Process control
D.Protection
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Information-maintenance calls retrieve system-wide attributes such as host name, operating-system release, and resource information. These requests provide descriptive system data rather than changing process execution or transferring application files, supporting diagnostics and administration.

Q11. A media application opens a large video file, reads several blocks, then needs to continue from a known byte position. Which file-related operation supports changing the current offset?

A.lseek() or an equivalent file-positioning call ✅
B.fork()
C.ioctl() only
D.getpid()
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A file-positioning call changes the offset associated with an open file description. The application can then read from a selected location without sequentially consuming every preceding byte, which is useful for random-access workloads.

Q12. A camera application must obtain exclusive access to a camera, configure its capture mode, and then release it. Which classification best fits the key system requests?

A.File management only
B.Device management ✅
C.Information maintenance only
D.Process control only
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The camera is a hardware device, so reserving it, configuring its mode, and releasing it are device-management operations. The kernel mediates these requests to coordinate access and protect device state.

Q13. A system-management tool changes a process's scheduling priority and retrieves its resource-usage statistics. Which interpretation is most accurate?

A.Both operations are file-content transfers
B.Both operations are communication operations
C.They are process or information attribute operations, respectively ✅
D.Both operations are device-release operations
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Changing a process priority modifies a process attribute, while retrieving resource usage obtains accounting information. System interfaces classify requests by the resource or information being controlled, not merely by the program making them.

Q14. A developer creates a socket, connects it to a remote server, sends a request, and receives a response. Which system-call category primarily supports this sequence?

A.Communication ✅
B.Protection
C.Information maintenance
D.Process termination
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Socket operations establish endpoints and exchange data between processes, often across different computers. Creating, connecting, sending, and receiving through sockets are communication services provided by the operating system for networked applications.

Q15. A file server checks a user's identity and access rights before allowing a write request. Which system-call concern is central to this check?

A.Process creation
B.Protection and access control ✅
C.Device configuration
D.System time maintenance
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Protection mechanisms verify whether a subject is permitted to perform a requested operation on a resource. Checking identity and write permissions prevents unauthorized modification even when a valid file descriptor is supplied.

Q16. A parent process opens a log file and then creates a child using fork(). The child writes to the inherited descriptor. Which statement best describes the relationship?

A.The child automatically receives an unrelated file with a separate offset
B.The descriptor is always closed during process creation
C.The child may inherit a descriptor referring to the same open-file description ✅
D.The child receives the parent's process identifier as its file descriptor
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: After fork(), the child inherits copies of the parent's descriptors. Corresponding descriptors can refer to the same open-file description, so they may share the current file offset and status flags.

Q17. A student classifies stat() as a file-reading call because it returns a file's size. What is the conceptual mistake?

A.It confuses metadata retrieval with transferring file-content bytes ✅
B.It confuses process creation with process termination
C.It treats a device request as a network message
D.It assumes file permissions are stored in CPU registers
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: stat() retrieves metadata describing a file, such as size, timestamps, and permissions. It does not transfer the file's contents; reading data bytes is a separate file-management operation that returns actual file data.

Q18. A monitoring trace shows: getpid() returns 812 ; time() returns 1795171200 ; uname() returns system information. Which category best groups all three calls?

A.Device management
B.Information maintenance ✅
C.Communication
D.File management
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: getpid(), time(), and uname() provide process or system attributes rather than transferring application data. They are information-maintenance operations because their primary purpose is retrieving information about execution or the system.

Q19. A process calls open() and receives descriptor 3, then calls read() and receives 20, followed by close() returning success. What do the three calls accomplish, in order?

A.Create a process, send a message, and terminate it
B.Reserve a device, configure it, and release it
C.Open a file, transfer 20 bytes, and release the descriptor ✅
D.Retrieve system time, change permissions, and query a process ID
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: open() establishes access and returns a descriptor, read() reports the number of bytes transferred, and close() releases the descriptor. The return value 20 indicates that twenty bytes were read successfully.

Q20. A server uses shared memory for high-volume communication between two local processes. Which additional requirement is especially important?

A.Disable all file-management system calls
B.Coordinate concurrent access using synchronization mechanisms ✅
C.Give both processes unrestricted kernel memory access
D.Convert the shared region into a printer device
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Shared memory avoids repeated message copying, but both processes can access the same data concurrently. Mutexes, semaphores, or other synchronization mechanisms are needed to prevent races and maintain consistent shared state.

Q21. A service runs with elevated privileges and accepts a user-supplied file path. It checks the file's permissions, then opens the path in a separate system call. What security issue can arise if the path is changed between the calls?

A.A time-of-check to time-of-use race can make the opened object differ from the checked object ✅
B.The process identifier is automatically reassigned
C.The file's contents are converted into process attributes
D.The device driver must release every open file
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Separating authorization from the actual open creates a time-of-check to time-of-use race. An attacker may replace a path component after checking, causing the privileged service to open an unintended object.

Q22. A network server executes socket(), bind(), listen(), accept(), recv(), and send(). Which grouping correctly describes the purpose of these calls?

A.File metadata management followed by process termination
B.Communication endpoint setup followed by data exchange ✅
C.Device reservation followed by information maintenance
D.Protection checks followed by memory allocation only
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: socket(), bind(), listen(), and accept() establish and manage a communication endpoint. recv() and send() exchange data over that endpoint, combining connection management and data transfer within the operating system's networking interface.

Q23. A program creates a shared-memory object, attaches it to its address space, accesses the shared region, and later detaches it. Which sequence of conceptual operations is represented?

A.Process termination, file deletion, and device release
B.System-information retrieval followed by priority adjustment
C.Shared-memory creation, mapping, access, and detachment ✅
D.File reading followed by directory enumeration
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Shared-memory interfaces create a region, map or attach it into a process address space, permit shared access, and detach it when no longer needed. Separate cleanup calls may remove the shared object after users finish.

Q24. A student says chmod() transfers file contents because it changes what users can do with a file. Which correction is technically accurate?

A.chmod() changes permission metadata; read() and write() transfer file contents ✅
B.chmod() creates a new process; fork() changes file permissions
C.chmod() sends messages; send() changes file ownership
D.chmod() configures hardware; ioctl() retrieves process identifiers
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: chmod() changes permission bits associated with a file, affecting authorization decisions. File-content transfer is performed by calls such as read() and write(), while permission changes operate on metadata rather than the stored data.

Q25. A resource manager must allow a process to change its user identity from a privileged identity to an ordinary identity after setup. Which system-call area is most directly involved?

A.Communication only
B.Protection and privilege management ✅
C.File positioning only
D.Device data transfer only
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Identity and privilege-management interfaces control credentials used in access checks. Changing user or group identity can reduce a process's authority after privileged initialization, according to the operating system's credential and authorization rules.

Q26. A utility records this trace: chmod(file, 0640) succeeds ; stat(file) reports permissions 0640 ; read(file) returns 12 bytes. Which interpretation correctly distinguishes the calls?

A.All three calls transfer file contents
B.chmod changes access metadata, stat retrieves metadata, and read transfers data bytes ✅
C.chmod retrieves system time, stat creates a process, and read configures a device
D.stat changes permissions, while chmod returns the file's contents
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: chmod() updates access permissions, stat() retrieves file attributes, and read() transfers file data. These calls act on authorization metadata, descriptive metadata, and content bytes, respectively, keeping three distinct file operations separate.

Q27. A process requests a device-specific operation through ioctl(), then uses read() to obtain data from the same device. Why are both operations useful?

A.ioctl() configures or queries device-specific behavior, while read() transfers data ✅
B.Both calls always perform identical byte transfers
C.read() changes process credentials, while ioctl() creates a child
D.ioctl() replaces the device driver and read() terminates it
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: ioctl() handles device-specific control functions such as setting modes or querying status. read() retrieves data from the device stream or buffer, so control and data-transfer operations have distinct purposes defined by the device driver.

Q28. A communication trace contains these events: Process A creates a pipe ; A writes 9 bytes ; Process B reads 4 bytes ; B reads 5 bytes ; A closes its write end. How many bytes remain unread after the second read?

A.0 bytes ✅
B.4 bytes
C.5 bytes
D.9 bytes
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The first read consumes four of the nine bytes, leaving five. The second read consumes those remaining five bytes, so the pipe buffer contains no unread data after the second successful read.

Q29. A process requests access() on a pathname and receives permission to read it. Before the process later opens the file, its permissions are changed. Which principle should a secure application follow?

A.Treat the earlier access() result as permanent authorization
B.Rely on the actual operation's kernel permission checks and handle failure ✅
C.Skip open() because access() already returned success
D.Assume pathname permissions cannot change while a process runs
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: An access() check is only a point-in-time test and does not reserve the object or guarantee a later operation will succeed. The actual open or read must still be checked by the kernel.

Q30. A privileged server must create a child, communicate a job description to it, obtain the child's completion status, and record the completion time. Which mapping of operations to system-call categories is correct?

A.Process control for creation and waiting, communication for job transfer, and information maintenance for time retrieval ✅
B.File management for all operations because the job may be stored
C.Device management for creation, protection for communication, and file management for time
D.Information maintenance for process creation, communication for waiting, and process control for time retrieval
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Creating and waiting for a child are process-control tasks, transferring its job description is communication, and retrieving completion time is information maintenance. Separating requests by purpose clarifies the system services involved.

🔗 Related Topics (MCQs)