Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getrlimit(2) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                             getrlimit(2)



        _________________________________________________________________
        getrlimit                                             System Call
        Get system resource consumption limits.
        _________________________________________________________________


        SYNTAX

        #include <sys/time.h>
        #include <sys/resource.h>

        int     getrlimit (resource, rlp)
        int             resource;
        struct rlimit * rlp;


        PARAMETERS

        resource       Identifies the resource for which the limits are
                       to be returned.


        rlp            A pointer to a structure into which the limit
                       values are to be placed.


        DESCRIPTION

        The current setting of the limits on consumption of system
        resources by the calling process may be obtained with this system
        call.

        The <resource> parameter is one of the following:


        RLIMIT_CPU     The maximum amount of cpu time (in seconds)
                       allowed for the process.


        RLIMIT_FSIZE   The largest offset, in bytes, at which the process
                       may write to a file.


        RLIMIT_DATA    The maximum size, in bytes, of the data segment
                       for a process; the limit is the sum of the virtual
                       address spaces occupied by the initial data area,
                       data area allocated using sbrk, and data area
                       occupied by attached shared memory segments.


        RLIMIT_STACK   The maximum size, in bytes, of the stack segment



        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                             getrlimit(2)



                       for a process; this defines how far a program's
                       stack segment may be extended, either
                       automatically by the system, or explicitly by a
                       user with the sbrk system call.


        RLIMIT_CORE    The largest size, in bytes, of a core file which
                       may be created.


        RLIMIT_RSS     The maximum size, in bytes, a process's resident
                       set size may grow to.  This is an advisory limit
                       on the amount of physical memory to be given to a
                       process; if memory is tight, the system will
                       prefer to take memory from processes which are
                       exceeding their declared resident set size.

        A resource limit is specified as a soft limit and a hard limit.
        When a soft limit is exceeded a process may receive a signal (for
        example, if the cpu time is exceeded), but it will be allowed to
        continue execution until it reaches the hard limit (or modifies
        its resource limit).


        ACCESS CONTROL

        The argument <rlp> must address an area of the calling process's
        address space that is valid and has write access.


        RETURN VALUE

        If the system call completes successfully, 0 is returned.
        Otherwise -1 is returned and errno is set to indicate the error.


        EXCEPTIONS

        Errno may be set to one of the following error codes:


        EFAULT         The address specified for <rlp> is illegal.


        EINVAL         The value of <resource> is not one of the allowed
                       values.


        SEE ALSO

        The related system call:  setrlimit, ulimit.



        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



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