CS FundamentalsVery hardGATE CS
A directory has 3 entries named a, b and c that are hard links to the same inode, and the directory itself has 2 subdirectories. What are the link counts of the shared inode and of the directory (classic Unix, counting '.' and '..')?
- A. 3 and 4
- B. 1 and 2
- C. 3 and 2
- D. 1 and 4
Correct answer: A. 3 and 4
Each hard link adds one to the file's count: 3. A directory's count is 2 (its entry in the parent plus its own '.') plus one for each subdirectory's '..': 2 + 2 = 4.
More Operating Systems questions
- Which statement about mounting is correct?
- The virtual file system (VFS) layer in Unix-like kernels exists mainly to:
- Which kind of I/O call returns immediately and later notifies the process (e.g. via a signal, callback or completion queue) when the data…
- An interrupt handler is split into a top half and a bottom half (e.g. softirq, tasklet, workqueue). Why?
- Which is a valid reason for a device driver to use polling instead of interrupts?
- What is the main purpose of the I/O MMU (IOMMU) in modern systems?