1scf_scope_createS(e3rSvCiFc)e Configuration Facility Library Funscctfi_osncsope_create(3SCF)
2
3
4
6 scf_scope_create, scf_scope_handle, scf_scope_destroy,
7 scf_scope_get_name, scf_handle_get_scope - create and manipulate scope
8 handles in the Service Configuration Facility
9
11 cc [ flag... ] file... -lscf [ library... ]
12 #include <libscf.h>
13
14 scf_scope_t *scf_scope_create(scf_handle_t *handle);
15
16
17 scf_handle_t *scf_scope_handle(scf_scope_t *sc);
18
19
20 void scf_scope_destroy(scf_scope_t *sc);
21
22
23 ssize_t scf_scope_get_name(scf_scope_t *sc, char *buf, size_t size);
24
25
26 int scf_handle_get_scope(scf_handle_t *handle, const char *name,
27 scf_scope_t *out);
28
29
31 Scopes are the top level of the Service Configuration Facility's repos‐
32 itory tree. The children of a scope are services (see scf_service_cre‐
33 ate(3SCF)) and can be walked using scf_iter_scope_services(3SCF).
34
35
36 There is a distinguished scope with the name SCF_SCOPE_LOCAL that is
37 the root for all available services on the local machine. In the cur‐
38 rent implementation, there are no other scopes.
39
40
41 An scf_scope_t is an opaque handle that can be set to a single scope at
42 any given time. The scf_scope_create() function allocates a new
43 scf_scope_t bound to handle. The scf_scope_destroy() function destroys
44 and frees sc.
45
46
47 The scf_scope_handle() function retrieves the handle to which sc is
48 bound.
49
50
51 The scf_scope_get_name() function retrieves the name of the scope to
52 which sc is set.
53
54
55 The scf_handle_get_scope() function sets out to the scope specified by
56 name for the repository handle specified by handle. The scf_iter_han‐
57 dle_scopes(3SCF) and scf_iter_next_scope(3SCF) calls can be used to
58 iterate through all available scopes.
59
61 Upon successful completion, scf_scope_create() returns a new
62 scf_scope_t. Otherwise, it returns NULL.
63
64
65 Upon successful completion, scf_scope_handle() returns the handle to
66 which sc is bound. Otherwise, it returns NULL.
67
68
69 Upon successful completion, scf_scope_get_name() returns the length of
70 the string written, not including the terminating null byte. Other‐
71 wise, it returns -1.
72
73
74 Upon successful completion, scf_handle_get_scope() returns 0. Other‐
75 wise, it returns -1.
76
78 The scf_scope_create() function will fail if:
79
80 SCF_ERROR_INVALID_ARGUMENT The value of the handle argument is NULL.
81
82
83 SCF_ERROR_NO_MEMORY There is not enough memory to allocate an
84 scf_scope_t.
85
86
87 SCF_ERROR_NO_RESOURCES The server does not have adequate
88 resources for a new scope handle.
89
90
91
92 The scf_scope_handle() function will fail if:
93
94 SCF_ERROR_HANDLE_DESTROYED The handle associated with sc has been
95 destroyed.
96
97
98
99 The scf_scope_get_name() function will fail if:
100
101 SCF_ERROR_NOT_SET
102
103 The scope is not set.
104
105
106 SCF_ERROR_NOT_BOUND
107
108 The handle is not bound.
109
110
111 SCF_ERROR_CONNECTION_BROKEN
112
113 The connection to the repository was lost.
114
115
116
117 The scf_handle_get_scope() function will fail if:
118
119 SCF_ERROR_NOT_FOUND
120
121 No scope named name was found.
122
123
124 SCF_ERROR_INVALID_ARGUMENT
125
126 The name argument is not a valid scope name.
127
128
129 SCF_ERROR_NOT_BOUND
130
131 The handle is not bound.
132
133
134 SCF_ERROR_CONNECTION_BROKEN
135
136 The connection to the repository was lost.
137
138
139 SCF_ERROR_HANDLE_MISMATCH
140
141 The value of the out argument is not derived from handle.
142
143
144
145 The scf_error(3SCF) function can be used to retrieve the error value.
146
148 See attributes(5) for descriptions of the following attributes:
149
150
151
152
153 ┌─────────────────────────────┬─────────────────────────────┐
154 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
155 ├─────────────────────────────┼─────────────────────────────┤
156 │Interface Stability │Evolving │
157 ├─────────────────────────────┼─────────────────────────────┤
158 │MT-Level │Safe │
159 └─────────────────────────────┴─────────────────────────────┘
160
162 libscf(3LIB), scf_error(3SCF), scf_handle_decode_fmri(3SCF),
163 scf_iter_handle_scopes(3SCF), scf_iter_next_scope(3SCF),
164 scf_iter_scope_services(3SCF), scf_scope_to_fmri(3SCF), scf_ser‐
165 vice_create(3SCF), attributes(5)
166
167
168
169SunOS 5.11 9 Sep 2004 scf_scope_create(3SCF)