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