Skip to content
forked from Nugine/rlimit

A simple wrapper for getrlimit and setrlimit.

License

Notifications You must be signed in to change notification settings

ManaSugi/rlimit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rlimit

Latest Version Documentation License

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));

Todo

Support more targets.

Current targets
i686-unknown-linux-gnu
i686-unknown-linux-musl
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
x86_64-apple-darwin

About

A simple wrapper for getrlimit and setrlimit.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%