summaryrefslogtreecommitdiff
path: root/usr/src/man/man3pool/pool_dynamic_location.3pool
blob: 99dc2e0852914b4b84b783b4c9e4c2b22e17fb8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
'\" te
.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
.\" 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.
.\" 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.
.\" 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]
.TH POOL_DYNAMIC_LOCATION 3POOL "Sep 23, 2003"
.SH NAME
pool_dynamic_location, pool_static_location, pool_version, pool_get_status,
pool_set_status, pool_resource_type_list \- resource pool framework functions
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lpool\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <pool.h>

\fBconst char *\fR\fBpool_dynamic_location\fR(\fBvoid\fR);
.fi

.LP
.nf
\fBconst char *\fR\fBpool_static_location\fR(\fBvoid\fR);
.fi

.LP
.nf
\fBuint_t\fR \fBpool_version\fR(\fBuint_t\fR \fIver\fR);
.fi

.LP
.nf
\fBint\fR \fBpool_get_status\fR(\fBint *\fR\fIstate\fR);
.fi

.LP
.nf
\fBint\fR \fBpool_set_status\fR(\fBint\fR \fIstate\fR);
.fi

.LP
.nf
\fBint\fR \fBpool_resource_type_list\fR(\fBconst char **\fR\fIreslist\fR,
     \fBuint_t *\fR\fInumres\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBpool_dynamic_location()\fR function returns the location used by the
pools framework to store the dynamic configuration.
.sp
.LP
The \fBpool_static_location()\fR function returns the location used by the
pools framework to store the default configuration used for pools framework
instantiation.
.sp
.LP
The \fBpool_version()\fR function can be used to inquire about the version
number of the library by specifying \fBPOOL_VER_NONE\fR. The current (most
capable) version is \fBPOOL_VER_CURRENT\fR. The user can set the version used
by the library by specifying the required version number. If this is not
possible, the version returned will be \fBPOOL_VER_NONE\fR.
.sp
.LP
The \fBpool_get_status()\fR function retrieves the current state of the pools
facility. If state is non-null, then on successful completion the state of the
pools facility is stored in the location pointed to by state.
.sp
.LP
The \fBpool_set_status()\fR function modifies the current state of the pools
facility. On successful completion the state of the pools facility is changed
to match the value supplied in state. Only two values are valid for state,
\fBPOOL_DISABLED\fR and \fBPOOL_ENABLED\fR, both of which are defined in
<\fBpool.h\fR>.
.sp
.LP
The \fBpool_resource_type_list()\fR function enumerates the resource types
supported by the pools framework on this platform. If \fInumres\fR and
\fIreslist\fR are both non-null, \fIreslist\fR points to a buffer where a list
of resource types in the system is to be stored, and \fInumres\fR points to the
maximum number of resource types the buffer can hold. On successful completion,
the list of resource types up to the maximum buffer size is stored in the
buffer pointed to by \fIreslist\fR.
.SH RETURN VALUES
.sp
.LP
The \fBpool_dynamic_location()\fR function returns the location used by the
pools framework to store the dynamic configuration.
.sp
.LP
The \fBpool_static_location()\fR function returns the location used by the
pools framework to store the default configuration used for pools framework
instantiation.
.sp
.LP
The \fBpool_version()\fR function returns the version number of the library or
\fBPOOL_VER_NONE\fR.
.sp
.LP
Upon successful completion, \fBpool_get_status()\fR, \fBpool_set_status()\fR,
and \fBpool_resource_type_list()\fR all return 0. Otherwise, \(mi1 is returned
and \fBpool_error\fR(3POOL) returns the pool specific error.
.SH ERRORS
.sp
.LP
No errors are defined for \fBpool_dynamic_location()\fR,
\fBpool_static_location()\fR, and \fBpool_version()\fR.
.sp
.LP
The \fBpool_get_status()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBPOE_SYSTEM\fR\fR
.ad
.RS 14n
A system error occurred when accessing the kernel pool state.
.RE

.sp
.LP
The \fBpool_set_status()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBPOE_SYSTEM\fR\fR
.ad
.RS 14n
A system error occurred when modifying the kernel pool state.
.RE

.sp
.LP
The \fBpool_resource_type_list()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBPOE_BADPARAM\fR\fR
.ad
.RS 16n
The \fInumres\fR parameter was \fINULL\fR.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRGet the static location used by the pools framework.
.sp
.in +2
.nf
#include sys/types.h>
#include <unistd.h>
#include <pool.h>

\&...

const char *location = pool_dynamic_location();

\&...

    (void) fprintf(stderr, "pool dynamic location is %s\en",
           location);
.fi
.in -2

.LP
\fBExample 2 \fREnable the pools facility.
.sp
.in +2
.nf
#include <stdio.h>
#include <pool.h>

\&...

   if (pool_set_status(POOL_ENABLED) != 0) {
      (void) fprintf(stderr, "pools could not be enabled %s\en",
             pool_strerror(pool_error()));
             exit(2);
   }
\&...
.fi
.in -2

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
CSI	Enabled
_
Interface Stability	Unstable
_
MT-Level	Safe
.TE

.SH SEE ALSO
.sp
.LP
\fBlibpool\fR(3LIB), \fBpool_error\fR(3POOL), \fBattributes\fR(5)