MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Service Configuration Facility Library Functions
                                        scfinstancecreate(3SCF)



NAME
     scfinstancecreate,                    scfinstancehandle,
     scfinstancedestroy,               scfinstancegetparent,
     scfinstancegetname,             scfservicegetinstance,
     scfserviceaddinstance,  scfinstancedelete  - create and
     manipulate instance handles and  instances  in  the  Service
     Configuration Facility

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

     scfinstancet *scfinstancecreate(scfhandlet *handle);


     scfhandlet *scfinstancehandle(scfinstancet *inst);


     void scfinstancedestroy(scfinstancet *inst);


     int scfinstancegetparent(const scfinstancet *inst,
          scfservicet *svc);


     ssizet scfinstancegetname(const scfinstancet *inst,
          char *name, sizet size);


     int scfservicegetinstance(const scfservicet *svc,
          const char *name, scfinstancet *inst);


     int scfserviceaddinstance(const scfservicet *svc,
          const char *name, scfinstancet *inst);


     int scfinstancedelete(scfinstancet *inst);


DESCRIPTION
     Instances form the bottom layer of the Service Configuration
     Facility repository tree. An instance is the child of a ser-
     vice and has two sets of children:

     Property Groups    These  hold   configuration   information
                        specific    to    this    instance.   See
                        scfpgcreate(3SCF),
                        scfiterinstancepgs(3SCF),          and
                        scfiterinstancepgstyped(3SCF).




SunOS 5.11          Last change: 24 Sep 2007                    1






Service Configuration Facility Library Functions
                                        scfinstancecreate(3SCF)



     Snapshots          These    are    complete    configuration
                        snapshots  that hold unchanging copies of
                        all of the property groups  necessary  to
                        run        the        instance.       See
                        scfsnapshotcreate(3SCF)             and
                        scfiterinstancesnapshots(3SCF).



     See smf(5) for information about instances.


     An scfinstancet is an opaque handle that can be set  to  a
     single instance at any given time. The scfinstancecreate()
     function allocates  and  initializes  a  new  scfinstancet
     bound  to  handle.  The scfinstancedestroy() function des-
     troys and frees inst.


     The scfinstancehandle() function retrieves the  handle  to
     which inst is bound.


     The scfinstgetparent() function sets svc to  the  service
     that is the parent of inst.


     The scfinstancegetname() function retrieves the  name  of
     the instance to which inst is set.


     The scfservicegetinstance() function  sets  inst  to  the
     child instance of the service svc specified by name.


     The scfserviceaddinstance() function sets inst to  a  new
     child instance of the service svc specified by name.


     The scfinstancedelete() function deletes the  instance  to
     which  inst  is  set,  as  well  all  of the children of the
     instance.

RETURN VALUES
     Upon successful completion, scfinstancecreate() returns  a
     new scfinstancet. Otherwise it returns NUL.


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



SunOS 5.11          Last change: 24 Sep 2007                    2






Service Configuration Facility Library Functions
                                        scfinstancecreate(3SCF)



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


     Upon   successful   completion,   scfinstancegetparent(),
     scfservicegetinstance(),  scfserviceaddinstance(), and
     scfinstancedelete() functions return  0.  Otherwise,  they
     return -1.

ERORS
     The scfinstancecreate() function will fail if:

     SCFERORHANDLEDESTROYED

         An object was bound to a destroyed handle.


     SCFERORINTERNAL

         An internal error occurred.


     SCFERORINVALIDARGUMENT

         The handle argument is NUL.


     SCFERORNOMEMORY

         There   is   not   enough   memory   to   allocate    an
         scfinstancet.


     SCFERORNORESOURCES

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



     The scfinstancehandle() function will fail if:

     SCFERORHANDLEDESTROYED

         The handle associated with inst has been destroyed.



     The scfinstancegetname(), scfinstancegetparent(),  and
     scfinstancedelete() functions will fail if:



SunOS 5.11          Last change: 24 Sep 2007                    3






Service Configuration Facility Library Functions
                                        scfinstancecreate(3SCF)



     SCFERORDELETED

         The instance has been deleted.


     SCFERORNOTSET

         The instance is not set.


     SCFERORNOTBOUND

         The repository handle is not bound.


     SCFERORCONECTIONBROKEN

         The connection to the repository was lost.



     The scfserviceaddinstance() function will fail if:

     SCFEROREXISTS

         An instance named name already exists.


     SCFERORINTERNAL

         An internal error occurred.


     SCFERORNORESOURCES

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


     SCFERORNOTBOUND

         The handle is not bound.



     The scfservicegetinstance() function will fail if:

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



SunOS 5.11          Last change: 24 Sep 2007                    4






Service Configuration Facility Library Functions
                                        scfinstancecreate(3SCF)



     SCFERORINTERNAL          An internal error occurred.


     SCFERORNOTBOUND         The handle is not bound.


     SCFERORNOTFOUND         No instance  specified  by  name
                                 was found.


     SCFERORNORESOURCES      The repository server is out  of
                                 resources.



     The              scfserviceaddinstance()              and
     scfservicegetinstance() functions will fail if:

     SCFERORNOTSET

         The service is not set.


     SCFERORDELETED

         The service has been deleted.


     SCFERORINVALIDARGUMENT

         The name argument is not a valid instance name.


     SCFERORHANDLEMISMATCH

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


     SCFERORCONECTIONBROKEN

         The connection to the repository was lost.



     The scfinstancegetparent() function will fail if:

     SCFERORHANDLEMISMATCH

         The service and instance arguments are not derived  from
         the same handle.



SunOS 5.11          Last change: 24 Sep 2007                    5






Service Configuration Facility Library Functions
                                        scfinstancecreate(3SCF)



     The  scfserviceaddinstance()  and   scfinstancedelete()
     functions will fail if:

     SCFERORPERMISIONDENIED

         The user does not have sufficient privileges  to  create
         or delete an instance.


     SCFERORBACKENDREADONLY

         The repository backend is read-only.


     SCFERORBACKENDACES

         The repository backend refused the modification.



     The scfinstancedelete() function will fail if:

     SCFERORNORESOURCES    The server does not have  adequate
                               resources  for a new instance han-
                               dle.


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



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Committed                   
    
     MT-Level                     Safe                        
    


SEE ALSO
     libscf(3LIB), scferror(3SCF),  scfiterinstancepgs(3SCF),
     scfiterinstancepgstyped(3SCF),
     scfiterinstancesnapshots(3SCF),      scfpgcreate(3SCF),
     scfsnapshotcreate(3SCF), attributes(5), smf(5)

NOTES
     Instance names are of the form:




SunOS 5.11          Last change: 24 Sep 2007                    6






Service Configuration Facility Library Functions
                                        scfinstancecreate(3SCF)



       [domain,]identifier




     where domain is either a stock ticker symbol such as SUNW or
     a  Java-style reversed domain name such as com.sun. Identif-
     iers begin with a letter  or  underscore  and  contain  only
     letters, digits, underscores, and dashes.













































SunOS 5.11          Last change: 24 Sep 2007                    7






Service Configuration Facility Library Functions
                                        scfinstancecreate(3SCF)






















































SunOS 5.11          Last change: 24 Sep 2007                    8






OpenSolaris man pages main menu

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