Description

Setting resource limits

Author

felix

Version

Usage

(require-extension rlimit)

Download

rlimit.egg

Documentation

procedure: (rlimit RESOURCE [HARD?])

Returns the current limit for the resource RESOURCE, which should be one of the resource-identifiers listed below. By default the soft limit is returned, but if HARD? is given and true, the current hard limit is returned. See the getrlimit(2) man page for more information.

Note that if no limit is set, +inf. (inifinity) will be returned.

Here is a list of available resources. Some resource types mot be available on every platform.

rlimit/core core file size
rlimit/cpu CPU time limit in seconds
rlimit/data maximum size of data segment
rlimit/fsize maximum size of created files
rlimit/locks maximum number of file locks and fcntl leases
rlimit/memlock maximum size of locked vm memory
rlimit/nofile maximum file-descriptor
rlimit/ofile equivalent to rlimit/nofile
rlimit/nproc maximum number of created processes
rlimit/rss limit in pages for resident set size
rlimit/stack maximum stack size
rlimit/vmem maximum virtual memory size
setter: (set! (rlimit RESOURCE [HARD?]) VALUE)

Sets the soft or hard resource limit. A value if +inf. disables the limit completely. A value of false is equivalent to zero.

License

Copyright (c) 2006, Felix L. Winkelmann.  All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the Software),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.