ulimit(2)
_________________________________________________________________
ulimit System Call
Get and set user limits.
_________________________________________________________________
SYNTAX
long ulimit (cmd, newlimit)
int cmd;
long newlimit;
PARAMETERS
cmd Specifies which of several user limit related
operations to perform.
newlimit A argument to the user limit operation. Its
specific meaning depends upon the <cmd> argument.
DESCRIPTION
This system call controls various per-process limits. The <cmd>
argument specifies which of several operations to perform as
described below:
1 Get the calling process's file size limit. The file size
limit is the maximum logical offset within a file at which
the process can perform a write operation. The limit is in
units of 512-byte blocks. The <newlimit> argument is
ignored and need not be present. This option is the same as
the hard RLIMIT_FSIZE in getrlimit.
2 Set the file size limit of the process to <newlimit>. A
process may not increase its file size limit unless it has
an effective-user-id of 0 (i.e., is super-user). <Newlimit>
may be any positive or negative integer. This option is the
same as the hard RLIMIT_FSIZE in setrlimit with the soft
RLIMIT_FSIZE set to RLIM_INFINITY.
3 Get the maximum possible break value for the calling
process. The <newlimit> argument is ignored and need not be
present.
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
ulimit(2)
4 Get the maximum number of open files allowed per process.
ACCESS CONTROL
The following access restrictions apply, depending on the value
of <cmd>:
1 None.
2 If <newlimit> is greater than the current value of the file
size limit, the effective-user-id of the calling process
must be 0 for the call to succeed. Otherwise the limit is
unchanged and an EPERM error is returned.
3 None.
4 None.
RETURN VALUE
If <cmd> has the value 1, the return value is as follows:
0..FILESIZE The return value is always the current value of
the calling process's file size limit.
If <cmd> has the value 2, the return value is as follows:
0..FILESIZE Successful completion. The new file size limit is
returned.
-1 An error occurred. Error is set to indicate the
error.
If <cmd> has the value 3, the return value is as follows:
0..MAXBRK The return value is always the calling process's
maximum possible break value.
If <cmd> has the value 4, the return value is as follows:
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
ulimit(2)
NOFILE The return value is always NOFILE as defined in
param.h.
If <cmd> is anything other than the above values, -1 is returned
and errno is set to EINVAL.
EXCEPTIONS
Errno may be set to one of the following error codes:
EPERM The calling process is trying to increase its file
size limit and does not have an effective-user-id
of 0.
EINVAL The value of <cmd> was not 1, 2, 3, or 4.
SEE ALSO
The related system calls: getrlimit, setrlimit, brk, write.
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)