GETRLIMIT(3)

NAME
getrlimit - query resource consumption limits

SYNOPSIS
#include <sys/resource.h>
int getrlimit(int resource, struct rlimit *rlp);

DESCRIPTION
getrlimit queries the current resource limit regarding the specified resource. This can be one of the following: RLIMIT_CORE, RLIMIT_CPU, RLIMIT_DATA, RLIMIT_FSIZE, RLIMIT_NOFILE, RLIMIT_STACK or RLIMIT_AS. The soft limit is specified in rlp->rlim_cur and the hard limit in rlp->rlim_max. On MINIX, these are currently always the same. A value of RLIM_INFINITY specifies that no limit is enforced, although architectural limits may still apply.

RETURN VALUE
If the function succeeds, 0 is returned. If the function fails, -1 is returned and errno is set to indicate the cause of the failure.