Calculate the allowable priority for the scheduling policy
#include <sched.h>
int sched_get_priority_adjust( int prio,
int policy,
int adjust );
- prio
- The original priority value.
If negative, the priority of the calling thread is used.
- policy
- The scheduling algorithm 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.
libc
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.
- >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.
- EINVAL
- The value of the policy parameter doesn't represent a defined scheduling policy.
QNX 6
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
errno,
sched_getparam(),
sched_get_priority_max(),
sched_get_priority_min(),
sched_setparam(),
sched_getscheduler(),
sched_setscheduler()