CS FundamentalsVery hardGATE CS
In a traditional Unix file system (such as ext2/ext4 without very large directories), directory /d contains 3 subdirectories and 5 regular files. What is the hard-link count of /d?
- A. 5
- B. 2
- C. 8
- D. 10
Correct answer: A. 5
A directory is linked from its parent's entry and from its own '.', which gives 2, and each subdirectory's '..' adds one: 2 + 3 = 5. Regular files inside do not add links to the directory.
More Operating Systems questions
- A process with umask 027 creates a regular file requesting mode 0666 and a directory requesting mode 0777. What permissions do they get?
- A process writes to a pipe whose read end has been closed by every process. What happens by default?
- A device raises 10,000 interrupts per second, and each interrupt costs 50 µs of CPU time to enter, service and return. What fraction of…
- A file is stored with linked allocation (each block holds a pointer to the next) and nothing is cached. How many disk reads does it take…
- Requests arrive at a server at 20 per second, and Little's law applies in steady state. If on average 6 requests are in the system, what…
- Pages are 4 KB and a process has 3 frames. It runs for (i = 0; i < 1024; i++) for (j = 0; j < 1024; j++) A[i][j] = 0; on an int…