Linux – ulimit & rlimit in Linux, are they the same thing

kernellinuxperformanceresourcesulimit

I see people use the terms ulimit & rlimit interchangeably, can I say they are referring to the same thing?

Best Answer

I think the confusion comes from the fact that the underlying system call that ulimit wraps is called setrlimit.

excerpt from the ulimit man page

The ulimit() function shall control process limits. The process limits that can be controlled by this function include the maximum size of a single file that can be written (this is equivalent to using setrlimit() with RLIMIT_FSIZE).

Additionally if you look at the setrlimit man page the underlying data structure which contains the limit information is called rlimit.

excerpt from the setrlimit man page

getrlimit and setrlimit get and set resource limits respectively. Each resource has an associated soft and hard limit, as defined by the rlimit structure (the rlim argument to both getrlimit() and setrlimit()):

struct rlimit {
    rlim_t rlim_cur;   /* Soft limit */
    rlim_t rlim_max;   /* Hard limit (ceiling 
                          for rlim_cur) */
};

References

Related Question