Previous: , Up: posix resources   [Index]


4.21.3 System resources functions

Identifier Syntax: RLIM_INFINITY

The value of the corresponding POSIX constant. If the constant is defined: this identifier expands to an unsigned integer, else it expands to #f.

Function: getrlimit resource
Function: getrlimit resource rlimit

Interface to the C function getrlimit(), (libc)getrlimit. Retrieve the soft and hard limits of a system resource; if successful return rlimit, else raise an exception.

resource must be an exact integer representing the value of a RLIMIT_ constant.

The optional rlimit must be an instance of struct-rlimit: it is filled with the requested values and returned; when not given: a new instance is allocated, filled and returned.

#!r6rs
(import (vicare)
  (prefix (vicare posix) px.)
  (vicare platform constants))

(px.getrlimit RLIMIT_STACK)
⇒ #["struct-rlimit" rlim_cur=8388608 rlim_max=4294967295]
Function: setrlimit resource rlimit

Interface to the C function setrlimit(), (libc)setrlimit. Set the soft and hard limits of a system resource; if successful return unspecified values, else raise an exception.

resource must be an exact integer representing the value of a RLIMIT_ constant. rlimit must be an instance of struct-rlimit filled with the selected values.

Function: getrusage processes
Function: getrusage processes rusage

Interface to the C function getrusage(), (libc)getrusage. Reports resource usage totals for processes specified by processes; if successful return rusage, else raise an exception.

processes must be an exact integer in the range of the C language type int; it should be one of the RUSAGE_ platform constants.

The optional rusage must be an instance of struct-rusage and it is filled with the usage values; when not given: a new instance of struct-rusage is internally allocated, filled and returned.


Previous: , Up: posix resources   [Index]