ulimit(2) CLIX ulimit(2)
NAME
ulimit - Gets and sets user process limits
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
long ulimit(
int cmd ,
long newlimit );
PARAMETERS
cmd Represents a command option.
newlimit Specifies a new value for command options which set limits.
DESCRIPTION
This function provides for control over process limits. The available
values for the cmd parameter are:
1 Get the regular 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.
2 Set the regular 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 root may increase the limit.
3 Get the maximum possible break value. (See brk().)
4 Get the current value of the maximum number of open files per process
configured in the system.
EXAMPLES
1. To get the current file size limit for regular files:
file_size_lim = ulimit(1,0);
2. To determine the maximum number of open files:
max_open_files = ulimit(4,0);
CAUTIONS
2/94 - Intergraph Corporation 1
ulimit(2) CLIX ulimit(2)
The ulimit() function is effective in limiting the growth of regular
files.
RETURN VALUES
Upon successful completion, a non-negative value is returned. Otherwise,
a value of -1 is returned and errno is set to indicate the error.
ERRORS
The ulimit() function fails and the limit is unchanged if one or both of
the following are true:
[EPERM] A process with an effective user ID other than root attempts to
increase its regular file size limit.
[EINVAL] The newlimit value is changed to exceed the file size limit of
2 gigabytes (4,194,304 blocks).
RELATED INFORMATION
Functions: brk(2), write(2)
2 Intergraph Corporation - 2/94