git: sys/kern: Mention pid 0 in usched_set(2) BUGS section

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sun Jul 17 06:38:01 PDT 2016


commit ee85f114e672e06e8a81cfdfe32ea58ea656b981
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Sun Jul 17 22:19:11 2016 +0900

    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);

Summary of changes:
 lib/libc/sys/usched_set.2 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ee85f114e672e06e8a81cfdfe32ea58ea656b981


-- 
DragonFly BSD source repository



More information about the Commits mailing list