1pool_dynamic_locPaotoilonC(o3nPfOiOgLu)ration Manipulation Librpaoroyl_Fduynncatmiiocn_slocation(3POOL)
2
3
4
6 pool_dynamic_location, pool_static_location, pool_version,
7 pool_get_status, pool_set_status, pool_resource_type_list - resource
8 pool framework functions
9
11 cc [ flag... ] file... -lpool [ library... ]
12 #include <pool.h>
13
14 const char *pool_dynamic_location(void);
15
16
17 const char *pool_static_location(void);
18
19
20 uint_t pool_version(uint_t ver);
21
22
23 int pool_get_status(int *state);
24
25
26 int pool_set_status(int state);
27
28
29 int pool_resource_type_list(const char **reslist,
30 uint_t *numres);
31
32
34 The pool_dynamic_location() function returns the location used by the
35 pools framework to store the dynamic configuration.
36
37
38 The pool_static_location() function returns the location used by the
39 pools framework to store the default configuration used for pools
40 framework instantiation.
41
42
43 The pool_version() function can be used to inquire about the version
44 number of the library by specifying POOL_VER_NONE. The current (most
45 capable) version is POOL_VER_CURRENT. The user can set the version used
46 by the library by specifying the required version number. If this is
47 not possible, the version returned will be POOL_VER_NONE.
48
49
50 The pool_get_status() function retrieves the current state of the pools
51 facility. If state is non-null, then on successful completion the state
52 of the pools facility is stored in the location pointed to by state.
53
54
55 The pool_set_status() function modifies the current state of the pools
56 facility. On successful completion the state of the pools facility is
57 changed to match the value supplied in state. Only two values are valid
58 for state, POOL_DISABLED and POOL_ENABLED, both of which are defined in
59 <pool.h>.
60
61
62 The pool_resource_type_list() function enumerates the resource types
63 supported by the pools framework on this platform. If numres and
64 reslist are both non-null, reslist points to a buffer where a list of
65 resource types in the system is to be stored, and numres points to the
66 maximum number of resource types the buffer can hold. On successful
67 completion, the list of resource types up to the maximum buffer size is
68 stored in the buffer pointed to by reslist.
69
71 The pool_dynamic_location() function returns the location used by the
72 pools framework to store the dynamic configuration.
73
74
75 The pool_static_location() function returns the location used by the
76 pools framework to store the default configuration used for pools
77 framework instantiation.
78
79
80 The pool_version() function returns the version number of the library
81 or POOL_VER_NONE.
82
83
84 Upon successful completion, pool_get_status(), pool_set_status(), and
85 pool_resource_type_list() all return 0. Otherwise, −1 is returned and
86 pool_error(3POOL) returns the pool specific error.
87
89 No errors are defined for pool_dynamic_location(), pool_static_loca‐
90 tion(), and pool_version().
91
92
93 The pool_get_status() function will fail if:
94
95 POE_SYSTEM A system error occurred when accessing the kernel pool
96 state.
97
98
99
100 The pool_set_status() function will fail if:
101
102 POE_SYSTEM A system error occurred when modifying the kernel pool
103 state.
104
105
106
107 The pool_resource_type_list() function will fail if:
108
109 POE_BADPARAM The numres parameter was NULL.
110
111
113 Example 1 Get the static location used by the pools framework.
114
115 #include sys/types.h>
116 #include <unistd.h>
117 #include <pool.h>
118
119 ...
120
121 const char *location = pool_dynamic_location();
122
123 ...
124
125 (void) fprintf(stderr, "pool dynamic location is %s\n",
126 location);
127
128
129 Example 2 Enable the pools facility.
130
131 #include <stdio.h>
132 #include <pool.h>
133
134 ...
135
136 if (pool_set_status(POOL_ENABLED) != 0) {
137 (void) fprintf(stderr, "pools could not be enabled %s\n",
138 pool_strerror(pool_error()));
139 exit(2);
140 }
141 ...
142
143
145 See attributes(5) for descriptions of the following attributes:
146
147
148
149
150 ┌─────────────────────────────┬─────────────────────────────┐
151 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
152 ├─────────────────────────────┼─────────────────────────────┤
153 │CSI │Enabled │
154 ├─────────────────────────────┼─────────────────────────────┤
155 │Interface Stability │Unstable │
156 ├─────────────────────────────┼─────────────────────────────┤
157 │MT-Level │Safe │
158 └─────────────────────────────┴─────────────────────────────┘
159
161 libpool(3LIB), pool_error(3POOL), attributes(5)
162
163
164
165SunOS 5.11 23 Sep 2003 pool_dynamic_location(3POOL)