News for hackers. Stuff that matters.
Re:Linux-insides: Limits on resources in Linux by LukeShu on Sunday July 30, 2017 @04:10PM (#14887555)
While what you said is true in general; ulimit is usually not a separate program. It modifies the state of the current process (similarly to `cd`), so it has to be built-in.

Now, there's no solid reason why it couldn't work like `unshare` or `chroot` (which also wrap operations that modify the current process), and spawn a second child shell with the modified properties. But, that isn't how it works on any system I have ever used, isn't what users expect, and isn't in conformance with POSIX.

To quote POSIX: Since `ulimit` affects the current shell execution environment, it is always provided as a shell regular built-in.

Re:Linux-insides: Limits on resources in Linux by akira2501 on Sunday July 30, 2017 @06:42PM (#14888263)
> so it has to be built-in.

We have fork() and exec(), and resource limits carry across exec(), so it does not /have/ to be a built-in.