1 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .TH PTHREAD_SETSCHEDPRIO 3 2008-11-06 "Linux" "Linux Programmer's Manual"
26 pthread_setschedprio \- set scheduling priority of a thread
29 .B #include <pthread.h>
31 .BI "pthread_setschedprio(pthread_t " thread ", int " prio );
33 Compile and link with \fI\-pthread\fP.
37 .BR pthread_setschedprio ()
38 function sets the scheduling priority of the thread
40 to the value specified in
43 .BR pthread_setschedparam (3)
44 changes both the scheduling policy and priority of a thread.)
45 .\" FIXME . nptl/pthread_setschedprio.c has the following
46 .\" /* If the thread should have higher priority because of some
47 .\" PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
48 .\" Eventually (perhaps after writing the mutexattr pages), we
49 .\" may want to add something on the topic to this page.
50 .\" nptl/pthread_setschedparam.c has a similar case.
52 On success, this function returns 0;
53 on error, it returns a nonzero error number.
55 .BR pthread_setschedprio ()
56 fails, the scheduling priority of
63 is not valid for the scheduling policy of the specified thread.
66 The caller does not have appropriate privileges
67 to set the specified priority.
74 POSIX.1-2001 also documents an
76 ("attempt was made to set the priority
77 to an unsupported value") error for
78 .BR pthread_setschedparam (3).
80 This function is available in glibc since version 2.3.4.
84 For a description of the permissions required to, and the effect of,
85 changing a thread's scheduling priority,
86 and details of the permitted ranges for priorities
87 in each scheduling policy, see
88 .BR sched_setscheduler (2).
91 .BR sched_get_priority_min (2),
92 .BR sched_setscheduler (2),
93 .BR pthread_attr_init (3),
94 .BR pthread_attr_setinheritsched (3),
95 .BR pthread_attr_setschedparam (3),
96 .BR pthread_attr_setschedpolicy (3),
97 .BR pthread_create (3),
99 .BR pthread_setschedparam (3),