scf_service_create, scf_service_handle, scf_service_destroy, scf_service_get_parent, scf_service_get_name, scf_scope_get_service, scf_scope_add_service, scf_service_delete - create and manipulate service handles and services in the Service Configuration Facility
cc [ flag... ] file... -lscf [ library... ] #include <libscf.h> scf_service_t *scf_service_create(scf_handle_t *handle);
scf_handle_t *scf_service_handle(scf_service_t *svc);
void scf_service_destroy(scf_service_t *svc);
int scf_service_get_parent(scf_service_t *svc, scf_scope_t *sc);
ssize_t scf_service_get_name(const scf_service_t *svc, char *buf, size_t size);
int scf_scope_get_service(const scf_scope_t *sc, const char *name, scf_service_t *svc);
int scf_scope_add_service(const scf_scope_t *sc, const char *name, scf_service_t *svc);
int scf_service_delete(scf_service_t *svc);
Services form the middle layer of the Service Configuration Facility repository tree. Services are children of a scope (see scf_scope_create(3SCF)) and have three sets of children:
Property groups
Instances
A service groups one or more related instances and provides a shared configuration for them.
An scf_service_t is an opaque handle that can be set to a single service at any given time. The scf_service_create() function allocates and initializes a new scf_service_t bound to handle. The scf_service_destroy() function destroys and frees svc.
The scf_service_handle() function retrieves the handle to which svc is bound.
The scf_service_get_parent() function sets sc to the scope that is the parent of svc.
The scf_service_get_name() function retrieves the name of the service to which svc is set.
The scf_scope_get_service() function sets svc to the service specified by name in the scope specified by sc.
The scf_scope_add_service() function sets svc to a new service specified by name in the scope specified by sc.
The scf_service_delete() function deletes the service to which svc is set, as well as all of its children.
Upon successful completion, scf_service_create() returns a new scf_service_t. Otherwise, it returns NULL.
Upon successful completion, scf_service_handle() returns the handle to which svc is bound. Otherwise, it returns NULL.
Upon successful completion, scf_service_get_name() returns the length of the string written, not including the terminating null byte. Otherwise, it returns -1.
Upon successful completion, scf_service_get_parent(), scf_scope_get_service(), scf_scope_add_service(), and scf_service_delete() return 0. Otherwise, it returns -1.
The scf_service_create() function will fail if:
SCF_ERROR_INVALID_ARGUMENT
SCF_ERROR_NO_MEMORY
SCF_ERROR_NO_RESOURCES
The scf_service_handle() function will fail if:
SCF_ERROR_HANDLE_DESTROYED
The scf_service_get_name(), scf_service_get_parent(), and scf_service_delete() functions will fail if:
SCF_ERROR_DELETED
SCF_ERROR_NOT_SET
SCF_ERROR_NOT_BOUND
SCF_ERROR_CONNECTION_BROKEN
The scf_service_delete() function will fail if:
SCF_ERROR_EXISTS
SCF_ERROR_NO_RESOURCES
The scf_scope_add_service() function will fail if:
SCF_ERROR_EXISTS
The scf_scope_get_service() function will fail if:
SCF_ERROR_BACKEND_ACCESS
SCF_ERROR_INTERNAL
The scf_scope_add_service() and scf_scope_get_service() functions will fail if:
SCF_ERROR_CONNECTION_BROKEN
SCF_ERROR_DELETED
SCF_ERROR_HANDLE_MISMATCH
SCF_ERROR_INVALID_ARGUMENT
SCF_ERROR_NO_RESOURCES
SCF_ERROR_NOT_BOUND
SCF_ERROR_NOT_FOUND
SCF_ERROR_NOT_SET
The scf_scope_add_service() and scf_service_delete() functions will fail if:
SCF_ERROR_PERMISSION_DENIED
SCF_ERROR_BACKEND_READONLY
SCF_ERROR_BACKEND_ACCESS
The scf_error(3SCF) function can be used to retrieve the error value.
See attributes(5) for descriptions of the following attributes:
|
libscf(3LIB), scf_error(3SCF), scf_handle_decode_fmri(3SCF), scf_iter_service_pgs(3SCF), scf_iter_service_pgs_typed(3SCF), scf_instance_create(3SCF), scf_pg_create(3SCF), scf_scope_create(3SCF), scf_service_to_fmri(3SCF), attributes(5), smf(5)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |