sys/kern: Mention pid 0 in usched_set(2) BUGS section
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 17 Jul 2016 13:19:11 +0000 (22:19 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 17 Jul 2016 13:28:42 +0000 (22:28 +0900)
commitee85f114e672e06e8a81cfdfe32ea58ea656b981
tree32bda0bbf5d29d0b9ce43c39b60fc668098a8af9
parentcdc70ef7c987bc2e1b321123ca6a5d0d742d5fd4
sys/kern: Mention pid 0 in usched_set(2) BUGS section

usched_set(2) only works for the current thread,
so it doesn't really matter if a caller specifies 0 or getpid().
Because of this, one would basically just pass 0 for pid.

Passing neither 0 nor current pid just results in EINVAL.
After this sanity check, uap->pid is never used.

> if (uap->pid != 0 && uap->pid != curthread->td_proc->p_pid)
> return (EINVAL);
lib/libc/sys/usched_set.2