1 .\" Copyright (C) 2000 Jason Evans <jasone@FreeBSD.org>.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice(s), this list of conditions and the following disclaimer as
9 .\" the first lines of this file unmodified other than the possible
10 .\" addition of one or more copyright notices.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice(s), this list of conditions and the following disclaimer in
13 .\" the documentation and/or other materials provided with the
16 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
17 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
20 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 .Nm pthread_attr_init ,
34 .Nm pthread_attr_destroy ,
35 .Nm pthread_attr_setstack ,
36 .Nm pthread_attr_getstack ,
37 .Nm pthread_attr_setstacksize ,
38 .Nm pthread_attr_getstacksize ,
39 .Nm pthread_attr_setguardsize ,
40 .Nm pthread_attr_getguardsize ,
41 .Nm pthread_attr_setstackaddr ,
42 .Nm pthread_attr_getstackaddr ,
43 .Nm pthread_attr_setdetachstate ,
44 .Nm pthread_attr_getdetachstate ,
45 .Nm pthread_attr_setinheritsched ,
46 .Nm pthread_attr_getinheritsched ,
47 .Nm pthread_attr_setschedparam ,
48 .Nm pthread_attr_getschedparam ,
49 .Nm pthread_attr_setschedpolicy ,
50 .Nm pthread_attr_getschedpolicy ,
51 .Nm pthread_attr_setscope ,
52 .Nm pthread_attr_getscope
53 .Nd thread attribute operations
59 .Fn pthread_attr_init "pthread_attr_t *attr"
61 .Fn pthread_attr_destroy "pthread_attr_t *attr"
63 .Fn pthread_attr_setstack "pthread_attr_t *attr" " void *stackaddr" "size_t stacksize"
65 .Fn pthread_attr_getstack "const pthread_attr_t * restrict attr" "void ** restrict stackaddr" "size_t * restrict stacksize"
67 .Fn pthread_attr_setstacksize "pthread_attr_t *attr" "size_t stacksize"
69 .Fn pthread_attr_getstacksize "const pthread_attr_t *attr" "size_t *stacksize"
71 .Fn pthread_attr_setguardsize "pthread_attr_t *attr" "size_t guardsize"
73 .Fn pthread_attr_getguardsize "const pthread_attr_t *attr" "size_t *guardsize"
75 .Fn pthread_attr_setstackaddr "pthread_attr_t *attr" "void *stackaddr"
77 .Fn pthread_attr_getstackaddr "const pthread_attr_t *attr" "void **stackaddr"
79 .Fn pthread_attr_setdetachstate "pthread_attr_t *attr" "int detachstate"
81 .Fn pthread_attr_getdetachstate "const pthread_attr_t *attr" "int *detachstate"
83 .Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched"
85 .Fn pthread_attr_getinheritsched "const pthread_attr_t *attr" "int *inheritsched"
87 .Fn pthread_attr_setschedparam "pthread_attr_t *attr" "const struct sched_param *param"
89 .Fn pthread_attr_getschedparam "const pthread_attr_t *attr" "struct sched_param *param"
91 .Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy"
93 .Fn pthread_attr_getschedpolicy "const pthread_attr_t *attr" "int *policy"
95 .Fn pthread_attr_setscope "pthread_attr_t *attr" "int contentionscope"
97 .Fn pthread_attr_getscope "const pthread_attr_t *attr" "int *contentionscope"
99 Thread attributes are used to specify parameters to
101 One attribute object can be used in multiple calls to
103 with or without modifications between calls.
106 .Fn pthread_attr_init
109 with all the default thread attributes.
112 .Fn pthread_attr_destroy
117 .Fn pthread_attr_set*
118 functions set the attribute that corresponds to each function name.
121 .Fn pthread_attr_get*
122 functions copy the value of the attribute that corresponds to each function name
123 to the location pointed to by the second function parameter.
125 If successful, these functions return 0.
126 Otherwise, an error number is returned to indicate the error.
129 .Fn pthread_attr_init
130 function will fail if:
137 .Fn pthread_attr_destroy
138 function will fail if:
146 .Fn pthread_attr_setstacksize
148 .Fn pthread_attr_setstack
149 functions will fail if:
154 .Dv PTHREAD_STACK_MIN .
158 .Fn pthread_attr_setdetachstate
159 function will fail if:
167 .Fn pthread_attr_setinheritsched
168 function will fail if:
176 .Fn pthread_attr_setschedparam
177 function will fail if:
188 .Fn pthread_attr_setschedpolicy
189 function will fail if:
195 Invalid or unsupported value for
200 .Fn pthread_attr_setscope
201 function will fail if:
207 Invalid or unsupported value for
208 .Fa contentionscope .
211 .Xr pthread_attr_get_np 3 ,
215 .Fn pthread_attr_init ,
216 .Fn pthread_attr_destroy ,
217 .Fn pthread_attr_setstacksize ,
218 .Fn pthread_attr_getstacksize ,
219 .Fn pthread_attr_setstackaddr ,
220 .Fn pthread_attr_getstackaddr ,
221 .Fn pthread_attr_setdetachstate ,
223 .Fn pthread_attr_getdetachstate
228 .Fn pthread_attr_setinheritsched ,
229 .Fn pthread_attr_getinheritsched ,
230 .Fn pthread_attr_setschedparam ,
231 .Fn pthread_attr_getschedparam ,
232 .Fn pthread_attr_setschedpolicy ,
233 .Fn pthread_attr_getschedpolicy ,
234 .Fn pthread_attr_setscope ,
236 .Fn pthread_attr_getscope