ULIMIT(2) | System Calls | ULIMIT(2) |
ulimit - get and set process limits
#include <ulimit.h> long ulimit(int cmd, /* newlimit */...);
The ulimit() function provides for control over process limits. It is effective in limiting the growth of regular files. Pipes are limited to PIPE_MAX bytes.
The cmd values, defined in <ulimit.h>, include:
UL_GETFSIZE
UL_SETFSIZE
UL_GMEMLIM
UL_GDESLIM
Upon successful completion, ulimit() returns the value of the requested limit. Otherwise, −1 is returned, the limit is not changed, and errno is set to indicate the error.
The ulimit() function will fail if:
EINVAL
EPERM
Since all return values are permissible in a successful situation, an application wishing to check for error situations should set errno to 0, then call ulimit(), and if it returns −1, check if errno is non-zero.
The getrlimit() and setrlimit() functions provide a more general interface for controlling process limits, and are preferred over ulimit(). See getrlimit(2).
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Standard |
brk(2), getrlimit(2), write(2), attributes(7), privileges(7), standards(7)
February 1, 2003 | OmniOS |