ulimit(2)
NAME
ulimit − get and set user limits
SYNTAX
long ulimit(cmd, newlimit)
int cmd;
long newlimit;
DESCRIPTION
The ulimit system call provides for control over process limits. The specified cmd can have the following values:
1Gets the file size limit of the process. The limit is in units of 512-byte blocks and is inherited by child processes. Files of any size can be read.
2Sets the file size limit of the process to the value of newlimit. Any process may decrease this limit, but only a process with an effective user ID of superuser may increase the limit.
3Gets the maximum possible break value. For further information, see brk(2).
RETURN VALUE
If successful, returns a non-negative value. If unsuccessful, returns a −1, and the global variable errno indicates the error code.
DIAGNOSTICS
The ulimit call will fail if:
[EPERM] A process with an effective user ID other than superuser attempts to increase its file size limit.