ulimit(2) DG/UX R4.11MU05 ulimit(2)
NAME
ulimit - get or set process limits
SYNOPSIS
#include <sys/ulimit.h>
long ulimit (cmd, newlimit)
int cmd;
long newlimit;
where:
cmd is one of the constants listed below, specifying the
operation to perform
newlimit may specify a new maximum file size limit
DESCRIPTION
Use ulimit to get or set a limit, indicated by cmd, for the calling
process. Except for the set operation, the newlimit argument is
ignored and may be omitted. The operations are listed and explained
below:
cmd Description
GET_ULIMIT or UL_GETFSIZE
Get the current file size limit (the maximum
logical offset beyond which writing is not
allowed) for the calling process. The size is
in units of 512-byte blocks. (To get the size
in bytes, you can use getrlimit(2) with the
RLIMIT_FSIZE argument.)
SET_ULIMIT or UL_SETFSIZE
Set the file size limit of the process to
newlimit. Enter newlimit in units of 512-byte
blocks. A negative or 0 limit will prevent
processes from creating files. (To set the
size limit in byte units, you can use
setrlimit(2) with the RLIMIT_FSIZE argument.)
GET_BREAK Get the maximum break value for the calling
process.
GET_MAX_OPEN Get the maximum number of open files allowed
for the calling process. (This option returns
the same value as getrlimit(2) with the
RLIMIT_NOFILE argument, and sysconf(2) with
the _SC_OPEN_MAX argument.)
ACCESS CONTROL
The calling process must have appropriate privilege to raise a file
size limit (see the description of SET_ULIMIT, above, and of the
EPERM error, below). For systems supporting the DG/UX Capability
Option, appropriate privilege is defined as having one or more
specific capabilities enabled in the effective capability set of the
calling process. See capdefaults(5) for the default capability for
this system call.
On systems without the DG/UX Capability Option, appropriate privilege
means that the process has an effective UID of root. See the
appropriateprivilege(5) man page for more information.
RETURN VALUE
If cmd is: Return value is:
GET_ULIMIT, UL_GETFSIZE
An integer indicating the current value of the
calling process's file size limit.
SET_ULIMIT, UL_SETFSIZE
The new file size limit newlimit if
successful. If an error occurred, -1 is
returned and errno is set to indicate the
error.
GET_BREAK The calling process's maximum break value.
GET_MAX_OPEN The maximum number of open files allowed for
the calling process.
If cmd is anything other than the above values, -1 is returned and
errno is set to EINVAL.
DIAGNOSTICS
Errno may be set to one of the following error codes:
EPERM The calling process tried to increase the file size limit
and does not have appropriate privilege.
EINVAL The value of cmd was not one of the valid commands listed
above.
SEE ALSO
brk(2), getrlimit(2), setrlimit(2), write(2),
appropriateprivilege(5).
capdefaults(5).
Licensed material--property of copyright holder(s)