(lim: rlimit64)
| 249 | /// Convert a C `rlimit64` to a Rust `Rlimit`. |
| 250 | #[inline] |
| 251 | fn 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] |