sched_get_priority_adjust()

Calculate the allowable priority for the scheduling policy

Synopsis:

#include <sched.h>

int sched_get_priority_adjust( int prio,
                               int policy,
                               int adjust );

Arguments:

prio
The original priority value. If negative, the priority of the calling thread is used.
policy
The scheduling policy being used. The valid arguments are listed in sched_get_priority_max(). If policy is SCHED_NOCHANGE, the function uses the algorithm of the calling thread.
adjust
The priority change, relative to prio. A value of +10 results in a final priority of prio+10, provided that this amount of adjustment is allowed.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.


Note: This function is in libc.a, but not in libc.so (in order to save space).

Description:

The sched_get_priority_adjust() function calculates the requested priority change relative to another thread and returns the allowable value.

This function makes it easier for you to set relative priorities in order to ensure proper precedence.

Returns:

>0
The allowed priority value. The value will never exceed the range of values allowed by sched_get_priority_min() and sched_get_priority_max().
<0
Failure; the negative of the errno value.

Errors:

EINVAL
The value of the policy parameter doesn't represent a defined scheduling policy.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

errno, sched_getparam(), sched_get_priority_max(), sched_get_priority_min(), sched_setparam(), sched_getscheduler(), sched_setscheduler()