ulimit(3) — Subroutines
OSF
NAME
ulimit − Sets and gets user limits
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <ulimit.h>
long ulimit (
int command,
off_t new_limit,
... );
PARAMETERS
command
Specifies the form of control. The command parameter values follow:
UL_GETFSIZE ()
Returns the process file size limit. The limit is in units of UBSIZE blocks (see the sys/param.h file) and is inherited by child processes. Files of any size can be read.
UL_SETFSIZE ()
Sets the process file size limit for output operations to the value of the new_limit parameter, and returns the new file size limit. Any process can decrease this limit, but only a process with the SEC_LIMIT system privilege can increase the limit.
GET_GETBREAK ()
Returns the maximum possible break value (described in the brk() and sbrk() functions).
new_limit
Specifies the new limit. The value of the new_limit parameter depends on the command parameter value that is used.
DESCRIPTION
The ulimit() function controls process limits.
With remote files, the ulimit() function values of the client node or local node are used.
NOTES
The ulimit() function is implemented in terms of setrlimit(); therefore, the two interfaces should not be used in the same program. The result of doing so is undefined.
AES Support Level: Trial use
EXAMPLE
To increase the size of the stack segment by 2048 bytes, and set the rc variable to the new lowest valid stack address, enter:
rc = ulimit(1006, ulimit(1005, 0) - 2048);
RETURN VALUES
Upon successful completion, a nonnegative value is returned. If the ulimit() function fails, a value of -1 is returned and errno is set to indicate the error.
ERRORS
If the ulimit() function fails, the limit remains unchanged and errno may be set to one of the following values:
[EPERM] A process without appropriate system privilege attempts to increase the file size limit.
[EINVAL] The command parameter is invalid.
RELATED INFORMATION
Functions: brk(2), getrlimit(2), pathconf(3), write(2)