scf_service_create(3scf) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

scf_service_create(3scf)

Service Configuration Facility Library Functions      scf_service_create(3SCF)



NAME
       scf_service_create,  scf_service_handle,  scf_service_destroy, scf_ser‐
       vice_get_parent,      scf_service_get_name,      scf_scope_get_service,
       scf_scope_add_service,  scf_service_delete - create and manipulate ser‐
       vice handles and services in the Service Configuration Facility

SYNOPSIS
       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);

DESCRIPTION
       Services form the middle layer of the  Service  Configuration  Facility
       repository  tree.  Services are children of a scope (see scf_scope_cre‐
       ate(3SCF)) and have three sets of children:

       Property groups

           These hold configuration information shared by all of the instances
           of    the    service.    See   scf_pg_create(3SCF),   scf_iter_ser‐
           vice_pgs(3SCF), and scf_iter_service_pgs_typed(3SCF).


       Instances

           A particular instantiation of the  service.  See  scf_instance_cre‐
           ate(3SCF).



       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  ser‐
       vice at any given time. The scf_service_create() function allocates and
       initializes  a  new  scf_service_t  bound  to  handle.   The   scf_ser‐
       vice_destroy  () function destroys and frees svc. The scf_error() func‐
       tion is not modified by this call.


       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  speci‐
       fied 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.

RETURN VALUES
       Upon successful completion, scf_service_create() returns a new scf_ser‐
       vice_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. Other‐
       wise, it returns -1.


       Upon       successful       completion,       scf_service_get_parent(),
       scf_scope_get_service(),    scf_scope_add_service(),    and    scf_ser‐
       vice_delete() return 0. Otherwise, it returns -1.

ERRORS
       The scf_service_create() function will fail if:

       SCF_ERROR_INVALID_ARGUMENT    The value of the handle argument is NULL.


       SCF_ERROR_NO_MEMORY           There is not enough memory to allocate an
                                     scf_service_t.


       SCF_ERROR_NO_RESOURCES        The   server   does   not  have  adequate
                                     resources for a new scope handle.



       The scf_service_handle() function will fail if:

       SCF_ERROR_HANDLE_DESTROYED

           The handle associated with svc has been destroyed.



       The  scf_service_get_name(),  scf_service_get_parent(),  and   scf_ser‐
       vice_delete() functions will fail if:

       SCF_ERROR_DELETED

           The service has been deleted by someone else.


       SCF_ERROR_NOT_SET

           The service is not set.


       SCF_ERROR_NOT_BOUND

           The handle is not bound.


       SCF_ERROR_CONNECTION_BROKEN

           The connection to the repository was lost.



       The scf_service_delete() function will fail if:

       SCF_ERROR_EXISTS

           The service contains instances.


       SCF_ERROR_NO_RESOURCES

           The server does not have adequate resources for a new scope handle.



       The scf_scope_add_service() function will fail if:

       SCF_ERROR_EXISTS

           A {service,instance,property group} named name already exists.



       The scf_scope_get_service() function will fail if:

       SCF_ERROR_BACKEND_ACCESS

           The  storage  mechanism that the repository server (svc.configd(8))
           chose for the operation denied access.


       SCF_ERROR_INTERNAL

           An internal error occurred.



       The scf_scope_add_service() and scf_scope_get_service() functions  will
       fail if:

       SCF_ERROR_CONNECTION_BROKEN

           The connection to the repository was lost.


       SCF_ERROR_DELETED

           The parent entity has been deleted.


       SCF_ERROR_HANDLE_MISMATCH

           The scope and service are not derived from the same handle.


       SCF_ERROR_INVALID_ARGUMENT

           The value of the name argument is not a valid service name.


       SCF_ERROR_NO_RESOURCES

           The server does not have the resources to complete the request.


       SCF_ERROR_NOT_BOUND

           The handle is not bound.


       SCF_ERROR_NOT_FOUND

           The service specified by name was not found.


       SCF_ERROR_NOT_SET

           The scope is not set.



       The  scf_scope_add_service()  and  scf_service_delete()  functions will
       fail if:

       SCF_ERROR_PERMISSION_DENIED

           The user does not have sufficient privileges to create or delete  a
           service.


       SCF_ERROR_BACKEND_READONLY

           The repository backend is read-only.


       SCF_ERROR_BACKEND_ACCESS

           The repository backend refused the modification.



       The scf_error(3SCF) function can be used to retrieve the error value.

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelSafe


SEE ALSO
       libscf(3LIB),    scf_pg_create(3SCF),     scf_error(3SCF),     scf_han‐
       dle_decode_fmri(3SCF),     scf_instance_create(3SCF),     scf_iter_ser‐
       vice_pgs(3SCF),    scf_iter_service_pgs_typed(3SCF),     scf_scope_cre‐
       ate(3SCF), scf_service_to_fmri(3SCF), attributes(7), smf(7)



Oracle Solaris 11.4               14 Aug 2017         scf_service_create(3SCF)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3