sched_getscheduler Subroutine

Purpose

Gets the scheduling policy.

Library

Standard C Library (libc.a)

Syntax

#include <sched.h>

int sched_getscheduler (pid)
pid_t pid;

Description

The sched_getscheduler subroutine returns the scheduling policy of the process specified by the pid parameter.

The values that can be returned by the sched_getscheduler subroutine are defined in the sched.h header file.

Parameters

Item Description
pid Specifies the process for which the scheduling policy is retrieved.

Return Values

Upon successful completion, the sched_getscheduler subroutine returns the scheduling policy of the specified process. If unsuccessful it returns -1 and sets errno to indicate the error.

Error Codes

The sched_getscheduler subroutine fails if:
Item Description
EPERM The requesting process does not have permission to determine the scheduling policy 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.
ENOTSUP This interface does not support processes capable of checkpoint.