2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
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 .\" 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 .\" 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 SCF_HANDLE_CREATE 3SCF "Aug 17, 2007"
8 scf_handle_create, scf_handle_destroy, scf_handle_decorate, scf_handle_bind,
9 scf_handle_unbind, scf_myname \- Service Configuration Facility handle
14 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lscf\fR [ \fIlibrary\fR\&.\|.\|. ]
17 \fBscf_handle_t *\fR\fBscf_handle_create\fR(\fBscf_version_t\fR \fIversion\fR);
22 \fBvoid\fR \fBscf_handle_destroy\fR(\fBscf_handle_t *\fR\fIhandle\fR);
27 \fBint\fR \fBscf_handle_decorate\fR(\fBscf_handle_t *\fR\fIhandle\fR, \fBconst char *\fR\fIparam\fR,
28 \fBscf_value_t *\fR\fIvalue\fR);
33 \fBint\fR \fBscf_handle_bind\fR(\fBscf_handle_t *\fR\fIhandle\fR);
38 \fBint\fR \fBscf_handle_unbind\fR(\fBscf_handle_t *\fR\fIhandle\fR);
43 \fBssize_t\fR \fBscf_myname\fR(\fBscf_handle_t *\fR\fIhandle\fR, \fBchar *\fR\fIout\fR, \fBsize_t\fR \fIsz\fR);
49 The \fBscf_handle_create()\fR function creates a new Service Configuration
50 Facility handle that is used as the base for all communication with the
51 configuration repository. The version argument must be \fBSCF_VERSION\fR.
54 The \fBscf_handle_decorate()\fR function sets a single connection-level
55 parameter, \fIparam\fR, to the supplied value. If \fIvalue\fR is
56 \fBSCF_DECORATE_CLEAR\fR, \fIparam\fR is reset to its default state. Values
57 passed to \fBscf_handle_decorate()\fR can be reset, reused, or destroyed. The
58 values set do not take effect until \fBscf_handle_bind()\fR is called. Any
59 invalid values will not cause errors prior to the call to
60 \fBscf_handle_bind()\fR. The only available decorations is:
67 (count) Set the debugging flags.
72 The \fBscf_handle_bind()\fR function binds the handle to a running
73 \fBsvc.configd\fR(1M) daemon, using the current decorations to modify the
74 connection. All states derived from the handle are reset immediately after a
78 The \fBscf_handle_unbind()\fR function severs an existing repository connection
79 or clears the in-client state for a broken connection.
82 The \fBscf_handle_destroy()\fR function destroys and frees an SCF handle. It is
83 illegal to use the handle after calling \fBscf_handle_destroy()\fR. Actions on
84 subordinate objects act as if the handle is unbound.
87 The \fBscf_myname()\fR function retrieves the FMRI for the service of which the
88 connecting process is a part. If the full FMRI does not fit in the provided
89 buffer, it is truncated and, if \fIsz\fR > 0, zero-terminated.
93 Upon successful completion, \fBscf_handle_create()\fR returns the new handle.
94 Otherwise, it returns \fINULL\fR.
97 Upon successful completion, \fBscf_handle_decorate()\fR,
98 \fBscf_handle_bind()\fR, and \fBscf_handle_unbind()\fR return 0. Otherwise,
102 The \fBscf_myname()\fR function returns the length of the full FMRI. Otherwise,
107 The \fBscf_handle_create()\fR function will fail if:
111 \fB\fBSCF_ERROR_NO_MEMORY\fR\fR
114 There is no memory available.
120 \fB\fBSCF_ERROR_VERSION_MISMATCH\fR\fR
123 The version is invalid, or the application was compiled against a version of
124 the library that is more recent than the one on the system.
129 The \fBscf_handle_decorate()\fR function will fail if:
133 \fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
136 The \fIparam\fR argument is not a recognized parameter.
142 \fB\fBSCF_ERROR_TYPE_MISMATCH\fR\fR
145 The \fIvalue\fR argument does not match the expected type for param.
151 \fB\fBSCF_ERROR_NOT_SET\fR\fR
154 The \fIvalue\fR argument is not set.
160 \fB\fBSCF_ERROR_IN_USE\fR\fR
163 The handle is currently bound.
169 \fB\fBSCF_ERROR_HANDLE_MISMATCH\fR\fR
172 The \fIvalue\fR argument is not derived from \fIhandle\fR.
177 The \fBscf_handle_bind()\fR function will fail if:
181 \fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
184 One of the decorations was invalid.
190 \fB\fBSCF_ERROR_NO_SERVER\fR\fR
193 The repository server is not running.
199 \fB\fBSCF_ERROR_NO_RESOURCES\fR\fR
202 The server does not have adequate resources for a new connection.
208 \fB\fBSCF_ERROR_IN_USE\fR\fR
211 The handle is already bound.
216 The \fBscf_handle_unbind()\fR function will fail if:
220 \fB\fBSCF_ERROR_NOT_BOUND\fR\fR
223 The handle is not bound.
228 The \fBscf_handle_myname()\fR function will fail if:
232 \fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
236 The connection to the repository was lost.
242 \fB\fBSCF_ERROR_NOT_BOUND\fR\fR
246 The handle is not bound.
252 \fB\fBSCF_ERROR_NOT_SET\fR\fR
256 This process is not marked as a SMF service.
261 The \fBscf_error\fR(3SCF) function can be used to retrieve the error value.
265 See \fBattributes\fR(5) for descriptions of the following attributes:
273 ATTRIBUTE TYPE ATTRIBUTE VALUE
275 Interface Stability Committed
282 Operations on a single handle (and the objects associated with it) are Safe.
283 Operations on different handles are MT-Safe. Objects associated with different
284 handles cannot be mixed, as this will lead to an
285 \fBSCF_ERROR_HANDLE_MISMATCH\fR error.
289 \fBlibscf\fR(3LIB), \fBscf_error\fR(3SCF), \fBattributes\fR(5)