1scf_snapshot_creSaetrev(i3cSeCFC)onfiguration Facility LibrarysFcufn_cstniaopnsshot_create(3SCF)
2
3
4

NAME

6       scf_snapshot_create,     scf_snapshot_handle,     scf_snapshot_destroy,
7       scf_snapshot_get_parent,  scf_snapshot_get_name,   scf_snapshot_update,
8       scf_instance_get_snapshot  - create and manipulate snapshot handles and
9       snapshots in the Service Configuration Facility
10

SYNOPSIS

12       cc [ flag... ] file... -lscf [ library... ]
13       #include <libscf.h>
14
15       scf_snapshot_t *scf_snapshot_create(scf_handle_t *handle);
16
17
18       scf_handle_t *scf_snapshot_handle(scf_snapshot_t *snap);
19
20
21       void scf_snapshot_destroy(scf_snapshot_t *snap);
22
23
24       int scf_snapshot_get_parent(const scf_snapshot_t *snap,
25            scf_instance_t *inst);
26
27
28       ssize_t scf_snapshot_get_name(const scf_snapshot_t *snap,
29            char *buf, size_t size);
30
31
32       int scf_snapshot_update(scf_snapshot_t *snap);
33
34
35       int scf_instance_get_snapshot(const scf_instance_t *inst,
36            const char *name, scf_snapshot_t *snap);
37
38

DESCRIPTION

40       A snapshot is an unchanging picture of the full set of property  groups
41       associated  with  an  instance. Snapshots are automatically created and
42       managed by the Solaris Management Facility. See smf(5).
43
44
45       A snapshot consists of a set of snaplevels, each of which holds  copies
46       of  the  property  groups associated with an instance or service in the
47       resolution path of the base instance. Typically, there is one snaplevel
48       for the instance and one for the instance's parent service.
49
50
51       The  scf_snapshot_create()  function  allocates  and  initializes a new
52       scf_snapshot_t bound to  handle.  The  scf_snapshot_destroy()  function
53       destroys and frees snap.
54
55
56       The  scf_snapshot_handle()  function retrieves the handle to which snap
57       is bound.
58
59
60       The scf_snapshot_get_parent() function sets inst to the parent  of  the
61       snapshot to which snap is set.
62
63
64       The scf_snapshot_get_name() function retrieves the name of the snapshot
65       to which snap is set.
66
67
68       The scf_snapshot_update() function reattaches snap to the  latest  ver‐
69       sion of the snapshot to which snap is set.
70
71
72       The  scf_instance_get_snapshot()  function  sets  snap  to the snapshot
73       specified by name in the instance specified by inst. To walk all of the
74       snapshots, see scf_iter_instance_snapshots(3SCF).
75
76
77       To    access    the   snaplevels   of   a   snapshot,   see   scf_snap‐
78       shot_get_base_snaplevel(3SCF).
79

RETURN VALUES

81       Upon  successful  completion,  scf_snapshot_create()  returns   a   new
82       scf_snapshot_t. Otherwise, it returns NULL.
83
84
85       Upon successful completion, scf_snapshot_handle() returns the handle to
86       which snap is bound. Otherwise, it returns NULL.
87
88
89       Upon successful completion, scf_snapshot_get_name() returns the  length
90       of  the string written, not including the terminating null byte. Other‐
91       wise, it returns NULL.
92
93
94       The scf_snapshot_update()  function  returns  1  if  the  snapshot  was
95       updated, 0 if the snapshot had not been updated, and -1 on failure.
96
97
98       Upon     successful     completion,    scf_snapshot_get_parent()    and
99       scf_instance_get_snapshot() return 0. Otherwise, they return -1.
100

ERRORS

102       The scf_snapshot_create() function will fail if:
103
104       SCF_ERROR_INVALID_ARGUMENT
105
106           The handle argument is NULL.
107
108
109       SCF_ERROR_NO_MEMORY
110
111           There is not enough memory to allocate an scf_snapshot_t.
112
113
114       SCF_ERROR_NO_RESOURCES
115
116           The server does not have adequate resources for a new instance han‐
117           dle.
118
119
120
121       The scf_snapshot_handle() function will fail if:
122
123       SCF_ERROR_HANDLE_DESTROYED
124
125           The handle associated with snap has been destroyed.
126
127
128
129       The  scf_snapshot_get_name()  and  scf_snapshot_get_parent()  functions
130       will fail if:
131
132       SCF_ERROR_DELETED
133
134           The snapshot has been deleted.
135
136
137       SCF_ERROR_NOT_SET
138
139           The snapshot is not set.
140
141
142       SCF_ERROR_NOT_BOUND
143
144           The handle is not bound.
145
146
147       SCF_ERROR_CONNECTION_BROKEN
148
149           The connection to the repository was lost.
150
151
152
153       The scf_snapshot_update() function will fail if:
154
155       SCF_ERROR_CONNECTION_BROKEN
156
157           The connection to the repository was lost.
158
159
160       SCF_ERROR_DELETED
161
162           An ancestor of the snapshot specified by snap has been deleted.
163
164
165       SCF_ERROR_INTERNAL
166
167           An internal error occurred. This can happen if snap has  been  cor‐
168           rupted.
169
170
171       SCF_ERROR_INVALID_ARGUMENT
172
173           The snap argument refers to an invalid scf_snapshot_t.
174
175
176       SCF_ERROR_NOT_BOUND
177
178           The handle is not bound.
179
180
181       SCF_ERROR_NOT_SET
182
183           The snapshot specified by snap is not set.
184
185
186
187       The scf_instance_get_snapshot() function will fail if:
188
189       SCF_ERROR_BACKEND_ACCESS
190
191           The   storage   mechanism   that  the   repository server (svc.con‐
192           figd(1M)) chose for the operation denied access.
193
194
195       SCF_ERROR_CONNECTION_BROKEN
196
197           The connection to the repository was lost.
198
199
200       SCF_ERROR_DELETED
201
202           The instance has been deleted.
203
204
205       SCF_ERROR_HANDLE_MISMATCH
206
207           The instance and snapshot are not derived from the same handle.
208
209
210       SCF_ERROR_INTERNAL
211
212           An internal error occurred.
213
214
215       SCF_ERROR_INVALID_ARGUMENT
216
217           The value of the name argument is not a valid snapshot name.
218
219
220       SCF_ERROR_NO_RESOURCES
221
222           The server does not have the resources to complete the request.
223
224
225       SCF_ERROR_NOT_BOUND
226
227           The handle is not bound.
228
229
230       SCF_ERROR_NOT_FOUND
231
232           The snapshot specified by name was not found.
233
234
235       SCF_ERROR_NOT_SET
236
237           The instance is not set.
238
239
240
241       The scf_error(3SCF) function can be used to retrieve the error value.
242

ATTRIBUTES

244       See attributes(5) for descriptions of the following attributes:
245
246
247
248
249       ┌─────────────────────────────┬─────────────────────────────┐
250       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
251       ├─────────────────────────────┼─────────────────────────────┤
252       │Interface Stability          │Committed                    │
253       ├─────────────────────────────┼─────────────────────────────┤
254       │MT-Level                     │Safe                         │
255       └─────────────────────────────┴─────────────────────────────┘
256

SEE ALSO

258       libscf(3LIB),    scf_error(3SCF),    scf_iter_instance_snapshots(3SCF),
259       scf_snapshot_get_base_snaplevel(3SCF), attributes(5), smf(5)
260
261
262
263SunOS 5.11                        27 Aug 2007        scf_snapshot_create(3SCF)
Impressum