MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Service Configuration Facility Library Functions
                                         scfservicecreate(3SCF)



NAME
     scfservicecreate, scfservicehandle, scfservicedestroy,
     scfservicegetparent,                scfservicegetname,
     scfscopegetservice,                scfscopeaddservice,
     scfservicedelete  -  create and manipulate service handles
     and services in the Service Configuration Facility

SYNOPSIS
     cc [ flag... ] file... -lscf [ library... ]
     #include 

     scfservicet *scfservicecreate(scfhandlet *handle);


     scfhandlet *scfservicehandle(scfservicet *svc);


     void scfservicedestroy(scfservicet *svc);


     int scfservicegetparent(scfservicet *svc, scfscopet *sc);


     ssizet scfservicegetname(const scfservicet *svc, char *buf,
          sizet size);


     int scfscopegetservice(const scfscopet *sc, const char *name,
          scfservicet *svc);


     int scfscopeaddservice(const scfscopet *sc, const char *name,
          scfservicet *svc);


     int scfservicedelete(scfservicet *svc);


DESCRIPTION
     Services form the middle layer of the Service  Configuration
     Facility  repository  tree. Services are children of a scope
     (see scfscopecreate(3SCF)) and have three  sets  of  chil-
     dren:

     Property groups    These  hold   configuration   information
                        shared  by  all  of  the instances of the
                        service.     See     scfpgcreate(3SCF),
                        scfiterservicepgs(3SCF),           and
                        scfiterservicepgstyped(3SCF).





SunOS 5.11          Last change: 27 Aug 2007                    1






Service Configuration Facility Library Functions
                                         scfservicecreate(3SCF)



     Instances          A particular instantiation  of  the  ser-
                        vice. See scfinstancecreate(3SCF).



     A service groups one or more related instances and  provides
     a shared configuration for them.


     An scfservicet is an opaque handle that can be  set  to  a
     single  service  at any given time. The scfservicecreate()
     function allocates and initializes a new scfservicet bound
     to  handle.  The scfservicedestroy() function destroys and
     frees svc.


     The scfservicehandle() function retrieves  the  handle  to
     which svc is bound.


     The scfservicegetparent() function sets sc to  the  scope
     that is the parent of svc.


     The scfservicegetname() function retrieves  the  name  of
     the service to which svc is set.


     The scfscopegetservice() function sets svc to the service
     specified by name in the scope specified by sc.


     The scfscopeaddservice() function sets svc to a new  ser-
     vice specified by name in the scope specified by sc.


     The scfservicedelete() function  deletes  the  service  to
     which svc is set, as well as all of its children.

RETURN VALUES
     Upon successful completion, scfservicecreate()  returns  a
     new scfservicet. Otherwise, it returns NUL.


     Upon successful completion, scfservicehandle() returns the
     handle to which svc is bound. Otherwise, it returns NUL.


     Upon successful completion,  scfservicegetname()  returns
     the  length  of  the  string written, not including the ter-
     minating null byte. Otherwise, it returns -1.



SunOS 5.11          Last change: 27 Aug 2007                    2






Service Configuration Facility Library Functions
                                         scfservicecreate(3SCF)



     Upon   successful   completion,    scfservicegetparent(),
     scfscopegetservice(),     scfscopeaddservice(),    and
     scfservicedelete() return 0. Otherwise, it returns -1.

ERORS
     The scfservicecreate() function will fail if:

     SCFERORINVALIDARGUMENT    The value of the handle  argu-
                                   ment is NUL.


     SCFERORNOMEMORY           There is not enough memory  to
                                   allocate an scfservicet.


     SCFERORNORESOURCES        The server does not have  ade-
                                   quate   resources  for  a  new
                                   scope handle.



     The scfservicehandle() function will fail if:

     SCFERORHANDLEDESTROYED    The handle associated with svc
                                   has been destroyed.



     The  scfservicegetname(),  scfservicegetparent(),  and
     scfservicedelete() functions will fail if:

     SCFERORDELETED

         The service has been deleted by someone else.


     SCFERORNOTSET

         The service is not set.


     SCFERORNOTBOUND

         The handle is not bound.


     SCFERORCONECTIONBROKEN

         The connection to the repository was lost.





SunOS 5.11          Last change: 27 Aug 2007                    3






Service Configuration Facility Library Functions
                                         scfservicecreate(3SCF)



     The scfservicedelete() function will fail if:

     SCFEROREXISTS          The service contains instances.


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



     The scfscopeaddservice() function will fail if:

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



     The scfscopegetservice() function will fail if:

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


     SCFERORINTERNAL          An internal error occurred.



     The  scfscopeaddservice()   and   scfscopegetservice()
     functions will fail if:

     SCFERORCONECTIONBROKEN

         The connection to the repository was lost.


     SCFERORDELETED

         The parent entity has been deleted.


     SCFERORHANDLEMISMATCH

         The scope and service are not derived from the same han-
         dle.


     SCFERORINVALIDARGUMENT

         The value of the name argument is not  a  valid  service



SunOS 5.11          Last change: 27 Aug 2007                    4






Service Configuration Facility Library Functions
                                         scfservicecreate(3SCF)



         name.


     SCFERORNORESOURCES

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


     SCFERORNOTBOUND

         The handle is not bound.


     SCFERORNOTFOUND

         The service specified by name was not found.


     SCFERORNOTSET

         The scope is not set.



     The scfscopeaddservice() and  scfservicedelete()  func-
     tions will fail if:

     SCFERORPERMISIONDENIED

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


     SCFERORBACKENDREADONLY

         The repository backend is read-only.


     SCFERORBACKENDACES

         The repository backend refused the modification.



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

ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:



SunOS 5.11          Last change: 27 Aug 2007                    5






Service Configuration Facility Library Functions
                                         scfservicecreate(3SCF)



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Committed                   
    
     MT-Level                     Safe                        
    


SEE ALSO
     libscf(3LIB), scferror(3SCF), scfhandledecodefmri(3SCF),
     scfiterservicepgs(3SCF),
     scfiterservicepgstyped(3SCF), scfinstancecreate(3SCF),
     scfpgcreate(3SCF),                 scfscopecreate(3SCF),
     scfservicetofmri(3SCF), attributes(5), smf(5)







































SunOS 5.11          Last change: 27 Aug 2007                    6






Service Configuration Facility Library Functions
                                         scfservicecreate(3SCF)






















































SunOS 5.11          Last change: 27 Aug 2007                    7






OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™