DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

thr_getscheduler(THREAD)


thr_getscheduler -- get the scheduling policy information for a thread

Synopsis

   cc [options] -Kthread file
   

#include <thread.h>

int thr_getscheduler(thread_t tid, sched_param_t *param);

Description

thr_getscheduler sets the sched_param_t pointed to by param to the policy-specific parameters for tid.

tid parameter

tid is the ID of the thread whose scheduling policy information thr_getscheduler will retrieve.

Parameters


tid
a thread ID

param
a pointer to a sched_param_t structure containing the policy-specific parameters (set by thr_getscheduler)

param parameter

param points to a sched_param_t structure in which thr_getscheduler will store tid's scheduling policy and parameters.

sched_param_t is defined as follows:

   struct {
   	id_t	policy;
   	long	policy_params[POLICY_PARAM_SZ];
   } sched_param_t;

See thr_setscheduler(THREAD) for the available scheduling policies and parameters.

Security restrictions

No privileges or special permissions are required to use thr_getscheduler.

Usage

thr_getscheduler is used by multithreaded applications which need to control their scheduling.

Return values

thr_getscheduler returns zero for success and an error number for failure, as described below.

Errors

If the following condition is detected, thr_getscheduler fails and returns the corresponding value:

ESRCH
No thread can be found in the current process with identity tid.

EINVAL
param is null.

References

Intro(THREAD), priocntl(S), thr_getprio(THREAD), thr_setprio(THREAD), thr_setscheduler(THREAD), thr_yield(THREAD)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005