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.man.txt
+++ new/usr/src/man/man3pool/pool_get_binding.3pool.man.txt
1 1 POOL_GET_BINDING(3POOL) Pool Configuration Manipulation Library Functions
2 2
3 3
4 4
5 5 NAME
6 6 pool_get_binding, pool_set_binding, pool_get_resource_binding - set and
7 7 query process to resource pool bindings
8 8
9 9 SYNOPSIS
10 10 cc [ flag... ] file... -lpool [ library... ]
11 11 #include <pool.h>
12 12
13 13 char *pool_get_binding(pid_t pid);
14 14
15 15
16 16 int pool_set_binding(const char *pool, idtype_t idtype,
17 17 id_t id);
18 18
19 19
20 20 char *pool_get_resource_binding(const char *type, pid_t pid);
21 21
22 22
23 23 DESCRIPTION
24 24 The pool_get_binding() function returns the name of the pool on the
25 25 running system that contains the set of resources to which the given
26 26 process is bound. If no such pool exists on the system or the search
27 27 returns more than one pool (since the set of resources is referred to
28 28 by more than one pool), NULL is returned and the pool error value is
29 29 set to POE_INVALID_SEARCH.
30 30
31 31
32 32 It is possible that one of the resources to which the given process is
33 33 bound is not associated with a pool. This could occur if a processor
34 34 set was created with one of the pset_() functions and the process was
35 35 then bound to that set. It could also occur if the process was bound to
36 36 a resource set not currently associated with a pool, since resources
↓ open down ↓ |
36 lines elided |
↑ open up ↑ |
37 37 can exist that are not associated with a pool.
38 38
39 39
40 40 The pool_set_binding() function binds the processes matching idtype and
41 41 id to the resources associated with pool on the running system. This
42 42 function requires the privilege required by the underlying resource
43 43 types referenced by the pool; generally, this requirement is equivalent
44 44 to requiring superuser privilege.
45 45
46 46
47 - The idtype parameter can be of the following types:
47 + The idtype parameter can be one of the following types:
48 48
49 49 P_PID
50 50 The id parameter is a pid.
51 51
52 52
53 53 P_TASKID
54 54 The id parameter is a taskid.
55 55
56 56
57 57 P_PROJID
58 58 The id parameter is a project ID. All currently running
59 59 processes belonging to the given project will be bound to
60 60 the pool's resources.
61 61
62 62
63 63
64 64 The pool_get_resource_binding() function returns the name of the
65 65 resource of the supplied type to which the supplied process is bound.
66 66
67 67
68 - The application must explicity free the memory allocated for the return
69 - values for pool_get_binding() and pool_get_resource_binding().
68 + The application must explicitly free the memory allocated for the
69 + return values for pool_get_binding() and pool_get_resource_binding().
70 70
71 71 RETURN VALUES
72 72 Upon successful completion, pool_get_binding() returns the name of the
73 73 pool to which the process is bound. Otherwise it returns NULL and
74 74 pool_error(3POOL) returns the pool-specific error value.
75 75
76 76
77 77 Upon successful completion, pool_set_binding() returns PO_SUCCESS.
78 78 Otherwise, it returns PO_FAIL and pool_error() returns the pool-
79 79 specific error value.
80 80
81 81
82 82 Upon successful completion, pool_get_resource_binding() returns the
83 83 name of the resource of the specified type to which the process is
84 84 bound. Otherwise it returns NULL and pool_error() returns the pool-
85 85 specific error value.
86 86
87 87 ERRORS
88 88 The pool_get_binding() function will fail if:
89 89
90 90 POE_INVALID_CONF
91 91 The configuration is invalid.
92 92
93 93
94 94 POE_INVALID_SEARCH
95 95 It is not possible to determine the binding for
96 96 this target due to the overlapping nature of the
97 97 pools configured for this system, or the pool
98 98 could not be located.
99 99
100 100
101 101 POE_SYSTEM
102 102 A system error has occurred. Check the system
103 103 error code for more details.
104 104
105 105
106 106
107 107 The pool_set_binding() function will fail if:
108 108
109 109 POE_INVALID_SEARCH
110 110 The pool could not be found.
111 111
112 112
113 113 POE_INVALID_CONF
114 114 The configuration is invalid.
115 115
116 116
117 117 POE_SYSTEM
118 118 A system error has occurred. Check the system
119 119 error code for more details.
120 120
121 121
122 122
123 123 The pool_get_resource_binding() function will fail if:
124 124
125 125 POE_INVALID_CONF
126 126 The configuration is invalid.
127 127
128 128
129 129 POE_INVALID_SEARCH
130 130 The target is not bound to a resource of the
131 131 specified type.
132 132
133 133
134 134 POE_SYSTEM
135 135 A system error has occurred. Check the system
136 136 error code for more details.
137 137
138 138
139 139 EXAMPLES
140 140 Example 1 Bind the current process to the pool named "target".
141 141
142 142 #include <sys/types.h>
↓ open down ↓ |
63 lines elided |
↑ open up ↑ |
143 143 #include <pool.h>
144 144 #include <unistd.h>
145 145
146 146 ...
147 147
148 148 id_t pid = getpid();
149 149
150 150 ...
151 151
152 152 if (pool_set_binding("target", P_PID, pid) == PO_FAIL)
153 - (void) fprintf(stderr, "pool binding failed (\%d)\B{}n",
153 + (void) fprintf(stderr, "pool binding failed (%d)\n",
154 154 pool_error());
155 155
156 156
157 157
158 158 ATTRIBUTES
159 159 See attributes(5) for descriptions of the following attributes:
160 160
161 161
162 162
163 163
164 164 +--------------------+-----------------+
165 165 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
166 166 +--------------------+-----------------+
167 167 |CSI | Enabled |
168 168 +--------------------+-----------------+
↓ open down ↓ |
5 lines elided |
↑ open up ↑ |
169 169 |Interface Stability | Unstable |
170 170 +--------------------+-----------------+
171 171 |MT-Level | Safe |
172 172 +--------------------+-----------------+
173 173
174 174 SEE ALSO
175 175 libpool(3LIB), pool_error(3POOL), attributes(5)
176 176
177 177
178 178
179 - March 27, 2007 POOL_GET_BINDING(3POOL)
179 + January 18, 2020 POOL_GET_BINDING(3POOL)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX