On this page
resource.setrlimit
Prev: resource.getrusage | Up: resource | Next: resource.struct_rusage
Rel: resource.error, resource.getpagesize, resource.getrlimit, resource.getrusage
Ref: docs.python.org — resource.setrlimit
Tags: #public #python3 #stdlib #resource
Import
import resource
from resource import setrlimit
Signature & Overview
resource.setrlimit(resource, limits, /)
resource.setrlimit() function.
Usage
import resource
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (soft, hard))
Gotchas
- Cannot raise
hardlimit without root privileges; loweringhardis irreversible for the process.
REPL Inspect
from resource import setrlimit
help(setrlimit)
Linked from
Related notes
- tuts/python3/stdlib_module/resource/error Linked here; links to this page; shared tags: #resource, #stdlib
- tuts/python3/stdlib_module/resource/getpagesize Linked here; links to this page; shared tags: #resource, #stdlib
- tuts/python3/stdlib_module/resource/getrlimit Linked here; links to this page; shared tags: #resource, #stdlib
- tuts/python3/stdlib_module/resource/getrusage Linked here; links to this page; shared tags: #resource, #stdlib
- tuts/python3/stdlib_module/resource/struct_rusage Linked here; links to this page; shared tags: #resource, #stdlib
- tuts/python3/stdlib_module/resource Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib