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 2010-02-03 "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.
40 .BR pthread_attr_setschedparam ()
41 function sets the scheduling parameter attributes of the
42 thread attributes object referred to by
44 to the values specified in the buffer pointed to by
46 These attributes determine the scheduling parameters of
47 a thread created using the thread attributes object
51 .BR pthread_attr_getschedparam ()
52 returns the scheduling parameter attributes of the thread attributes object
54 in the buffer pointed to by
57 Scheduling parameters are maintained in the following structure:
62 int sched_priority; /* Scheduling priority */
67 As can be seen, only one scheduling parameter is supported.
68 For details of the permitted ranges for scheduling priorities
69 in each scheduling policy, see
70 .BR sched_setscheduler (2).
72 On success, these functions return 0;
73 on error, they return a nonzero error number.
80 .BR pthread_attr_setschedparam ().
81 On Linux these functions always succeed
82 (but portable and future-proof applications should nevertheless
83 handle a possible error return).
85 .\" Available since glibc 2.0.
90 .BR pthread_setschedparam (3).
93 .BR pthread_attr_setschedpolicy (3)
94 for a list of the thread scheduling policies supported on Linux.
96 .BR sched_get_priority_min (2),
97 .BR sched_setscheduler (2),
98 .BR pthread_attr_init (3),
99 .BR pthread_attr_setinheritsched (3),
100 .BR pthread_attr_setschedpolicy (3),
101 .BR pthread_create (3),
102 .BR pthread_setschedparam (3),
103 .BR pthread_setschedprio (3),