CS FundamentalsModerateGATE CS · Amazon/Microsoft SDE MCQ
A process with umask 027 creates a regular file requesting mode 0666 and a directory requesting mode 0777. What permissions do they get?
- A. 0640 and 0750
- B. 0644 and 0755
- C. 0640 and 0751
- D. 0646 and 0757
Correct answer: A. 0640 and 0750
The umask bits are cleared: 0666 & ~027 = 0640 (rw-r-----) and 0777 & ~027 = 0750 (rwxr-x---). The umask is masked out, not subtracted digit by digit, though here both give the same.
More Operating Systems questions
- 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…
- Which statement about the difference between an unsafe state and a deadlocked state (Banker's algorithm) is correct?