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_ATTR_SETSCHEDPARAM 3 2012-03-15 "Linux" "Linux Programmer's Manual"
26 pthread_attr_setschedparam, pthread_attr_getschedparam \- set/get
27 scheduling parameter attributes in thread attributes object
30 .B #include <pthread.h>
32 .BI "int pthread_attr_setschedparam(pthread_attr_t *" attr ,
33 .BI " const struct sched_param *" param );
34 .BI "int pthread_attr_getschedparam(pthread_attr_t *" attr ,
35 .BI " struct sched_param *" param );
37 Compile and link with \fI\-pthread\fP.
41 .BR pthread_attr_setschedparam ()
42 function sets the scheduling parameter attributes of the
43 thread attributes object referred to by
45 to the values specified in the buffer pointed to by
47 These attributes determine the scheduling parameters of
48 a thread created using the thread attributes object
52 .BR pthread_attr_getschedparam ()
53 returns the scheduling parameter attributes of the thread attributes object
55 in the buffer pointed to by
58 Scheduling parameters are maintained in the following structure:
63 int sched_priority; /* Scheduling priority */
68 As can be seen, only one scheduling parameter is supported.
69 For details of the permitted ranges for scheduling priorities
70 in each scheduling policy, see
71 .BR sched_setscheduler (2).
73 On success, these functions return 0;
74 on error, they return a nonzero error number.
81 .BR pthread_attr_setschedparam ().
82 On Linux these functions always succeed
83 (but portable and future-proof applications should nevertheless
84 handle a possible error return).
86 .\" Available since glibc 2.0.
91 .BR pthread_attr_setschedpolicy (3)
92 for a list of the thread scheduling policies supported on Linux.
95 .BR pthread_setschedparam (3).
97 .BR sched_get_priority_min (2),
98 .BR sched_setscheduler (2),
99 .BR pthread_attr_init (3),
100 .BR pthread_attr_setinheritsched (3),
101 .BR pthread_attr_setschedpolicy (3),
102 .BR pthread_create (3),
103 .BR pthread_setschedparam (3),
104 .BR pthread_setschedprio (3),