DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

thr_getscheduler(3thread)


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(3thread) 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(3thread), priocntl(2), thr_getprio(3thread), thr_setprio(3thread), thr_setscheduler(3thread), thr_yield(3thread)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004