Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
GETRLIMITUSAGE(2)	       System Calls Manual	       GETRLIMITUSAGE(2)

NAME
     getrlimitusage -- Query usage of the current process' limited resources

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <sys/resource.h>

     int
     getrlimitusage(unsigned which, int flags, rlim_t *res);

DESCRIPTION
     The getrlimitusage system call allows the process to query current consump-
     tion of the resources limited by the setrlimit(2) call.

     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.

     The flags argument modifies the behavior of the call in the following ways:

     GETRLIMITUSAGE_EUID    Query  the resource usage for user identified by ef-
			    fective 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.

ERRORS
     The getrlimitusage() system call will fail if:

     [EFAULT]		The address specified for res is invalid.

     [EINVAL]		The  resource specified to getrlimitusage() in the which
			argument is unknown.

     [ENXIO]		The resource specified to getrlimitusage() in the  which
			argument is not accounted, but only enforced in specific
			situations.  Examples of such resources are RLIMIT_FSIZE
			and RLIMIT_CORE.

SEE ALSO
     procstat(1), getrlimit(2), setrlimit(2)

HISTORY
     The getrlimitusage() system call appeared in FreeBSD 14.2.

FreeBSD ports 15.quarterly	October 24, 2025	       GETRLIMITUSAGE(2)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=getrlimitusage&sektion=2&manpath=FreeBSD+15.1-RELEASE+and+Ports.quarterly>

home | help