SCHED_GETSCHEDULER(2)

NAME
sched_getscheduler - Get scheduling policy for a process

SYNOPSIS
# include <sched.h>

int sched_getscheduler ( pid_t pid )

DESCRIPTION
The function sched_getscheduler returns the scheduling policy (algorithm) for a process given by pid. If the pid is 0, the scheduling policy returned is that of the calling process. This implementation of POSIX.4 defines the following scheduling policies:

SCHED_FIFO      Run until blocked (First-in/First-out)

SCHED_RR        Round-Robin (Fixed time-slice)

SCHED_OTHER     The default Linux time-share scheduler

RETURN VALUE
On a failure sched_getscheduler returns -1 with errno indicating the error, otherwise sched_getscheduler returns the scheduling policy of the process indicated.

ERRORS
When sched_getscheduler fails, errno will be set to one among the following values:

ESRCH
    The process specified by a non-zero pid does not exist on the system.

EPERM
    The calling process cannot affect the scheduling parameters of the process given by pid because it lacks authority. Under Linux, a process must be the same uid as the caller or the caller must be superuser.

SEE ALSO
sched_getparam(2), sched_setparam(2), sched_get_priority_min(2), sched_get_priority_max(2), sched_rr_get_interval(2), sched_setscheduler(2)