Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Multiple Choice Questions
Q1031: Which system call is used to memory-map a file in a UNIX system?
- A: mmap()
- B: open()
- C: read()
- D: write()
View Answer
A
Q1032: What is the key advantage of memory-mapped files over traditional file I/O?
- A: Improved CPU performance
- B: Reduced disk access
- C: Increased file security
- D: Easy debugging
View Answer
B
Q1033: What happens when the page to be replaced is "dirty" in the example of effective access time calculation?
- A: It requires more time for swap
- B: It reduces page swap time
- C: It doesn't affect swap time
- D: None of the above
View Answer
A
Q1034: What operating systems commonly use the copy-on-write technique?
- A: Linux, Solaris 2, Windows 2000
- B: Windows XP, Windows 10
- C: Linux, macOS
- D: Windows 98, Linux
View Answer
A
Q1035: Which of the following operations is NOT a part of memory-mapped file usage?
- A: Initial access via demand paging
- B: Page fault handling
- C: Using mmap() to map file into memory
- D: Immediate file writes to disk
View Answer
D
Q1036: What happens when you close a memory-mapped file?
- A: Memory is freed immediately
- B: Memory-mapped data is written back to disk
- C: All pages are cleared
- D: Changes are not saved
View Answer
B
Q1037: Which system call is used to request the operating system to memory-map an opened file in UNIX?
- A: mmap()
- B: open()
- C: read()
- D: write()
View Answer
A
Q1038: When is vfork() particularly useful?
- A: When a child process must share its address space with the parent
- B: When the child process calls exec() immediately after creation
- C: When memory efficiency is less important
- D: None of the above
View Answer
B
Q1039: What is the result of using mmap() for file I/O?
- A: File I/O operations will always be faster than normal I/O
- B: Memory and file I/O become equivalent operations
- C: Files cannot be modified after being mapped
- D: None of the above
View Answer
B
Q1040: Which of the following is the correct system call for handling traditional file I/O in UNIX?
- A: mmap()
- B: open()
- C: read()
- D: write()
View Answer
B