NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/44768: sched_rr_get_interval(3) should fail with invalid PID



        Note: There was a bad value `sw-big' for the field `Class'.
        It was set to the default value of `sw-bug'.

>Number:         44768
>Category:       lib
>Synopsis:       sched_rr_get_interval(3) should fail with invalid PID
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 25 09:00:01 +0000 2011
>Originator:     Jukka Ruohonen
>Release:        -
>Organization:
-
>Environment:

>Description:

From IEEE Std 1003.1-2008:

    The sched_rr_get_interval() function SHALL fail if:

    [ESRCH]
        No process can be found corresponding to that specified by pid.

Yet

int
/*ARGSUSED*/
sched_rr_get_interval(pid_t pid, struct timespec *interval)
{

        interval->tv_sec = 0;
        interval->tv_nsec = sysconf(_SC_SCHED_RT_TS) * 1000;
        return 0;
}


>How-To-Repeat:

Pass an invalid PID.

>Fix:

Check for valid PID or forget this.



Home | Main Index | Thread Index | Old Index