DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦e9ebfa0a5⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Unix_Limits, seg_0509a8

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



-- Interface to Unix limit commands:
--    getrlimit, setrlimit - control maximum system resource consumption
--    brk, sbrk - change data segment size
-- See data structures in:
--    #include <sys/time.h>
--    #include <sys/resource.h>

with System;

package Unix_Limits is

    type Resources is
       (Rlimit_Cpu,   -- the maximum amount of cpu time (in mil-
                      -- liseconds) to be used by each process.
        Rlimit_Fsize, -- the largest size, in bytes, of any single
                      -- file which may be created.
        Rlimit_Data,  -- the maximum size, in bytes, of the data
                      -- segment for a process; this defines how far
                      -- a program may extend its break with the
                      -- sbrk(2) system call.
        Rlimit_Stack, -- the maximum size, in bytes, of the stack
                      -- segment 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(2) sys-
                      -- tem 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
                      -- imposes a 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.
    for Resources'Size use 32;

    type Rlimit_Rec is
        record
            Rlim_Cur : Integer;     -- current (soft) limit
            Rlim_Max : Integer;     -- hard limit
        end record;
    type A_Rlimit is access Rlimit_Rec;
    pragma Local_Access (A_Rlimit);

    type Good_Or_Bad is (Bad, Good);
    for Good_Or_Bad use (-1, 0);
    for Good_Or_Bad'Size use Integer'Size;
    -- A 0 return value indicates that the call succeeded, changing
    -- or returning the resource limit.   A return value of -1
    -- indicates that an error occurred, and an error code is
    -- stored in the global location errno.
    --     The possible errors are:
    --     [EFAULT]  The address specified for rlp is invalid.
    --     [EPERM]   The limit specified to setrlimit would have
    --               raised the maximum limit value, and the
    --               caller is not the super-user.
    --     [ENOMEM]  The limit, as set by setrlimit(2), was
    --               exceeded.
    --         -or-  The maximum possible size of a data segment
    --               (compiled into the system) was exceeded.
    --         -or-  Insufficient space existed in the swap area
    --               to support the expansion.


    function Getrlimit (Resource : Resources; Rlp : A_Rlimit)
                       return Good_Or_Bad;
    function Setrlimit (Resource : Resources; Rlp : A_Rlimit)
                       return Good_Or_Bad;
    function Brk (Addr : System.Address) return Good_Or_Bad;
    function Sbrk (Incr : Integer) return System.Address;

private

    pragma Interface (C, Getrlimit);
    pragma Interface (C, Setrlimit);
    pragma Interface (C, Brk);
    pragma Interface (C, Sbrk);

end Unix_Limits;

E3 Meta Data

    nblk1=4
    nid=0
    hdr6=8
        [0x00] rec0=18 rec1=00 rec2=01 rec3=052
        [0x01] rec0=14 rec1=00 rec2=02 rec3=01c
        [0x02] rec0=14 rec1=00 rec2=03 rec3=00a
        [0x03] rec0=12 rec1=00 rec2=04 rec3=000
    tail 0x2175803b8878e798a44db 0x42a00088462060003