Granularity of resource limits

In the previous example with dd(1), we saw that we can indeed impose a limit upon the maximum file size. An important question arises: what is the scope or granularity of the resource limit? Is it system-wide?

The short answer: no, it's not system-wide, it's process-wide, implying that the resource limits apply at the granularity of a process and not the system. To clarify this, consider two shellsnothing but the bash processshell A and shell B. We modify the maximum file-size resource limit for shell A (with the usual ulimit -f <new-limit> command), but leave the resource limit for maximum file size for shell B untouched. If now they both use dd (as we did), we would find that the dd process invoked within ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.