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_setschedprio 3 (date) "Linux man-pages (unreleased)"
9 pthread_setschedprio \- set scheduling priority of a thread
12 .RI ( libpthread ", " \-lpthread )
15 .B #include <pthread.h>
17 .BI "int pthread_setschedprio(pthread_t " thread ", int " prio );
21 .BR pthread_setschedprio ()
22 function sets the scheduling priority of the thread
24 to the value specified in
27 .BR pthread_setschedparam (3)
28 changes both the scheduling policy and priority of a thread.)
29 .\" FIXME . nptl/pthread_setschedprio.c has the following
30 .\" /* If the thread should have higher priority because of some
31 .\" PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
32 .\" Eventually (perhaps after writing the mutexattr pages), we
33 .\" may want to add something on the topic to this page.
34 .\" nptl/pthread_setschedparam.c has a similar case.
36 On success, this function returns 0;
37 on error, it returns a nonzero error number.
39 .BR pthread_setschedprio ()
40 fails, the scheduling priority of
47 is not valid for the scheduling policy of the specified thread.
50 The caller does not have appropriate privileges
51 to set the specified priority.
58 POSIX.1 also documents an
60 ("attempt was made to set the priority
61 to an unsupported value") error for
62 .BR pthread_setschedparam (3).
64 For an explanation of the terms used in this section, see
72 Interface Attribute Value
74 .BR pthread_setschedprio ()
75 T} Thread safety MT-Safe
86 For a description of the permissions required to, and the effect of,
87 changing a thread's scheduling priority,
88 and details of the permitted ranges for priorities
89 in each scheduling policy, see
95 .BR sched_get_priority_min (2),
96 .BR pthread_attr_init (3),
97 .BR pthread_attr_setinheritsched (3),
98 .BR pthread_attr_setschedparam (3),
99 .BR pthread_attr_setschedpolicy (3),
100 .BR pthread_create (3),
101 .BR pthread_self (3),
102 .BR pthread_setschedparam (3),