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

Function setrlimit

src/backend/linux_raw/process/syscalls.rs:215–229  ·  view source on GitHub ↗
(limit: Resource, new: Rlimit)

Source from the content-addressed store, hash-verified

213
214#[inline]
215pub(crate) fn setrlimit(limit: Resource, new: Rlimit) -> io::Result<()> {
216 unsafe {
217 let lim = rlimit_to_linux(new);
218 match ret(syscall_readonly!(
219 __NR_prlimit64,
220 c_uint(0),
221 limit,
222 by_ref(&lim),
223 null_mut::<c::c_void>()
224 )) {
225 Ok(()) => Ok(()),
226 Err(err) => Err(err),
227 }
228 }
229}
230
231#[inline]
232pub(crate) fn prlimit(pid: Option<Pid>, limit: Resource, new: Rlimit) -> io::Result<Rlimit> {

Callers

nothing calls this directly

Calls 2

rlimit_to_linuxFunction · 0.85
retFunction · 0.50

Tested by

no test coverage detected