pub struct Resource { /* private fields */ }
Expand description
A kind of resource.
All resource constants are available on all unix platforms.
Passing an unsupported resource to [set|get|p]rlimit
will
result in a custom IO error.
Be careful: The documentation of Resource
constants are based on a few systems.
It may be inconsistent with other platforms.
§References
Linux: https://man7.org/linux/man-pages/man2/getrlimit.2.html
FreeBSD: https://www.freebsd.org/cgi/man.cgi?query=getrlimit
Implementations§
Source§impl Resource
impl Resource
Source§impl Resource
impl Resource
Sourcepub const AS: Self = _
pub const AS: Self = _
The maximum size (in bytes) of the process’s virtual memory (address space).
Sourcepub const CPU: Self = _
pub const CPU: Self = _
A limit (in seconds) on the amount of CPU time that the process can consume.
Sourcepub const DATA: Self = _
pub const DATA: Self = _
The maximum size (in bytes) of the process’s data segment (initialized data, uninitialized data, and heap).
Sourcepub const LOCKS: Self = _
pub const LOCKS: Self = _
(early Linux 2.4 only)
A limit on the combined number
of flock(2)
locks and fcntl(2)
leases
that this process may establish.
Sourcepub const MEMLOCK: Self = _
pub const MEMLOCK: Self = _
The maximum number (in bytes) of memory that may be locked into RAM.
Sourcepub const MSGQUEUE: Self = _
pub const MSGQUEUE: Self = _
A limit on the number of bytes that can be allocated for POSIX message queues for the real user ID of the calling process.
Sourcepub const NICE: Self = _
pub const NICE: Self = _
This specifies a ceiling
to which the process’s nice value can be raised
using setpriority(2)
or nice(2)
.
Sourcepub const NOFILE: Self = _
pub const NOFILE: Self = _
This specifies a value one greater than the maximum file descriptor number that can be opened by this process.
Sourcepub const NPROC: Self = _
pub const NPROC: Self = _
A limit on the number of extant process (or, more precisely on Linux, threads) for the real user ID of the calling process.
Sourcepub const NPTS: Self = _
pub const NPTS: Self = _
The maximum number of pseudo-terminals this user id is allowed to create.
Sourcepub const NTHR: Self = _
pub const NTHR: Self = _
The maximum number of simultaneous threads (Lightweight Processes) for this user id. Kernel threads and the first thread of each process are not counted against this limit.
Sourcepub const POSIXLOCKS: Self = _
pub const POSIXLOCKS: Self = _
The maximum number of POSIX-type advisory-mode locks available to this user.
Sourcepub const RSS: Self = _
pub const RSS: Self = _
A limit (in bytes) on the process’s resident set (the number of virtual pages resident in RAM).
Sourcepub const RTPRIO: Self = _
pub const RTPRIO: Self = _
This specifies a ceiling on the real-time priority
that may be set for this process
using sched_setscheduler(2)
and sched_setparam(2)
.
Sourcepub const RTTIME: Self = _
pub const RTTIME: Self = _
A limit (in microseconds) on the amount of CPU time that a process scheduled under a real-time scheduling policy may consume without making a blocking system call.
Sourcepub const SBSIZE: Self = _
pub const SBSIZE: Self = _
The maximum size (in bytes) of socket buffer usage for this user. This limits the amount of network memory, and hence the amount of mbufs, that this user may hold at any time.
Sourcepub const SIGPENDING: Self = _
pub const SIGPENDING: Self = _
A limit on the number of signals that may be queued for the real user ID of the calling process.