2 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .TH pthread_attr_setschedpolicy 3 (date) "Linux man-pages (unreleased)"
9 pthread_attr_setschedpolicy, pthread_attr_getschedpolicy \- set/get
10 scheduling policy attribute in thread attributes object
13 .RI ( libpthread ", " \-lpthread )
16 .B #include <pthread.h>
18 .BI "int pthread_attr_setschedpolicy(pthread_attr_t *" attr ", int " policy );
19 .BI "int pthread_attr_getschedpolicy(const pthread_attr_t *restrict " attr ,
20 .BI " int *restrict " policy );
24 .BR pthread_attr_setschedpolicy ()
25 function sets the scheduling policy attribute of the
26 thread attributes object referred to by
28 to the value specified in
30 This attribute determines the scheduling policy of
31 a thread created using the thread attributes object
34 The supported values for
41 with the semantics described in
43 .\" FIXME . pthread_setschedparam() places no restriction on the policy,
44 .\" but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
45 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=7013
48 .BR pthread_attr_getschedpolicy ()
49 returns the scheduling policy attribute of the thread attributes object
51 in the buffer pointed to by
54 In order for the policy setting made by
55 .BR pthread_attr_setschedpolicy ()
56 to have effect when calling
57 .BR pthread_create (3),
59 .BR pthread_attr_setinheritsched (3)
60 to set the inherit-scheduler attribute of the attributes object
63 .BR PTHREAD_EXPLICIT_SCHED .
65 On success, these functions return 0;
66 on error, they return a nonzero error number.
68 .BR pthread_attr_setschedpolicy ()
69 can fail with the following error:
75 POSIX.1 also documents an optional
77 error ("attempt was made to set the attribute to an unsupported value") for
78 .BR pthread_attr_setschedpolicy ().
80 .\" Available since glibc 2.0.
82 For an explanation of the terms used in this section, see
90 Interface Attribute Value
92 .BR pthread_attr_setschedpolicy (),
93 .BR pthread_attr_getschedpolicy ()
94 T} Thread safety MT-Safe
100 POSIX.1-2001, POSIX.1-2008.
103 .BR pthread_setschedparam (3).
107 .BR pthread_attr_init (3),
108 .BR pthread_attr_setinheritsched (3),
109 .BR pthread_attr_setschedparam (3),
110 .BR pthread_create (3),
111 .BR pthread_setschedparam (3),
112 .BR pthread_setschedprio (3),