[Previous] [Contents] [Next]

SchedGet(), SchedGet_r()

Get the scheduling policy for a thread

Synopsis:

#include <sys/neutrino.h>

int SchedGet( pid_t pid,
              int tid,
              struct sched_param * param );

int SchedGet_r( pid_t pid,
                int tid,
                struct sched_param * param );

Library:

libc

Description:

The SchedGet() and SchedGet_r() functions are identical except in the way they indicate errors. See the Returns section for details.

These kernel calls return the current scheduling policy and the parameters for the thread specified by tid in the process specified by pid. If pid is zero, the current process is used to look up a nonzero tid. If pid and tid are zero, then the calling thread is used.

The parameters are returned in the param argument, which has at least the following members:

Member Description
int sched_priority The default priority of the thread as set at thread creation or most recently changed by SchedSet(). Outside of priority inheritance the thread will run at this priority.
int sched_curpriority The priority the thread is currently running at. If the priority was boosted via priority inheritance, such as a mutex, this value may differ from sched_priority.

The scheduling policy is returned on success and is one of SCHED_FIFO, SCHED_RR, or SCHED_OTHER.

Blocking states

These calls don't block.

Returns:

The only difference between these functions is the way they indicate errors:

SchedGet()
The current scheduling policy. If an error occurs, -1 is returned and errno is set.
SchedGet_r()
The current scheduling policy. This function does NOT set errno. If an error occurs, the negative of a value from the Errors section is returned.

Errors:

EFAULT
A fault occurred when the kernel tried to access the buffers provided.
ESRCH
The process indicated by pid or thread indicated by tid doesn't exist.

Classification:

QNX 6

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

See also:

SchedInfo(), SchedSet(), SchedYield()


[Previous] [Contents] [Next]