pthread_attr_setinheritsched(PTHREAD)
pthread_attr_setinheritsched, pthread_attr_getinheritsched --
set and get inheritsched attribute
Synopsis
cc [options] -Kthread file
#include <pthread.h>
int pthread_attr_setinheritsched(pthread_attr_t *attr,
int inheritsched);
int pthread_attr_getinheritsched(const pthread_attr_t *attr,
int *inheritsched);
Description
pthread_attr_setinheritsched
and
pthread_attr_getinheritsched,
respectively, set and get the
inheritsched
attribute in the
attr
argument.
When the attribute objects are used by
pthread_create(PTHREAD),
the
inheritsched
attribute determines how the other scheduling attributes of
the created thread are to be set:
PTHREAD_INHERIT_SCHED-
Specifies that the scheduling policy and associated attributes
are to be inherited from the creating thread, and the scheduling
attributes in this
attr
argument are to be ignored.
PTHREAD_EXPLICIT_SCHED-
Specifies that the scheduling policy and associated attributes
are to be set to the corresponding values from this attribute object.
The symbols PTHREAD_INHERIT_SCHED and PTHREAD_EXPLICIT_SCHED
are defined in the header
pthread.h.
Usage
After these attributes have been set, a thread can be created with
the specified attributes using
pthread_create.
Using these routines does not affect the current running thread.
Return values
If successful,
pthread_attr_setinheritsched
and
pthread_attr_getinheritsched
return zero.
Otherwise, an error number is returned to indicate the error.
Diagnostics
If the following conditions are detected,
pthread_attr_setinheritsched
and
pthread_attr_getinheritsched
will return the corresponding value:
ENOSYS-
_POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the
implementation does not support the function
EINVAL-
invalid attribute value
If the following condition is detected,
pthread_attr_setinheritsched
will return the corresponding value:
ENOTSUP-
unsupported attribute value
References
pthread_attr_init(PTHREAD),
pthread_attr_setscope(PTHREAD),
pthread_attr_setschedpolicy(PTHREAD),
pthread_attr_setschedparam(PTHREAD),
pthread_create(PTHREAD),
pthread_setschedparam(PTHREAD),
pthread(F),
sched(F)
Standards compliance
The Single UNIX Specification, Version 2; The Open Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005