MCPcopy Create free account
hub / github.com/Starry-OS/StarryOS / sys_getpriority

Function sys_getpriority

api/src/syscall/task/schedule.rs:140–165  ·  view source on GitHub ↗
(which: u32, who: u32)

Source from the content-addressed store, hash-verified

138}
139
140pub fn sys_getpriority(which: u32, who: u32) -> AxResult<isize> {
141 debug!("sys_getpriority <= which: {which}, who: {who}");
142
143 match which {
144 PRIO_PROCESS => {
145 if who != 0 {
146 let _proc = get_process_data(who)?;
147 }
148 Ok(20)
149 }
150 PRIO_PGRP => {
151 if who != 0 {
152 let _pg = get_process_group(who)?;
153 }
154 Ok(20)
155 }
156 PRIO_USER => {
157 if who == 0 {
158 Ok(20)
159 } else {
160 Err(AxError::NoSuchProcess)
161 }
162 }
163 _ => Err(AxError::InvalidInput),
164 }
165}

Callers 1

handle_syscallFunction · 0.85

Calls 2

get_process_dataFunction · 0.85
get_process_groupFunction · 0.85

Tested by

no test coverage detected