A process tries to open its 2000th file descriptor. Its soft limit is 1024 and its hard limit is 4096. What can the process do?
AThe open() call fails; the process cannot open more file descriptors regardless
BThe process can raise its own soft limit to up to 4096 and retry the open() call
CThe process needs root privileges to open more file descriptors since it exceeded its limit
DThe kernel automatically kills the process for exceeding its resource limit
A process can raise its own soft limit up to the hard limit without special privileges. Since 2000 < 4096 (the hard limit), the process calls setrlimit() to raise its soft limit (e.g., to 4096), then the open() succeeds. Root is only required to raise the hard limit itself. The soft limit is the currently enforced ceiling, not an absolute cap.
Question 2 Multiple Choice
What is the key distinction between resource limits and process accounting?
ALimits control memory usage; accounting controls CPU time
BLimits are enforced by hardware; accounting is a software-only mechanism
CLimits proactively prevent resource exhaustion; accounting reactively records what was consumed
DLimits apply only to privileged processes; accounting applies to all processes
The fundamental distinction is proactive vs. reactive: limits cap resource consumption before damage occurs, while accounting records actual usage after the fact. Together they form a governance system — limits prevent abuse, accounting enables analysis, billing, and tuning. Neither substitutes for the other.
Question 3 True / False
A process can raise its own hard limit without administrator privileges if it needs more resources.
TTrue
FFalse
Answer: False
Hard limits are the absolute ceiling and can only be raised by the superuser (root). A process can freely adjust its soft limit up to the hard limit, but it cannot exceed the hard limit without root access. This two-tier design allows normal processes to tune their own behavior within safe bounds while preventing unprivileged processes from bypassing system-wide resource governance.
Question 4 True / False
Process accounting data can be used for capacity planning and usage-based billing on shared computing systems.
TTrue
FFalse
Answer: True
Accounting records CPU time consumed, I/O performed, page faults, and run durations per process. On shared systems — university clusters, cloud servers, corporate batch systems — this data directly enables administrators to answer 'which user consumed the most CPU this month?' and to bill accordingly. It also helps identify bottlenecks and unusual resource spikes.
Question 5 Short Answer
Why would an operating system use both resource limits and process accounting rather than relying on just one mechanism?
Think about your answer, then reveal below.
Model answer: Limits are proactive: they prevent a runaway process from exhausting resources before damage occurs. Accounting is reactive: it records what actually happened so administrators can tune limits, identify bottlenecks, and hold users accountable. They serve complementary roles — limits prevent abuse in real time, accounting enables analysis and enforcement after the fact. Neither alone is sufficient: limits without accounting give no visibility into usage patterns; accounting without limits allows damage before it can be analyzed.
The two mechanisms target different time horizons. Limits enforce policy in the present; accounting creates a historical record for the future. A well-governed multi-user system needs both: enforce fair usage now, understand actual usage patterns over time.