sched_getparam Subroutine

Purpose

Gets scheduling parameters.

Library

Standard C Library (libc.a)

Syntax

#include <sched.h>

int sched_getparam (pid, param)
pit_t pid;
struct sched_param *param;

Description

The sched_getparam subroutine returns the scheduling parameters of a process specified by the pid parameter in the sched_param structure.

If a process specified by the pid parameter exists, and if the calling process has permission, the scheduling parameters for the process whose process ID is equal to the value of the pid parameter are returned.

If the pid parameter is zero, the scheduling parameters for the calling process are returned.

Parameters

Item Description
pid Specifies the process for which the scheduling parameters are retrieved.
param Points to the sched_param structure.

Return Values

Upon successful completion, the sched_getparam subroutine returns zero. If the sched_getparam subroutine is unsuccessful, -1 is returned and errno is set to indicate the error.

Error Codes

The sched_rr_get_interval subroutine fails if:
Item Description
EINVAL The param parameter is null or a bad address.
ENOTSUP This interface does not support processes capable of checkpoint.
EPERM The requesting process does not have permission to obtain the scheduling parameters of the specified process.
ESRCH The pid parameter is negative, or no process can be found that corresponds to the one specified by the pid parameter.