Multithreaded Programming Guide

Get Scheduling Policy

pthread_attr_getschedpolicy(3T)

Use pthread_attr_getschedpolicy() to retrieve the scheduling policy. Currently, only the Solaris-based SCHED_OTHER default value is supported in pthreads.

Prototype:

int	pthread_attr_getschedpolicy(pthread_attr_t *tattr, int *policy);
#include <pthread.h>

pthread_attr_t tattr;
int policy;
int ret;

/* get scheduling policy of thread */
ret = pthread_attr_getschedpolicy (&tattr, &policy); 

Return Values

Returns zero after completing successfully. Any other returned value indicates that an error occurred. If the following condition occurs, the function fails and returns the corresponding value.


EINVAL

The parameter policy is NULL or tattr is invalid.