Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ulimit(2) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

brk, sbrk

getrlimit, setrlimit, vlimit

read, readv, readx

write, writex

master



ULIMIT(2,L)                 AIX Technical Reference                 ULIMIT(2,L)



-------------------------------------------------------------------------------
ulimit



PURPOSE

Sets and gets user limits.

SYNTAX

#include <ulimit.h>

off_t ulimit (cmd, newlimit)
int cmd;
off_t newlimit;

DESCRIPTION

The ulimit system call controls process limits.  The cmd parameter values are:

GET_FSIZE
       Returns the process's file size limit.  The limit is in units of
       512-byte blocks and is inherited by child processes.  Files of any size
       can be read.

SET_FSIZE
       Sets the process's file size limit to the value of the newlimit
       parameter.  The limit is in units of 512-byte blocks.  Any process can
       decrease this limit, but only a process with an effective user ID of
       superuser can increase the limit.

GET_DATALIM
       Returns the maximum possible break value (see "brk, sbrk").

SET_DATLIM
       Sets the maximum possible break value (see "brk, sbrk").  Returns the
       new maximum break value, which is newlimit rounded up to the nearest
       page boundary.

GET_STACKLIM
       Returns the lowest valid stack address.  (Note that stacks grow from
       high addresses to low addresses.)

SET_STACKLIM
       Sets the lowest valid stack address.  Returns the new minimum valid
       stack address, which is newlimit rounded down to the nearest page
       boundary.

GET_REALDIR
       Returns the current value of the real directory read flag.  If this flag
       is 0, a read system call (or readx system call with ext of 0) against a



Processed November 7, 1990        ULIMIT(2,L)                                 1





ULIMIT(2,L)                 AIX Technical Reference                 ULIMIT(2,L)



       directory returns fixed-format entries compatible with the System V UNIX
       Operating System.  Otherwise, a read system call (or readx system call
       with ext of 0) against a directory returns the underlying physical
       format.

SET_REALDIR
       Sets the value of the real directory read flag.  If the newlimit
       parameter is 0, this flag is cleared; otherwise it is set.  The old
       value of the real directory read flag is returned.

GET_SYSVLOOKUP
       Returns the current value of the System V lookup flag.  If this flag is
       nonzero, any pathname parameter containing a component of exactly 14
       characters, passed to a system call, causes the system call to fail with
       the ENOENT error.

SET_SYSVLOOKUP
       Sets the new value of the System V lookup flag.  If the newlimit
       parameter is 0, this flag is cleared; otherwise it is set.  The old
       value of the System V lookup flag is returned.

RETURN VALUE

Upon successful completion, a nonnegative value is returned.  If the ulimit
system call fails, a value of -1 is returned and errno is set to indicate the
error.

ERROR CONDITIONS

The ulimit system call fails and the limit remains unchanged if:

EPERM   A process without superuser authority attempts to increase the file
        size limit.

EINVAL  The cmd parameter is a value other than GET_FSIZE, SET_FSIZE,
        GET_DATALIM, SET_DATLIM, GET_STACKLIM, SET_STACKLIM, GET_REALDIR,
        SET_REALDIR, GET_SYSVLOOKUP, or SET_SYSVLOOKUP.

EXAMPLE

To increase the size of the stack segment by 4096 bytes, and set "rc" to the
new lowest valid stack address:

  rc = ulimit(SET_STACKLIM, ulimit(GET_STACKLIM, 0) - 4096);

RELATED INFORMATION

In this book:  "brk, sbrk," "getrlimit, setrlimit, vlimit," "read, readv,
readx,"  "write, writex," and "master."






Processed November 7, 1990        ULIMIT(2,L)                                 2



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