class Rlimit

Allows you to get and set resource limits

Description

This class retrieves the specified resource limits when it is created and places them in two variables, current and max. Current is the current limit of a resource and max is the hard kernel limit which cur is not allowed to exceed. The resources you can request are Posix.RLIMIT_CPU (seconds of processor time); Posix.RLIMIT_DATA (maximum size of data segment); Posix.RLIMIT_FSIZE (maximum file size); Posix.RLIMIT_LOCKS (maximum number of locked files); Posix.RLIMIT_MEMLOCK (maximum bytes of memory that can be locked into RAM); Posix.RLIMIT_NOFILE (maximum number of files that can be opened); Posix.RLIMIT_NPROC (maximum number of processes that can be created by the real user ID of the calling process); Posix.RLIMIT_RSS (maximum RSS size in pages); Posix.RLIMIT_STACK (maximum size of the stack in bytes). The set() method attempts to set the resource limit (presumably after modifying current and/or max). On failure, it returns false and sets err.str.

class contents [NB. Highlighted attributes are static members]
Functions
function constructor(number) - Create an instance of an Rlimit object
function set() - With the given resource, set the current values within the object.
Variables
variable current - The current value for the resource. (-1 for Infinity)
variable max - The maximum value the resource can be. (-1 for Infinity)
variable resource - The resource this limit represents.

Functions

function constructor Click to go up to the list
Create an instance of an Rlimit object
Declaration:
    function constructor( number resource )
Parameters:
    Parameter #1: number resource - The resource to query

function set Click to go up to the list
With the given resource, set the current values within the object.
Declaration:
    function set
Description:
if you wish to make either value set to infinite, make sure that either current or max are set to -1.
Returns:
    true on success, false otherwise

Variables

number current Click to go up to the list
The current value for the resource. (-1 for Infinity)

number max Click to go up to the list
The maximum value the resource can be. (-1 for Infinity)

number resource Click to go up to the list
The resource this limit represents.

Automatically generated at 12:07PM, Wednesday 25 May 2005 by feritedoc.