ulimit(3) [ultrix man page]
ulimit(3) Library Functions Manual ulimit(3) Name ulimit - get and set user limits Syntax long ulimit (cmd, newlimit) int cmd; long newlimit; Description This function provides control over process limits. An explanation of the cmd values follow. Value Explanation 1 Get the process's file size limit. The limit is in units of 512-byte blocks and is inherited by child processes. Files of any size can be read. 2 Set the process's file size limit to the value of newlimit. Any process can decrease this limit, but only a process with an effec- tive user ID of superuser can increase the limit. The system call fails and the limit remains unchanged, if a process with an effective user ID other than superuser attempts to increase its file size limit. 3 Get the maximum possible break value. For further information, see Return Values Upon successful completion, a nonnegative value is returned. Otherwise, a value of -1 is returned, and errno is set to indicate the error. Diagnostics [EINVAL] Bad value for cmd. [EPERM] The effective user ID of the calling process is not superuser. See Also brk(2), write(2) ulimit(3)
Check Out this Related Man Page
ulimit(2) System Calls ulimit(2) NAME
ulimit - get and set process limits SYNOPSIS
#include <ulimit.h> long ulimit(int cmd, /* newlimit */...); DESCRIPTION
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 Return the soft file size limit of the process. The limit is in units of 512-byte blocks and is inherited by child pro- cesses. Files of any size can be read. The return value is the integer part of the soft file size limit divided by 512. If the result cannot be represented as a long int, the result is unspecified. UL_SETFSIZE Set the hard and soft file size limits for output operations of the process to the value of the second argument, taken as a long int. Any process may decrease its own hard limit, but only a process with appropriate privileges may increase the limit. The new file size limit is returned. The hard and soft file size limits are set to the specified value multiplied by 512. If the result would overflow an rlimit_t, the actual value set is unspecified. UL_GMEMLIM Get the maximum possible break value (see brk(2)). UL_GDESLIM Get the current value of the maximum number of open files per process configured in the system. RETURN VALUES
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. ERRORS
The ulimit() function will fail if: EINVAL The cmd argument is not valid. EPERM A process that has not asserted {PRIV_SYS_RESOURCE} in its effective set is trying to increase its file size limit. USAGE
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). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
brk(2), getrlimit(2), write(2), attributes(5), privileges(5), standards(5) SunOS 5.11 1 Feb 2003 ulimit(2)