]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_attr_setschedparam.3
intro.1, _exit.2, access.2, alarm.2, alloc_hugepages.2, arch_prctl.2, bind.2, chdir...
[thirdparty/man-pages.git] / man3 / pthread_attr_setschedparam.3
CommitLineData
b326494c
MK
1.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2.\" <mtk.manpages@gmail.com>
3.\"
4b72fb64 4.\" %%%LICENSE_START(verbatim)
b326494c
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
b326494c 25.\"
22cb459d 26.TH PTHREAD_ATTR_SETSCHEDPARAM 3 2012-03-15 "Linux" "Linux Programmer's Manual"
b326494c
MK
27.SH NAME
28pthread_attr_setschedparam, pthread_attr_getschedparam \- set/get
29scheduling parameter attributes in thread attributes object
30.SH SYNOPSIS
31.nf
32.B #include <pthread.h>
33
34.BI "int pthread_attr_setschedparam(pthread_attr_t *" attr ,
35.BI " const struct sched_param *" param );
36.BI "int pthread_attr_getschedparam(pthread_attr_t *" attr ,
37.BI " struct sched_param *" param );
38.sp
39Compile and link with \fI\-pthread\fP.
6030f2d8 40.fi
b326494c
MK
41.SH DESCRIPTION
42The
43.BR pthread_attr_setschedparam ()
44function sets the scheduling parameter attributes of the
45thread attributes object referred to by
3ab624b6 46.IR attr
b326494c
MK
47to the values specified in the buffer pointed to by
48.IR param .
49These attributes determine the scheduling parameters of
50a thread created using the thread attributes object
51.IR attr .
52
53The
54.BR pthread_attr_getschedparam ()
55returns the scheduling parameter attributes of the thread attributes object
56.IR attr
57in the buffer pointed to by
58.IR param .
59
60Scheduling parameters are maintained in the following structure:
61
62.in +4n
63.nf
64struct sched_param {
65 int sched_priority; /* Scheduling priority */
66};
67.fi
68.in
69
4c5f5413 70As can be seen, only one scheduling parameter is supported.
b326494c
MK
71For details of the permitted ranges for scheduling priorities
72in each scheduling policy, see
73.BR sched_setscheduler (2).
74.SH RETURN VALUE
75On success, these functions return 0;
c7094399 76on error, they return a nonzero error number.
b326494c
MK
77.SH ERRORS
78POSIX.1 documents
79.B EINVAL
80and
81.B ENOTSUP
82errors for
83.BR pthread_attr_setschedparam ().
84On Linux these functions always succeed
85(but portable and future-proof applications should nevertheless
86handle a possible error return).
87.\" .SH VERSIONS
88.\" Available since glibc 2.0.
89.SH CONFORMING TO
90POSIX.1-2001.
b326494c
MK
91.SH NOTES
92See
93.BR pthread_attr_setschedpolicy (3)
94for a list of the thread scheduling policies supported on Linux.
22cb459d
MK
95.SH EXAMPLE
96See
97.BR pthread_setschedparam (3).
b326494c 98.SH SEE ALSO
ca8a0bd2
MK
99.ad l
100.nh
b326494c
MK
101.BR sched_get_priority_min (2),
102.BR sched_setscheduler (2),
103.BR pthread_attr_init (3),
104.BR pthread_attr_setinheritsched (3),
105.BR pthread_attr_setschedpolicy (3),
106.BR pthread_create (3),
107.BR pthread_setschedparam (3),
108.BR pthread_setschedprio (3),
109.BR pthreads (7)