SCHED_GETPARAM(2)

NAME
sched_getparam - Set scheduling parameters for a process

SYNOPSIS
# include <sched.h>

int sched_getparam ( pid_t pid, const struct sched_param *p )

DESCRIPTION
The function sched_getparam gets the scheduling parameters into p from a process given by pid. If the pid is 0, the parameters are retrieved from the calling process. Depending on the scheduling policy under which the process is running, different members of p will be valid. This implementation of POSIX.4 defines the following scheduling policies and the valid members of the sched_param structure.

SCHED_FIFO      sched_priority

SCHED_RR        sched_priority

On a successful call to sched_getparam, the system updates the valid members of p .

RETURN VALUE
On a failure sched_getparam returns -1 with errno indicating the error, otherwise 0.

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

EINVAL
    The calling process has not provided a valid sched_param structure.

EINVAL
    The calling process must be of scheduling policy SCHED_FIFO or SCHED_RR to use this call.

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

EPERM
    The calling process cannot retrieve scheduling parameters 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_setparam(2), sched_setscheduler(2), sched_getscheduler(2)