| 249 | } |
| 250 | |
| 251 | int |
| 252 | sys_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 | |
| 277 | int |
| 278 | kern_sched_getscheduler(struct thread *td, struct thread *targettd, |
nothing calls this directly
no test coverage detected