Service Configuration Facility Library Functions
scfsnapshotcreate(3SCF)
NAME
scfsnapshotcreate, scfsnapshothandle,
scfsnapshotdestroy, scfsnapshotgetparent,
scfsnapshotgetname, scfsnapshotupdate,
scfinstancegetsnapshot - create and manipulate snapshot
handles and snapshots in the Service Configuration Facility
SYNOPSIS
cc [ flag... ] file... -lscf [ library... ]
#include
scfsnapshott *scfsnapshotcreate(scfhandlet *handle);
scfhandlet *scfsnapshothandle(scfsnapshott *snap);
void scfsnapshotdestroy(scfsnapshott *snap);
int scfsnapshotgetparent(const scfsnapshott *snap,
scfinstancet *inst);
ssizet scfsnapshotgetname(const scfsnapshott *snap,
char *buf, sizet size);
int scfsnapshotupdate(scfsnapshott *snap);
int scfinstancegetsnapshot(const scfinstancet *inst,
const char *name, scfsnapshott *snap);
DESCRIPTION
A snapshot is an unchanging picture of the full set of pro-
perty groups associated with an instance. Snapshots are
automatically created and managed by the Solaris Management
Facility. See smf(5).
A snapshot consists of a set of snaplevels, each of which
holds copies of the property groups associated with an
instance or service in the resolution path of the base
instance. Typically, there is one snaplevel for the instance
and one for the instance's parent service.
The scfsnapshotcreate() function allocates and initializes
a new scfsnapshott bound to handle. The
SunOS 5.11 Last change: 27 Aug 2007 1
Service Configuration Facility Library Functions
scfsnapshotcreate(3SCF)
scfsnapshotdestroy() function destroys and frees snap.
The scfsnapshothandle() function retrieves the handle to
which snap is bound.
The scfsnapshotgetparent() function sets inst to the
parent of the snapshot to which snap is set.
The scfsnapshotgetname() function retrieves the name of
the snapshot to which snap is set.
The scfsnapshotupdate() function reattaches snap to the
latest version of the snapshot to which snap is set.
The scfinstancegetsnapshot() function sets snap to the
snapshot specified by name in the instance specified by
inst. To walk all of the snapshots, see
scfiterinstancesnapshots(3SCF).
To access the snaplevels of a snapshot, see
scfsnapshotgetbasesnaplevel(3SCF).
RETURN VALUES
Upon successful completion, scfsnapshotcreate() returns a
new scfsnapshott. Otherwise, it returns NUL.
Upon successful completion, scfsnapshothandle() returns
the handle to which snap is bound. Otherwise, it returns
NUL.
Upon successful completion, scfsnapshotgetname() returns
the length of the string written, not including the ter-
minating null byte. Otherwise, it returns NUL.
The scfsnapshotupdate() function returns 1 if the snapshot
was updated, 0 if the snapshot had not been updated, and -1
on failure.
Upon successful completion, scfsnapshotgetparent() and
scfinstancegetsnapshot() return 0. Otherwise, they return
-1.
SunOS 5.11 Last change: 27 Aug 2007 2
Service Configuration Facility Library Functions
scfsnapshotcreate(3SCF)
ERORS
The scfsnapshotcreate() function will fail if:
SCFERORINVALIDARGUMENT
The handle argument is NUL.
SCFERORNOMEMORY
There is not enough memory to allocate an
scfsnapshott.
SCFERORNORESOURCES
The server does not have adequate resources for a new
instance handle.
The scfsnapshothandle() function will fail if:
SCFERORHANDLEDESTROYED
The handle associated with snap has been destroyed.
The scfsnapshotgetname() and scfsnapshotgetparent()
functions will fail if:
SCFERORDELETED
The snapshot has been deleted.
SCFERORNOTSET
The snapshot is not set.
SCFERORNOTBOUND
The handle is not bound.
SCFERORCONECTIONBROKEN
The connection to the repository was lost.
SunOS 5.11 Last change: 27 Aug 2007 3
Service Configuration Facility Library Functions
scfsnapshotcreate(3SCF)
The scfsnapshotupdate() function will fail if:
SCFERORCONECTIONBROKEN
The connection to the repository was lost.
SCFERORDELETED
An ancestor of the snapshot specified by snap has been
deleted.
SCFERORINTERNAL
An internal error occurred. This can happen if snap has
been corrupted.
SCFERORINVALIDARGUMENT
The snap argument refers to an invalid scfsnapshott.
SCFERORNOTBOUND
The handle is not bound.
SCFERORNOTSET
The snapshot specified by snap is not set.
The scfinstancegetsnapshot() function will fail if:
SCFERORBACKENDACES
The storage mechanism that the repository server
(svc.configd(1M)) chose for the operation denied access.
SCFERORCONECTIONBROKEN
The connection to the repository was lost.
SCFERORDELETED
The instance has been deleted.
SunOS 5.11 Last change: 27 Aug 2007 4
Service Configuration Facility Library Functions
scfsnapshotcreate(3SCF)
SCFERORHANDLEMISMATCH
The instance and snapshot are not derived from the same
handle.
SCFERORINTERNAL
An internal error occurred.
SCFERORINVALIDARGUMENT
The value of the name argument is not a valid snapshot
name.
SCFERORNORESOURCES
The server does not have the resources to complete the
request.
SCFERORNOTBOUND
The handle is not bound.
SCFERORNOTFOUND
The snapshot specified by name was not found.
SCFERORNOTSET
The instance is not set.
The scferror(3SCF) function can be used to retrieve the
error value.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 27 Aug 2007 5
Service Configuration Facility Library Functions
scfsnapshotcreate(3SCF)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level Safe
SEE ALSO
libscf(3LIB), scferror(3SCF),
scfiterinstancesnapshots(3SCF),
scfsnapshotgetbasesnaplevel(3SCF), attributes(5), smf(5)
SunOS 5.11 Last change: 27 Aug 2007 6
Service Configuration Facility Library Functions
scfsnapshotcreate(3SCF)
SunOS 5.11 Last change: 27 Aug 2007 7
|