1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
|
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
.\" 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. 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. 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]
.TH SCF_PG_CREATE 3SCF "Jun 29, 2009"
.SH NAME
scf_pg_create, scf_pg_handle, scf_pg_destroy, scf_pg_get_parent_service,
scf_pg_get_parent_instance, scf_pg_get_parent_snaplevel, scf_pg_get_name,
scf_pg_get_type, scf_pg_get_flags, scf_pg_update, scf_service_get_pg,
scf_service_add_pg, scf_instance_get_pg, scf_instance_get_pg_composed,
scf_instance_add_pg, scf_snaplevel_get_pg, scf_pg_delete,
scf_pg_get_underlying_pg \- create and manipulate property group handles and
property groups in the Service Configuration Facility
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lscf\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <libscf.h>
\fBscf_propertygroup_t *\fR\fBscf_pg_create\fR(\fBscf_handle_t *\fR\fIhandle\fR);
.fi
.LP
.nf
\fBscf_handle_t *\fR\fBscf_pg_handle\fR(\fBscf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBvoid\fR \fBscf_pg_destroy\fR(\fBscf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_pg_get_parent_service\fR(\fBconst scf_propertygroup_t *\fR\fIpg\fR,
\fBscf_service_t *\fR\fIsvc\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_pg_get_parent_instance\fR(\fBconst scf_propertygroup_t *\fR\fIpg\fR,
\fBscf_instance_t *\fR\fIinst\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_pg_get_parent_snaplevel\fR(\fBconst scf_propertygroup_t *\fR\fIpg\fR,
\fBscf_snaplevel_t *\fR\fIlevel\fR);
.fi
.LP
.nf
\fBssize_t\fR \fBscf_pg_get_name\fR(\fBconst scf_propertygroup_t *\fR\fIpg\fR, \fBchar *\fR\fIbuf\fR,
\fBsize_t\fR \fIsize\fR);
.fi
.LP
.nf
\fBssize_t\fR \fBscf_pg_get_type\fR(\fBconst scf_propertygroup_t *\fR\fIpg\fR, \fBchar *\fR\fIbuf\fR,
\fBsize_t\fR \fIsize\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_pg_get_flags\fR(\fBconst scf_propertygroup_t *\fR\fIpg\fR, \fBuint32_t *\fR\fIout\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_pg_update\fR(\fBconst scf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_service_get_pg\fR(\fBconst scf_service_t *\fR\fIsvc\fR, \fBconst char *\fR\fIname\fR,
\fBscf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_service_add_pg\fR(\fBconst scf_service_t *\fR\fIsvc\fR,
\fBconst char *\fR\fIname\fR, \fBconst char *\fR\fIgroup_type\fR,
\fBuint32_t\fR \fIflags\fR, \fBscf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_instance_get_pg\fR(\fBconst scf_instance_t *\fR\fIinst\fR,
\fBconst char *\fR\fIname\fR, \fBscf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_instance_get_pg_composed\fR(\fBconst scf_instance_t *\fR\fIinst\fR,
\fBconst scf_snapshot_t *\fR\fIsnapshot\fR, \fBconst char *\fR\fIname\fR,
\fBscf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_instance_add_pg\fR(\fBconst scf_instance_t *\fR\fIinst\fR,
\fBconst char *\fR\fIname\fR, \fBconst char *\fR\fIgroup_type\fR, \fBuint32_t\fR \fIflags\fR,
\fBscf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_snaplevel_get_pg\fR(\fBconst scf_snaplevel_t *\fR\fIlevel\fR,
\fBconst char *\fR\fIname\fR, \fBscf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_pg_delete\fR(\fBscf_propertygroup_t *\fR\fIpg\fR);
.fi
.LP
.nf
\fBint\fR \fBscf_pg_get_underlying_pg\fR(\fBconst scf_propertygroup_t *\fR\fIpg\fR,
\fBscf_propertygroup_t *\fR\fIout\fR);
.fi
.SH DESCRIPTION
.sp
.LP
Property groups are an atomically-updated group of typed properties. Property
groups of services (see \fBscf_service_create\fR(3SCF)) or instances (see
\fBscf_instance_create\fR(3SCF)) are modifiable. Property groups of snaplevels
(see \fBscf_snaplevel_create\fR(3SCF)) are not modifiable.
.sp
.LP
An \fBscf_propertygroup_t\fR is an opaque handle that can be set to a single
property group at any given time. When an \fBscf_propertygroup_t\fR is set, it
references a frozen-in-time version of the property group to which it is set.
Updates to the property group will not be visible until either
\fBscf_pg_update()\fR is called or the property group is set again.
.sp
.LP
This static view is propagated to the \fBscf_property_t\fRs set to children of
the property group. They will not see updates, even if the
\fBscf_propertygroup_t\fR is updated.
.sp
.LP
The \fBscf_pg_create()\fR function allocates and initializes a new
\fBscf_propertygroup_t\fR bound to \fIhandle\fR. The \fBscf_pg_destroy()\fR
function destroys and frees \fIpg\fR.
.sp
.LP
The \fBscf_pg_handle()\fR function retrieves the handle to which \fIpg\fR is
bound.
.sp
.LP
The \fBscf_pg_get_parent_service()\fR, \fBscf_pg_get_parent_instance()\fR, and
\fBscf_pg_get_parent_snaplevel()\fR functions retrieve the property group's
parent, if it is of the requested type.
.sp
.LP
The \fBscf_pg_get_name()\fR and \fBscf_pg_get_type()\fR functions retrieve the
name and type, respectively, of the property group to which \fIpg\fR is set.
.sp
.LP
The \fBscf_pg_get_flags()\fR function retrieves the flags for the property
group to which \fIpg\fR is set. If \fBSCF_PG_FLAG_NONPERSISTENT\fR is set, the
property group is not included in snapshots and will lose its contents upon
system shutdown or reboot. Non-persistent property groups are mainly used for
smf-internal state. See \fBsmf\fR(7).
.sp
.LP
The \fBscf_pg_update()\fR function ensures that \fIpg\fR is attached to the
most recent version of the \fIpg\fR to which it is set.
.sp
.LP
The \fBscf_service_get_pg()\fR, \fBscf_instance_get_pg()\fR, and
\fBscf_snaplevel_get_pg()\fR functions set \fIpg\fR to the property group
specified by \fIname\fR in the service specified by \fIsvc\fR, the instance
specified by \fIinst\fR, or the snaplevel specified by \fIlevel\fR,
respectively.
.sp
.LP
The \fBscf_instance_get_pg_composed()\fR function sets \fIpg\fR to the property
group specified by \fIname\fR in the composed view of \fIinst\fR at the time
\fIsnapshot\fR was taken. If \fIsnapshot\fR is \fINULL\fR, the current
properties are used. The composed view of an instance's properties is the union
of the properties of the instance and its ancestors. Properties of the instance
take precedence over properties of the service with the same name (including
the property group name). After a successful call to
\fBscf_instance_get_pg_composed()\fR, the parent of \fIpg\fR might not be
\fIinst\fR, and the parents of properties obtained from \fIpg\fR might not be
\fIpg\fR. If \fIinst\fR and its parent have property groups with the same name
but different types, the properties in the property group of the parent are
excluded.
.sp
.LP
The \fBscf_service_add_pg()\fR and \fBscf_instance_add_pg()\fR functions create
a new property group specified by \fIname\fR whose type is \fIgroup_type\fR,
and attach the \fIpg\fR handle (if non-null) to the new object. The \fIflags\fR
argument must be either 0 or \fBSCF_PG_FLAG_NONPERSISTENT\fR.
.sp
.LP
The \fBscf_pg_delete()\fR function deletes the property group. Versions of the
property group in snapshots are not affected.
.sp
.LP
The \fBscf_pg_get_underlying_pg()\fR function gets the first existing
underlying property group. If the property group specified by \fIpg\fR is an
instance property group, \fIout\fR is set to the property group of the same
name in the instance's parent.
.sp
.LP
Applications can use a transaction to modify a property group. See
\fBscf_transaction_create\fR(3SCF).
.SH RETURN VALUES
.sp
.LP
Upon successful completion, \fBscf_pg_create()\fR returns a new
\fBscf_propertygroup_t\fR. Otherwise, it returns \fINULL\fR.
.sp
.LP
Upon successful completion, \fBscf_pg_handle()\fR returns a pointer to the
handle to which \fIpg\fR is bound. Otherwise, it returns NULL.
.sp
.LP
Upon successful completion, \fBscf_instance_handle()\fR returns the handle
instance with which it is associated. Otherwise, it returns \fINULL\fR.
.sp
.LP
Upon successful completion, \fBscf_pg_get_name()\fR and \fBscf_pg_get_type()\fR
return the length of the string written, not including the terminating null
byte. Otherwise, they return -1.
.sp
.LP
The \fBscf_pg_update()\fR function returns 1 if the object was updated, 0 if
the object was already up to date, and -1 on failure.
.sp
.LP
Upon successful completion, \fBscf_pg_get_parent_service()\fR,
\fBscf_pg_get_parent_snaplevel()\fR, \fBscf_pg_get_flags()\fR,
\fBscf_service_get_pg()\fR, \fBscf_service_add_pg()\fR,
\fBscf_pg_get_parent_instance()\fR, \fBscf_instance_get_pg()\fR,
\fBscf_instance_get_pg_composed()\fR, \fBscf_instance_add_pg()\fR,
\fBscf_snaplevel_get_pg()\fR, \fBscf_pg_delete()\fR, and
\fBscf_pg_get_underlying_pg()\fR return 0. Otherwise, they return -1.
.SH ERRORS
.sp
.LP
The \fBscf_pg_create()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
.ad
.sp .6
.RS 4n
The \fIhandle\fR argument is \fINULL\fR.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NO_MEMORY\fR\fR
.ad
.sp .6
.RS 4n
There is not enough memory to allocate an \fBscf_propertygroup_t\fR.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NO_RESOURCES\fR\fR
.ad
.sp .6
.RS 4n
The server does not have adequate resources for a new property group handle.
.RE
.sp
.LP
The \fBscf_pg_handle()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_HANDLE_DESTROYED\fR\fR
.ad
.sp .6
.RS 4n
The handle associated with \fIpg\fR has been destroyed.
.RE
.sp
.LP
The \fBscf_pg_update()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
.ad
.sp .6
.RS 4n
The connection to the repository was lost.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_DELETED\fR\fR
.ad
.sp .6
.RS 4n
An ancestor of the property group specified by \fIpg\fR has been deleted.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_INTERNAL\fR\fR
.ad
.sp .6
.RS 4n
An internal error occurred. This can happen if \fIpg\fR has been corrupted.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
.ad
.sp .6
.RS 4n
The \fIpg\fR argument refers to an invalid \fBscf_propertygroup_t\fR.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_BOUND\fR\fR
.ad
.sp .6
.RS 4n
The handle is not bound.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_SET\fR\fR
.ad
.sp .6
.RS 4n
The property group specified by \fIpg\fR is not set.
.RE
.sp
.LP
The \fBscf_service_get_pg()\fR, \fBscf_instance_get_pg()\fR,
\fBscf_instance_get_pg_composed()\fR, \fBscf_snaplevel_get_pg()\fR, and
\fBscf_pg_get_underlying_pg()\fR functions will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_BACKEND_ACCESS\fR\fR
.ad
.sp .6
.RS 4n
The storage mechanism that the repository server (\fBsvc.configd\fR(8))
chose for the operation denied access.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_INTERNAL\fR\fR
.ad
.sp .6
.RS 4n
An internal error occurred.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NO_RESOURCES\fR\fR
.ad
.sp .6
.RS 4n
The server does not have the resources to complete the request.
.RE
.sp
.LP
The \fBscf_pg_get_name()\fR, \fBscf_pg_get_type()\fR, \fBscf_pg_get_flags()\fR,
\fBscf_pg_get_parent_service()\fR, \fBscf_pg_get_parent_snaplevel()\fR, and
\fBscf_pg_get_parent_instance()\fR functions will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_DELETED\fR\fR
.ad
.sp .6
.RS 4n
The property group specified by \fIpg\fR has been deleted.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_SET\fR\fR
.ad
.sp .6
.RS 4n
The property group specified by \fIpg\fR is not set.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_BOUND\fR\fR
.ad
.sp .6
.RS 4n
The handle is not bound.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
.ad
.sp .6
.RS 4n
The connection to the repository was lost.
.RE
.sp
.LP
The \fBscf_pg_get_parent_service()\fR, \fBscf_pg_get_parent_snaplevel()\fR, and
\fBscf_pg_get_parent_instance()\fR functions will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_CONSTRAINT_VIOLATED\fR\fR
.ad
.sp .6
.RS 4n
The requested parent type does not match the actual type of the parent of the
property group specified by \fIpg\fR.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_HANDLE_MISMATCH\fR\fR
.ad
.sp .6
.RS 4n
The property group and either the instance, the service, or the snaplevel are
not derived from the same handle.
.RE
.sp
.LP
The \fBscf_instance_get_pg()\fR, \fBscf_instance_get_pg_composed()\fR,
\fBscf_service_get_pg()\fR, \fBscf_pg_get_underlying_pg()\fR, and
\fBscf_snaplevel_get_pg()\fR functions will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_FOUND\fR\fR
.ad
.sp .6
.RS 4n
The property group specified by \fIname\fR was not found.
.RE
.sp
.LP
The \fBscf_service_add_pg()\fR, \fBscf_service_get_pg()\fR,
\fBscf_instance_add_pg()\fR, \fBscf_instance_get_pg()\fR,
\fBscf_instance_get_pg_composed()\fR, and \fBscf_snaplevel_get_pg()\fR
functions will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_DELETED\fR\fR
.ad
.sp .6
.RS 4n
The service or instance has been deleted.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_SET\fR\fR
.ad
.sp .6
.RS 4n
The instance is not set.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
.ad
.sp .6
.RS 4n
The value of the \fIname\fR argument is not a valid property group name.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_HANDLE_MISMATCH\fR\fR
.ad
.sp .6
.RS 4n
The property group and either the instance, the service, or the level are not
derived from the same handle.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_BOUND\fR\fR
.ad
.sp .6
.RS 4n
The handle is not bound.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
.ad
.sp .6
.RS 4n
The connection to the repository was lost.
.RE
.sp
.LP
The \fBscf_service_add_pg()\fR and \fBscf_instance_add_pg()\fR functions will
fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_PERMISSION_DENIED\fR\fR
.ad
.sp .6
.RS 4n
The caller does not have permission to create the requested property group.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_BACKEND_READONLY\fR\fR
.ad
.sp .6
.RS 4n
The repository backend is read-only.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_BACKEND_ACCESS\fR\fR
.ad
.sp .6
.RS 4n
The repository backend refused the modification.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_EXISTS\fR\fR
.ad
.sp .6
.RS 4n
A {service,instance,property group} named \fIname\fR already exists.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NO_RESOURCES\fR\fR
.ad
.sp .6
.RS 4n
The server does not have the resources to complete the request.
.RE
.sp
.LP
The \fBscf_pg_delete()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_BACKEND_ACCESS\fR\fR
.ad
.sp .6
.RS 4n
The repository backend refused the modification.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_BACKEND_READONLY\fR\fR
.ad
.sp .6
.RS 4n
The repository backend is read-only.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
.ad
.sp .6
.RS 4n
The connection to the repository was lost.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_DELETED\fR\fR
.ad
.sp .6
.RS 4n
The property group has been deleted by someone else.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NO_RESOURCES\fR\fR
.ad
.sp .6
.RS 4n
The server does not have adequate resources for a new property group handle.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_SET\fR\fR
.ad
.sp .6
.RS 4n
The property group has not been set.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_PERMISSION_DENIED\fR\fR
.ad
.sp .6
.RS 4n
The caller does not have permission to delete this property group.
.RE
.sp
.LP
The \fBscf_pg_get_underlying_pg()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
.ad
.sp .6
.RS 4n
The connection to the repository was lost.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_CONSTRAINT_VIOLATED\fR\fR
.ad
.sp .6
.RS 4n
A required constraint was not met.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_DELETED\fR\fR
.ad
.sp .6
.RS 4n
The property group has been deleted.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_HANDLE_MISMATCH\fR\fR
.ad
.sp .6
.RS 4n
The property group and \fIout\fR are not derived from the same handle.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
.ad
.sp .6
.RS 4n
An argument is invalid.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_BOUND\fR\fR
.ad
.sp .6
.RS 4n
The handle is not bound.
.RE
.sp
.ne 2
.na
\fB\fBSCF_ERROR_NOT_SET\fR\fR
.ad
.sp .6
.RS 4n
The property group has not been set.
.RE
.sp
.LP
The \fBscf_error\fR(3SCF) function can be used to retrieve the error value.
.SH EXAMPLES
.LP
\fBExample 1 \fRPerform a layered lookup of \fIname\fR in \fIpg\fR.
.sp
.in +2
.nf
int layered_lookup(scf_propertygroup_t *pg, const char *name,
scf_property_t *out) {
scf_handle_t *handle = scf_pg_handle(out);
scf_propertygroup_t *new_pg;
scf_propertygroup_t *cur, *other;
int state = 0;
if (handle == NULL) {
return (-1);
}
new_pg = scf_pg_create(handle);
if (new_pg == NULL) {
return (-1);
}
for (;;) {
cur = state ? pg : new_pg;
other = state ? new_pg : pg;
state = !state;
if (scf_pg_get_property(cur, name, out) != -1) {
scf_pg_destroy(new_pg);
return (SUCCESS);
}
if (scf_pg_get_underlying_pg(cur, other) == -1)
break;
}
scf_pg_destroy(new_pg);
return (NOT_FOUND);
}
.fi
.in -2
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Committed
_
MT-Level Safe
.TE
.SH SEE ALSO
.sp
.LP
.BR libscf (3LIB),
.BR scf_error (3SCF),
.BR scf_handle_decode_fmri (3SCF),
.BR scf_instance_create (3SCF),
.BR scf_pg_to_fmri (3SCF),
.BR scf_service_create (3SCF),
.BR scf_snaplevel_create (3SCF),
.BR scf_transaction_create (3SCF),
.BR attributes (7),
.BR smf (7)
|