Service Configuration Facility Library Functions
scfhandlecreate(3SCF)
NAME
scfhandlecreate, scfhandledestroy, scfhandledecorate,
scfhandlebind, scfhandleunbind, scfmyname - Service
Configuration Facility handle functions
SYNOPSIS
cc [ flag... ] file... -lscf [ library... ]
#include
scfhandlet *scfhandlecreate(scfversiont version);
void scfhandledestroy(scfhandlet *handle);
int scfhandledecorate(scfhandlet *handle, const char *param,
scfvaluet *value);
int scfhandlebind(scfhandlet *handle);
int scfhandleunbind(scfhandlet *handle);
ssizet scfmyname(scfhandlet *handle, char *out, sizet sz);
DESCRIPTION
The scfhandlecreate() function creates a new Service Con-
figuration Facility handle that is used as the base for all
communication with the configuration repository. The version
argument must be SCFVERSION.
The scfhandledecorate() function sets a single
connection-level parameter, param, to the supplied value. If
value is SCFDECORATECLEAR, param is reset to its default
state. Values passed to scfhandledecorate() can be reset,
reused, or destroyed. The values set do not take effect
until scfhandlebind() is called. Any invalid values will
not cause errors prior to the call to scfhandlebind(). The
only available decorations is:
debug (count) Set the debugging flags.
The scfhandlebind() function binds the handle to a running
svc.configd(1M) daemon, using the current decorations to
modify the connection. All states derived from the handle
SunOS 5.11 Last change: 17 Aug 2007 1
Service Configuration Facility Library Functions
scfhandlecreate(3SCF)
are reset immediately after a successful binding.
The scfhandleunbind() function severs an existing reposi-
tory connection or clears the in-client state for a broken
connection.
The scfhandledestroy() function destroys and frees an SCF
handle. It is illegal to use the handle after calling
scfhandledestroy(). Actions on subordinate objects act as
if the handle is unbound.
The scfmyname() function retrieves the FMRI for the service
of which the connecting process is a part. If the full FMRI
does not fit in the provided buffer, it is truncated and, if
sz > 0, zero-terminated.
RETURN VALUES
Upon successful completion, scfhandlecreate() returns the
new handle. Otherwise, it returns NUL.
Upon successful completion, scfhandledecorate(),
scfhandlebind(), and scfhandleunbind() return 0. Other-
wise, they return -1.
The scfmyname() function returns the length of the full
FMRI. Otherwise, it returns -1.
ERORS
The scfhandlecreate() function will fail if:
SCFERORNOMEMORY There is no memory available.
SCFERORVERSIONMISMATCH The version is invalid, or the
application was compiled
against a version of the
library that is more recent
than the one on the system.
The scfhandledecorate() function will fail if:
SCFERORINVALIDARGUMENT The param argument is not a
recognized parameter.
SunOS 5.11 Last change: 17 Aug 2007 2
Service Configuration Facility Library Functions
scfhandlecreate(3SCF)
SCFERORTYPEMISMATCH The value argument does not
match the expected type for
param.
SCFERORNOTSET The value argument is not set.
SCFERORINUSE The handle is currently bound.
SCFERORHANDLEMISMATCH The value argument is not
derived from handle.
The scfhandlebind() function will fail if:
SCFERORINVALIDARGUMENT One of the decorations was
invalid.
SCFERORNOSERVER The repository server is not
running.
SCFERORNORESOURCES The server does not have ade-
quate resources for a new con-
nection.
SCFERORINUSE The handle is already bound.
The scfhandleunbind() function will fail if:
SCFERORNOTBOUND The handle is not bound.
The scfhandlemyname() function will fail if:
SCFERORCONECTIONBROKEN
The connection to the repository was lost.
SCFERORNOTBOUND
The handle is not bound.
SunOS 5.11 Last change: 17 Aug 2007 3
Service Configuration Facility Library Functions
scfhandlecreate(3SCF)
SCFERORNOTSET
This process is not marked as a SMF service.
The scferror(3SCF) function can be used to retrieve the
error value.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level See below.
Operations on a single handle (and the objects associated
with it) are Safe. Operations on different handles are MT-
Safe. Objects associated with different handles cannot be
mixed, as this will lead to an SCFERORHANDLEMISMATCH
error.
SEE ALSO
libscf(3LIB), scferror(3SCF), attributes(5)
SunOS 5.11 Last change: 17 Aug 2007 4
Service Configuration Facility Library Functions
scfhandlecreate(3SCF)
SunOS 5.11 Last change: 17 Aug 2007 5
|