[−][src]Crate rlimit
rlimit - A simple wrapper for getrlimit
and setrlimit
.
Example
const SOFT: rlim = 4 * 1024 * 1024; const HARD: rlim = 8 * 1024 * 1024;
Set resource limit
assert!(Resource::FSIZE.set(SOFT, HARD).is_ok());
or
assert!(setrlimit(Resource::FSIZE, SOFT, HARD).is_ok());
Get resource limit
assert_eq!(getrlimit(Resource::CPU).unwrap(), (RLIM_INFINITY, RLIM_INFINITY));
Enums
Resource | Enum type used for resource values. |
Constants
RLIM_INFINITY | A value of rlim indicating no limit. |
Functions
getrlimit | Get resource limits. |
prlimit | [Linux] Set the resource limits of an arbitrary process. |
prlimit_with_old | [Linux] Set and get the resource limits of an arbitrary process. |
setrlimit | Set resource limits. |
Type Definitions
RawResource | Integer type used for resource values. |
rlim | Unsigned integer type used for limit values. |