GETRLIMITUSAGE(2)
β¨ getrlimitusage(2) β from the System Calls Manual, with main character energy π
πΈ NAME πΈ
getrlimitusage β query usage of the current process' limited resources
π LIBRARY π
Standard C Library (libc, -lc) β your fave, no cap π
π¦ SYNOPSIS π¦
#include <sys/resource.h>
int
getrlimitusage(unsigned which, int flags, rlim_t *res);
π DESCRIPTION π
The getrlimitusage system call lets the process query current consumption of the resources limited by the setrlimit(2) call. It's literally giving resource vibe check, fr fr β¨
The which argument specifies the resource, same as for getrlimit(2) and setrlimit(2) calls, see their man page for the list of enforced resource types. So yeah bestie, which picks the resource, and those man pages have the full roster π
The flags argument modifies the behavior of the call in the following ways:
GETRLIMITUSAGE_EUIDβ query the resource usage for user identified by effective UID of the process, instead of the real UID (which is default for accounting).
π RETURN VALUES π
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error. So like, 0 is the slay outcome; -1 means go check errno, bestie π
π ERRORS π
The getrlimitusage() system call will fail if:
[EFAULT]β The address specified forresis invalid.[EINVAL]β The resource specified togetrlimitusage()in thewhichargument is unknown.[ENXIO]β The resource specified togetrlimitusage()in thewhichargument is not accounted, but only enforced in specific situations. Examples of such resources areRLIMIT_FSIZEandRLIMIT_CORE.
π«Ά SEE ALSO π«Ά
π HISTORY π
The getrlimitusage() system call appeared in FreeBSD 14.2. Periodt π
Source/version tea: Debian π β dated October 24, 2025. That's the whole GETRLIMITUSAGE(2) moment, bestie; go query those limits responsibly β¨π¦π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2024 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms