What is the primary effect of invoking a file-close system call on an open…
2025
What is the primary effect of invoking a file-close system call on an open file descriptor or handle?
- A.
It renames the file on disk to signal that it's no longer in use.
- B.
It flushes any buffered output, releases kernel resources, and invalidates the descriptor for further I/O.
- C.
It immediately frees the memory occupied by the file's data in user space.
- D.
It deletes the file from the file system once all operations are done.
Attempted by 56 students.
Show answer & explanation
Correct answer: B
When a program invokes a file-close system call, the operating system performs cleanup operations related to the open file descriptor or handle. Any buffered output data is flushed to storage, kernel resources associated with the file are released, and the descriptor becomes invalid for future read/write operations. This helps maintain resource efficiency and data consistency.