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

Function nice

src/backend/linux_raw/process/syscalls.rs:116–125  ·  view source on GitHub ↗
(inc: i32)

Source from the content-addressed store, hash-verified

114
115#[inline]
116pub(crate) fn nice(inc: i32) -> io::Result<i32> {
117 let priority = (if inc > -40 && inc < 40 {
118 inc + getpriority_process(None)?
119 } else {
120 inc
121 })
122 .clamp(-20, 19);
123 setpriority_process(None, priority)?;
124 Ok(priority)
125}
126
127#[inline]
128pub(crate) fn getpriority_user(uid: Uid) -> io::Result<i32> {

Callers

nothing calls this directly

Calls 2

getpriority_processFunction · 0.70
setpriority_processFunction · 0.70

Tested by

no test coverage detected