Print this page
12202 noise in example code in some section 3pool man pages
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3pool/pool_get_binding.3pool
+++ new/usr/src/man/man3pool/pool_get_binding.3pool
1 1 '\" te
2 2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 -.TH POOL_GET_BINDING 3POOL "Mar 27, 2007"
6 +.TH POOL_GET_BINDING 3POOL "January 18, 2020"
7 7 .SH NAME
8 8 pool_get_binding, pool_set_binding, pool_get_resource_binding \- set and query
9 9 process to resource pool bindings
10 10 .SH SYNOPSIS
11 -.LP
12 11 .nf
13 12 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lpool\fR [ \fIlibrary\fR\&.\|.\|. ]
14 13 #include <pool.h>
15 14
16 15 \fBchar *\fR\fBpool_get_binding\fR(\fBpid_t\fR \fIpid\fR);
17 16 .fi
18 17
19 18 .LP
20 19 .nf
21 20 \fBint\fR \fBpool_set_binding\fR(\fBconst char *\fR\fIpool\fR, \fBidtype_t\fR \fIidtype\fR,
22 21 \fBid_t\fR \fIid\fR);
23 22 .fi
24 23
25 24 .LP
26 25 .nf
27 26 \fBchar *\fR\fBpool_get_resource_binding\fR(\fBconst char *\fR\fItype\fR, \fBpid_t\fR \fIpid\fR);
28 27 .fi
29 28
30 29 .SH DESCRIPTION
31 -.sp
32 -.LP
33 30 The \fBpool_get_binding()\fR function returns the name of the pool on the
34 31 running system that contains the set of resources to which the given process is
35 32 bound. If no such pool exists on the system or the search returns more than one
36 33 pool (since the set of resources is referred to by more than one pool),
37 34 \fINULL\fR is returned and the pool error value is set to
38 35 \fBPOE_INVALID_SEARCH\fR.
39 36 .sp
40 37 .LP
41 38 It is possible that one of the resources to which the given process is bound is
42 39 not associated with a pool. This could occur if a processor set was created
43 40 with one of the \fBpset_()\fR functions and the process was then bound to that
44 41 set. It could also occur if the process was bound to a resource set not
45 42 currently associated with a pool, since resources can exist that are not
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
46 43 associated with a pool.
47 44 .sp
48 45 .LP
49 46 The \fBpool_set_binding()\fR function binds the processes matching \fIidtype\fR
50 47 and \fIid\fR to the resources associated with \fIpool\fR on the running system.
51 48 This function requires the privilege required by the underlying resource types
52 49 referenced by the pool; generally, this requirement is equivalent to requiring
53 50 superuser privilege.
54 51 .sp
55 52 .LP
56 -The \fIidtype\fR parameter can be of the following types:
53 +The \fIidtype\fR parameter can be one of the following types:
57 54 .sp
58 55 .ne 2
59 56 .na
60 57 \fB\fBP_PID\fR\fR
61 58 .ad
62 59 .RS 12n
63 60 The \fIid\fR parameter is a pid.
64 61 .RE
65 62
66 63 .sp
67 64 .ne 2
68 65 .na
69 66 \fB\fBP_TASKID\fR\fR
70 67 .ad
71 68 .RS 12n
72 69 The \fIid\fR parameter is a taskid.
73 70 .RE
74 71
75 72 .sp
76 73 .ne 2
77 74 .na
78 75 \fB\fBP_PROJID\fR\fR
79 76 .ad
80 77 .RS 12n
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
81 78 The \fIid\fR parameter is a project ID. All currently running processes
82 79 belonging to the given project will be bound to the pool's resources.
83 80 .RE
84 81
85 82 .sp
86 83 .LP
87 84 The \fBpool_get_resource_binding()\fR function returns the name of the resource
88 85 of the supplied type to which the supplied process is bound.
89 86 .sp
90 87 .LP
91 -The application must explicity free the memory allocated for the return values
88 +The application must explicitly free the memory allocated for the return values
92 89 for \fBpool_get_binding()\fR and \fBpool_get_resource_binding()\fR.
93 90 .SH RETURN VALUES
94 -.sp
95 -.LP
96 91 Upon successful completion, \fBpool_get_binding()\fR returns the name of the
97 92 pool to which the process is bound. Otherwise it returns \fINULL\fR and
98 93 \fBpool_error\fR(3POOL) returns the pool-specific error value.
99 94 .sp
100 95 .LP
101 96 Upon successful completion, \fBpool_set_binding()\fR returns \fBPO_SUCCESS\fR.
102 97 Otherwise, it returns \fBPO_FAIL\fR and \fBpool_error()\fR returns the
103 98 pool-specific error value.
104 99 .sp
105 100 .LP
106 101 Upon successful completion, \fBpool_get_resource_binding()\fR returns the name
107 102 of the resource of the specified type to which the process is bound. Otherwise
108 103 it returns \fINULL\fR and \fBpool_error()\fR returns the pool-specific error
109 104 value.
110 105 .SH ERRORS
111 -.sp
112 -.LP
113 106 The \fBpool_get_binding()\fR function will fail if:
114 107 .sp
115 108 .ne 2
116 109 .na
117 110 \fB\fBPOE_INVALID_CONF\fR\fR
118 111 .ad
119 112 .RS 22n
120 113 The configuration is invalid.
121 114 .RE
122 115
123 116 .sp
124 117 .ne 2
125 118 .na
126 119 \fB\fBPOE_INVALID_SEARCH\fR\fR
127 120 .ad
128 121 .RS 22n
129 122 It is not possible to determine the binding for this target due to the
130 123 overlapping nature of the pools configured for this system, or the pool could
131 124 not be located.
132 125 .RE
133 126
134 127 .sp
135 128 .ne 2
136 129 .na
137 130 \fB\fBPOE_SYSTEM\fR\fR
138 131 .ad
139 132 .RS 22n
140 133 A system error has occurred. Check the system error code for more details.
141 134 .RE
142 135
143 136 .sp
144 137 .LP
145 138 The \fBpool_set_binding()\fR function will fail if:
146 139 .sp
147 140 .ne 2
148 141 .na
149 142 \fB\fBPOE_INVALID_SEARCH\fR\fR
150 143 .ad
151 144 .RS 22n
152 145 The pool could not be found.
153 146 .RE
154 147
155 148 .sp
156 149 .ne 2
157 150 .na
158 151 \fB\fBPOE_INVALID_CONF\fR\fR
159 152 .ad
160 153 .RS 22n
161 154 The configuration is invalid.
162 155 .RE
163 156
164 157 .sp
165 158 .ne 2
166 159 .na
167 160 \fB\fBPOE_SYSTEM\fR\fR
168 161 .ad
169 162 .RS 22n
170 163 A system error has occurred. Check the system error code for more details.
171 164 .RE
172 165
173 166 .sp
174 167 .LP
175 168 The \fBpool_get_resource_binding()\fR function will fail if:
176 169 .sp
177 170 .ne 2
178 171 .na
179 172 \fB\fBPOE_INVALID_CONF\fR\fR
180 173 .ad
181 174 .RS 22n
182 175 The configuration is invalid.
183 176 .RE
184 177
185 178 .sp
186 179 .ne 2
187 180 .na
188 181 \fB\fBPOE_INVALID_SEARCH\fR\fR
189 182 .ad
190 183 .RS 22n
191 184 The target is not bound to a resource of the specified type.
192 185 .RE
193 186
↓ open down ↓ |
71 lines elided |
↑ open up ↑ |
194 187 .sp
195 188 .ne 2
196 189 .na
197 190 \fB\fBPOE_SYSTEM\fR\fR
198 191 .ad
199 192 .RS 22n
200 193 A system error has occurred. Check the system error code for more details.
201 194 .RE
202 195
203 196 .SH EXAMPLES
204 -.LP
205 197 \fBExample 1 \fRBind the current process to the pool named "target".
206 198 .sp
207 199 .in +2
208 200 .nf
209 201 #include <sys/types.h>
210 202 #include <pool.h>
211 203 #include <unistd.h>
212 204
213 205 \&...
214 206
215 207 id_t pid = getpid();
216 208
217 209 \&...
218 210
219 211 if (pool_set_binding("target", P_PID, pid) == PO_FAIL) \{
220 - (void) fprintf(stderr, "pool binding failed (\\%d)\\B{}n",
212 + (void) fprintf(stderr, "pool binding failed (%d)\\n",
221 213 pool_error());
222 214 \}
223 215 .fi
224 216 .in -2
225 217
226 218 .SH ATTRIBUTES
227 -.sp
228 -.LP
229 219 See \fBattributes\fR(5) for descriptions of the following attributes:
230 220 .sp
231 221
232 222 .sp
233 223 .TS
234 224 box;
235 225 c | c
236 226 l | l .
237 227 ATTRIBUTE TYPE ATTRIBUTE VALUE
238 228 _
239 229 CSI Enabled
240 230 _
241 231 Interface Stability Unstable
242 232 _
243 233 MT-Level Safe
244 234 .TE
245 235
246 236 .SH SEE ALSO
247 -.sp
248 -.LP
249 237 \fBlibpool\fR(3LIB), \fBpool_error\fR(3POOL), \fBattributes\fR(5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX