[Previous] [Contents] [Next]

SchedInfo(), SchedInfo_r()

Get scheduler information

Synopsis:

#include <sys/neutrino.h>

int SchedInfo( pid_t pid, 
               int policy,
               struct _sched_info* info );

int SchedInfo_r( pid_t pid, 
                 int policy,
                 struct _sched_info* info );

Library:

libc

Description:

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

These kernel calls return information about the kernel's thread scheduler, including the minimum and maximum thread priority, for the process ID specified by pid when using the specified scheduling policy. If pid is 0, the scheduler information for the current process is returned. In either case, the struct _sched_info pointed to by info is filled in with the appropriate information.

The policy must be one of the following:

Policy Description
SCHED_FIFO A fixed priority scheduler in which the highest priority ready thread will run until it blocks or is preempted by a higher priority thread.
SCHED_RR The same as SCHED_FIFO except threads at the same priority level will time slice (round robin) every 50 msec.
SCHED_OTHER Currently the same as SCHED_RR.

The struct _sched_info structure pointed to by info contains at least these members:

Member Description
uint64_t interval The current execution time limit before the thread is suspended in favor of the scheduler.
int priority_max The maximum priority for a thread using this scheduling policy.
int priority_min The minimum priority for a thread using this scheduling policy.

Returns:

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

SchedInfo()
If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
SchedInfo_r()
EOK is returned on success. This function does NOT set errno. If an error occurs, any value in the Errors section may be returned.

Errors:

EINVAL
The pid or policy is invalid.
ENOSYS
The SchedInfo() function isn't supported by this system.
ESRCH
The process specified by pid doesn't exist.

Classification:

QNX 6

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

See also:

SchedGet(), SchedSet()


[Previous] [Contents] [Next]