1 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
26 .TH PTHREAD_ATTR_SETSCHEDPOLICY 3 2017-09-15 "Linux" "Linux Programmer's Manual"
28 pthread_attr_setschedpolicy, pthread_attr_getschedpolicy \- set/get
29 scheduling policy attribute in thread attributes object
32 .B #include <pthread.h>
34 .BI "int pthread_attr_setschedpolicy(pthread_attr_t *" attr \
36 .BI "int pthread_attr_getschedpolicy(const pthread_attr_t *" attr \
39 Compile and link with \fI\-pthread\fP.
43 .BR pthread_attr_setschedpolicy ()
44 function sets the scheduling policy attribute of the
45 thread attributes object referred to by
47 to the value specified in
49 This attribute determines the scheduling policy of
50 a thread created using the thread attributes object
53 The supported values for
60 with the semantics described in
62 .\" FIXME . pthread_setschedparam() places no restriction on the policy,
63 .\" but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
64 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=7013
67 .BR pthread_attr_getschedpolicy ()
68 returns the scheduling policy attribute of the thread attributes object
70 in the buffer pointed to by
73 In order for the policy setting made by
74 .BR pthread_attr_setschedpolicy ()
75 to have effect when calling
76 .BR pthread_create (3),
78 .BR pthread_attr_setinheritsched (3)
79 to set the inherit-scheduler attribute of the attributes object
82 .BR PTHREAD_EXPLICIT_SCHED .
84 On success, these functions return 0;
85 on error, they return a nonzero error number.
87 .BR pthread_attr_setschedpolicy ()
88 can fail with the following error:
94 POSIX.1 also documents an optional
96 error ("attempt was made to set the attribute to an unsupported value") for
97 .BR pthread_attr_setschedpolicy ().
99 .\" Available since glibc 2.0.
101 For an explanation of the terms used in this section, see
107 Interface Attribute Value
109 .BR pthread_attr_setschedpolicy (),
110 .BR pthread_attr_getschedpolicy ()
111 T} Thread safety MT-Safe
114 POSIX.1-2001, POSIX.1-2008.
117 .BR pthread_setschedparam (3).
121 .BR pthread_attr_init (3),
122 .BR pthread_attr_setinheritsched (3),
123 .BR pthread_attr_setschedparam (3),
124 .BR pthread_create (3),
125 .BR pthread_setschedparam (3),
126 .BR pthread_setschedprio (3),