1PTHREAD_ATTR_SETSCHEDPOLICY(L3i)nux Programmer's ManPuTaHlREAD_ATTR_SETSCHEDPOLICY(3)
2
3
4

NAME

6       pthread_attr_setschedpolicy,   pthread_attr_getschedpolicy   -  set/get
7       scheduling policy attribute in thread attributes object
8

SYNOPSIS

10       #include <pthread.h>
11
12       int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
13       int pthread_attr_getschedpolicy(pthread_attr_t *attr, int *policy);
14
15       Compile and link with -pthread.
16

DESCRIPTION

18       The pthread_attr_setschedpolicy() function sets the  scheduling  policy
19       attribute  of  the  thread attributes object referred to by attr to the
20       value specified in policy.  This attribute  determines  the  scheduling
21       policy of a thread created using the thread attributes object attr.
22
23       The   supported   values  for  policy  are  SCHED_FIFO,  SCHED_RR,  and
24       SCHED_OTHER, with the semantics described in sched_setscheduler(2).
25
26       The  pthread_attr_getschedpolicy()  returns   the   scheduling   policy
27       attribute of the thread attributes object attr in the buffer pointed to
28       by policy.
29

RETURN VALUE

31       On success, these functions return 0; on error, they return  a  nonzero
32       error number.
33

ERRORS

35       pthread_attr_setschedpolicy() can fail with the following error:
36
37       EINVAL Invalid value in policy.
38
39       POSIX.1-2001  also  documents  an  optional ENOTSUP error ("attempt was
40       made  to  set   the   attribute   to   an   unsupported   value")   for
41       pthread_attr_setschedpolicy().
42

CONFORMING TO

44       POSIX.1-2001.
45

EXAMPLE

47       See pthread_setschedparam(3).
48

SEE ALSO

50       sched_setscheduler(2),   pthread_attr_init(3),   pthread_attr_setinher‐
51       itsched(3),      pthread_attr_setschedparam(3),      pthread_create(3),
52       pthread_setschedparam(3), pthread_setschedprio(3), pthreads(7)
53

COLOPHON

55       This  page  is  part of release 3.25 of the Linux man-pages project.  A
56       description of the project, and information about reporting  bugs,  can
57       be found at http://www.kernel.org/doc/man-pages/.
58
59
60
61Linux                             2010-02-03    PTHREAD_ATTR_SETSCHEDPOLICY(3)
Impressum