]>
Commit | Line | Data |
---|---|---|
4888dfbf MK |
1 | .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk |
2 | .\" <mtk.manpages@gmail.com> | |
3 | .\" | |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
4888dfbf | 5 | .\" |
4c1c5274 | 6 | .TH pthread_setschedprio 3 (date) "Linux man-pages (unreleased)" |
4888dfbf MK |
7 | .SH NAME |
8 | pthread_setschedprio \- set scheduling priority of a thread | |
a5057246 AC |
9 | .SH LIBRARY |
10 | POSIX threads library | |
8fc3b2cf | 11 | .RI ( libpthread ", " \-lpthread ) |
4888dfbf MK |
12 | .SH SYNOPSIS |
13 | .nf | |
14 | .B #include <pthread.h> | |
dbfe9c70 | 15 | .PP |
1ac20a9e | 16 | .BI "int pthread_setschedprio(pthread_t " thread ", int " prio ); |
6030f2d8 | 17 | .fi |
4888dfbf MK |
18 | .SH DESCRIPTION |
19 | The | |
20 | .BR pthread_setschedprio () | |
21 | function sets the scheduling priority of the thread | |
22 | .I thread | |
23 | to the value specified in | |
24 | .IR prio . | |
25 | (By contrast | |
26 | .BR pthread_setschedparam (3) | |
27 | changes both the scheduling policy and priority of a thread.) | |
28 | .\" FIXME . nptl/pthread_setschedprio.c has the following | |
29 | .\" /* If the thread should have higher priority because of some | |
30 | .\" PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority. */ | |
31 | .\" Eventually (perhaps after writing the mutexattr pages), we | |
32 | .\" may want to add something on the topic to this page. | |
33 | .\" nptl/pthread_setschedparam.c has a similar case. | |
34 | .SH RETURN VALUE | |
35 | On success, this function returns 0; | |
c7094399 | 36 | on error, it returns a nonzero error number. |
4888dfbf MK |
37 | If |
38 | .BR pthread_setschedprio () | |
39 | fails, the scheduling priority of | |
40 | .I thread | |
41 | is not changed. | |
42 | .SH ERRORS | |
43 | .TP | |
44 | .B EINVAL | |
45 | .I prio | |
46 | is not valid for the scheduling policy of the specified thread. | |
47 | .TP | |
48 | .B EPERM | |
49 | The caller does not have appropriate privileges | |
50 | to set the specified priority. | |
51 | .TP | |
52 | .B ESRCH | |
53 | No thread with the ID | |
54 | .I thread | |
55 | could be found. | |
56 | .PP | |
20b7991d | 57 | POSIX.1 also documents an |
4888dfbf MK |
58 | .B ENOTSUP |
59 | ("attempt was made to set the priority | |
60 | to an unsupported value") error for | |
0b80cf56 | 61 | .BR pthread_setschedparam (3). |
4888dfbf MK |
62 | .SH VERSIONS |
63 | This function is available in glibc since version 2.3.4. | |
49a933b0 | 64 | .SH ATTRIBUTES |
f158af49 PH |
65 | For an explanation of the terms used in this section, see |
66 | .BR attributes (7). | |
c466875e MK |
67 | .ad l |
68 | .nh | |
f158af49 PH |
69 | .TS |
70 | allbox; | |
c466875e | 71 | lbx lb lb |
f158af49 PH |
72 | l l l. |
73 | Interface Attribute Value | |
74 | T{ | |
49a933b0 | 75 | .BR pthread_setschedprio () |
f158af49 PH |
76 | T} Thread safety MT-Safe |
77 | .TE | |
c466875e MK |
78 | .hy |
79 | .ad | |
80 | .sp 1 | |
3113c7f3 | 81 | .SH STANDARDS |
20b7991d | 82 | POSIX.1-2001, POSIX.1-2008. |
4888dfbf MK |
83 | .SH NOTES |
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 | |
25ac8173 | 88 | .BR sched (7). |
4888dfbf | 89 | .SH SEE ALSO |
ca8a0bd2 MK |
90 | .ad l |
91 | .nh | |
4888dfbf MK |
92 | .BR getrlimit (2), |
93 | .BR sched_get_priority_min (2), | |
4888dfbf MK |
94 | .BR pthread_attr_init (3), |
95 | .BR pthread_attr_setinheritsched (3), | |
96 | .BR pthread_attr_setschedparam (3), | |
97 | .BR pthread_attr_setschedpolicy (3), | |
4888dfbf MK |
98 | .BR pthread_create (3), |
99 | .BR pthread_self (3), | |
3e5c319e | 100 | .BR pthread_setschedparam (3), |
25ac8173 MK |
101 | .BR pthreads (7), |
102 | .BR sched (7) |