20

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

Anthon
  • 79,293
Ryan
  • 423

3 Answers3

14

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

slm
  • 369,824
4

Referring to ulimit man page, it's a bash shell command to control the rlimits of the system and a part of bash-builtins like printf, read, source, etc.

Referring getrlimits page, it represents the APIs via C/C++ using system calls to control system rlimits. Additional glibc documentation on explains rlimits (= resource limits) better.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
BHS
  • 281
2

ulimit can be two things:

Ciro Santilli OurBigBook.com
  • 18,092
  • 4
  • 117
  • 102