1PTHREAD_ATTR_GETSCHEDPOLICY(PPO)SIX Programmer's ManPuTaHlREAD_ATTR_GETSCHEDPOLICY(P)
2
3
4

NAME

6       pthread_attr_getschedpolicy,  pthread_attr_setschedpolicy - get and set
7       the schedpolicy attribute (REALTIME THREADS)
8

SYNOPSIS

10       #include <pthread.h>
11
12       int pthread_attr_getschedpolicy(const pthread_attr_t *restrict attr,
13              int *restrict policy);
14       int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
15
16

DESCRIPTION

18       The  pthread_attr_getschedpolicy()  and   pthread_attr_setschedpolicy()
19       functions, respectively, shall get and set the schedpolicy attribute in
20       the attr argument.
21
22       The supported values of policy shall include SCHED_FIFO, SCHED_RR,  and
23       SCHED_OTHER,  which  are defined in the <sched.h> header.  When threads
24       executing  with  the  scheduling  policy  SCHED_FIFO,  SCHED_RR,     or
25       SCHED_SPORADIC  are waiting on a mutex, they shall acquire the mutex in
26       priority order when the mutex is unlocked.
27

RETURN VALUE

29       If     successful,      the      pthread_attr_getschedpolicy()      and
30       pthread_attr_setschedpolicy()  functions  shall return zero; otherwise,
31       an error number shall be returned to indicate the error.
32

ERRORS

34       The pthread_attr_setschedpolicy() function may fail if:
35
36       EINVAL The value of policy is not valid.
37
38       ENOTSUP
39              An attempt was made to  set  the  attribute  to  an  unsupported
40              value.
41
42
43       These functions shall not return an error code of [EINTR].
44
45       The following sections are informative.
46

EXAMPLES

48       None.
49

APPLICATION USAGE

51       After  these attributes have been set, a thread can be created with the
52       specified attributes using pthread_create(). Using these routines  does
53       not affect the current running thread.
54

RATIONALE

56       None.
57

FUTURE DIRECTIONS

59       None.
60

SEE ALSO

62       pthread_attr_destroy()  ,  pthread_attr_getscope()  , pthread_attr_get‐
63       inheritsched() , pthread_attr_getschedparam() , pthread_create() ,  the
64       Base Definitions volume of IEEE Std 1003.1-2001, <pthread.h>, <sched.h>
65
67       Portions  of  this text are reprinted and reproduced in electronic form
68       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
69       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
70       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
71       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
72       event of any discrepancy between this version and the original IEEE and
73       The  Open Group Standard, the original IEEE and The Open Group Standard
74       is the referee document. The original Standard can be  obtained  online
75       at http://www.opengroup.org/unix/online.html .
76
77
78
79IEEE/The Open Group                  2003       PTHREAD_ATTR_GETSCHEDPOLICY(P)
Impressum