MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / rlimit_from_linux

Function rlimit_from_linux

src/backend/linux_raw/process/syscalls.rs:251–263  ·  view source on GitHub ↗
(lim: rlimit64)

Source from the content-addressed store, hash-verified

249/// Convert a C `rlimit64` to a Rust `Rlimit`.
250#[inline]
251fn rlimit_from_linux(lim: rlimit64) -> Rlimit {
252 let current = if lim.rlim_cur == RLIM64_INFINITY as u64 {
253 None
254 } else {
255 Some(lim.rlim_cur)
256 };
257 let maximum = if lim.rlim_max == RLIM64_INFINITY as u64 {
258 None
259 } else {
260 Some(lim.rlim_max)
261 };
262 Rlimit { current, maximum }
263}
264
265/// Convert a Rust [`Rlimit`] to a C `rlimit64`.
266#[inline]

Callers 2

getrlimitFunction · 0.85
prlimitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected