Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ulimit(2) — DG/UX 5.4R3.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

brk(2)

getrlimit(2)

setrlimit(2)

write(2)



ulimit(2)                      DG/UX 5.4R3.00                      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
       Only a process with superuser access can raise a file size limit (see
       the description of SET_ULIMIT, above, and of the EPERM error, below).

RETURN VALUE
        If cmd is:            Return value is:



Licensed material--property of copyright holder(s)                         1




ulimit(2)                      DG/UX 5.4R3.00                      ulimit(2)


        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 an effective user id of 0.

       EINVAL    The value of cmd was not one of the valid commands listed
                 above.

SEE ALSO
       brk(2), getrlimit(2), setrlimit(2), write(2).




























Licensed material--property of copyright holder(s)                         2


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026