]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_setschedprio.3
_exit.2, chmod.2, abs.3, cbrt.3, mkdtemp.3: ffix
[thirdparty/man-pages.git] / man3 / pthread_setschedprio.3
CommitLineData
4888dfbf
MK
1.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2.\" <mtk.manpages@gmail.com>
3.\"
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.
7.\"
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.
12.\"
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
19.\" professionally.
20.\"
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
23.\"
24.TH PTHREAD_SETSCHEDPRIO 3 2008-11-06 "Linux" "Linux Programmer's Manual"
25.SH NAME
26pthread_setschedprio \- set scheduling priority of a thread
27.SH SYNOPSIS
28.nf
29.B #include <pthread.h>
30
31.BI "pthread_setschedprio(pthread_t " thread ", int " prio );
32.sp
33Compile and link with \fI\-pthread\fP.
34.SH DESCRIPTION
35The
36.BR pthread_setschedprio ()
37function sets the scheduling priority of the thread
38.I thread
39to the value specified in
40.IR prio .
41(By contrast
42.BR pthread_setschedparam (3)
43changes both the scheduling policy and priority of a thread.)
44.\" FIXME . nptl/pthread_setschedprio.c has the following
45.\" /* If the thread should have higher priority because of some
46.\" PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */
47.\" Eventually (perhaps after writing the mutexattr pages), we
48.\" may want to add something on the topic to this page.
49.\" nptl/pthread_setschedparam.c has a similar case.
50.SH RETURN VALUE
51On success, this function returns 0;
c7094399 52on error, it returns a nonzero error number.
4888dfbf
MK
53If
54.BR pthread_setschedprio ()
55fails, the scheduling priority of
56.I thread
57is not changed.
58.SH ERRORS
59.TP
60.B EINVAL
61.I prio
62is not valid for the scheduling policy of the specified thread.
63.TP
64.B EPERM
65The caller does not have appropriate privileges
66to set the specified priority.
67.TP
68.B ESRCH
69No thread with the ID
70.I thread
71could be found.
72.PP
73POSIX.1-2001 also documents an
74.B ENOTSUP
75("attempt was made to set the priority
76to an unsupported value") error for
0b80cf56 77.BR pthread_setschedparam (3).
4888dfbf
MK
78.SH VERSIONS
79This function is available in glibc since version 2.3.4.
80.SH CONFORMING TO
81POSIX.1-2001.
82.SH NOTES
83For a description of the permissions required to, and the effect of,
84changing a thread's scheduling priority,
85and details of the permitted ranges for priorities
86in each scheduling policy, see
87.BR sched_setscheduler (2).
88.SH SEE ALSO
89.BR getrlimit (2),
90.BR sched_get_priority_min (2),
91.BR sched_setscheduler (2),
92.BR pthread_attr_init (3),
93.BR pthread_attr_setinheritsched (3),
94.BR pthread_attr_setschedparam (3),
95.BR pthread_attr_setschedpolicy (3),
4888dfbf
MK
96.BR pthread_create (3),
97.BR pthread_self (3),
3e5c319e 98.BR pthread_setschedparam (3),
4888dfbf 99.BR pthreads (7)