I see people use the terms ulimi
t & rlimit
interchangeably, can I say they are referring to the same thing?
-
Related: ulimit: difference between hard and soft limits – slm Jun 25 '13 at 16:06
3 Answers
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
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.

- 56,709
- 26
- 150
- 232

- 281
ulimit
can be two things:
a POSIX 7 C API interface that was deprecated in favor of
getrlimit()
: http://pubs.opengroup.org/onlinepubs/9699919799/functions/ulimit.htmlApplications should use the getrlimit() or setrlimit() functions instead of the obsolescent ulimit() function.
This was not the case when
sim
answered on POSIX 6.On GNU/Linux,
getrlimit()
andulimit()
are implemented with thesys_getrlimit
system call. There is nosys_ulimit
.a non-deprecated POSIX 7 CLI utility: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ulimit.html
It can be implemented with either
ulimit()
orgetrlimit()
.

- 18,092
- 4
- 117
- 102