MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sys_sched_getscheduler

Function sys_sched_getscheduler

freebsd/kern/p1003_1b.c:251–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251int
252sys_sched_getscheduler(struct thread *td, struct sched_getscheduler_args *uap)
253{
254 int e, policy;
255 struct thread *targettd;
256 struct proc *targetp;
257
258 if (uap->pid == 0) {
259 targetp = td->td_proc;
260 targettd = td;
261 PROC_LOCK(targetp);
262 } else {
263 targetp = pfind(uap->pid);
264 if (targetp == NULL)
265 return (ESRCH);
266 targettd = FIRST_THREAD_IN_PROC(targetp);
267 }
268
269 e = kern_sched_getscheduler(td, targettd, &policy);
270 PROC_UNLOCK(targetp);
271 if (e == 0)
272 td->td_retval[0] = policy;
273
274 return (e);
275}
276
277int
278kern_sched_getscheduler(struct thread *td, struct thread *targettd,

Callers

nothing calls this directly

Calls 2

kern_sched_getschedulerFunction · 0.85
pfindFunction · 0.70

Tested by

no test coverage detected