pthread_attr_getschedpolicy Subroutine


Returns the value of the schedpolicy attribute of a thread attributes


Threads Library (libpthreads.a)



int pthread_attr_getschedpolicy (attr, schedpolicy)
const pthread_attr_t *attr;
int *schedpolicy;


The pthread_attr_getschedpolicy subroutine returns the value of the
schedpolicy attribute of the thread attributes object attr. This attribute
specifies the scheduling policy of a thread created with this attributes
object. It may have one of the following values:

SCHED_FIFO	Denotes fixed priority first-in first-out scheduling.

SCHED_RR	Denotes fixed prioity round-robin scheduling.

SCHED_OTHER	Denotes the default AIX scheduling policy. It is the default

Note:	The pthread.h header file must be the first included file of
each source file using the threads library.


attr	Specifies the thread attributes object.

schedpolicy	Points to where the schedpolicy attribute value will be

Return Values

Upon successful completion, the value of the schedpolicy attribute
is returned via the schedpolicy parameter, and 0 is returned. Otherwise,
an error code is returned.

Error Codes

The pthread_attr_getschedpolicy subroutine is unsuccessful if the
following is true:

EINVAL	The attr parameter is not valid.

ENOSYS	The priority scheduling POSIX option is not implemented.

Implementation Specifics

This subroutine is part of the Base Operating System (BOS) Runtime.

The implementation of this subroutine is dependent on the priority
scheduling POSIX option. The priority scheduling POSIX option is implemented
in AIX.

Related Information

The pthread_attr_setschedpolicy subroutine, pthread_attr_init subroutine,
pthread_getschedparam subroutine.

Threads Scheduling.

Threads Library Options and Threads Library Quick Reference.