*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> cfg_subsys_defaults (3)              
Title
Content
Arch
Section
 

cfg_subsys_defaults(3)

Contents


NAME    [Toc]    [Back]

       cfg_subsys_defaults   -  determine  the  /etc/sysconfigtab
       value for selected attributes of a subsystem

SYNOPSIS    [Toc]    [Back]

       #include <cfg.h>

       cfg_status_t cfg_subsys_defaults(
               cfg_handle_t *handle,
               caddr_t subsys,
               cfg_attr_t *attributes,
               int nattributes );

LIBRARY    [Toc]    [Back]

       Configuration Management Library (libcfg.a)

PARAMETERS    [Toc]    [Back]

       Structure identifying the means of  communication  between
       your application and the configuration manager server. For
       local requests, pass NULL in this  parameter.  For  remote
       requests,  pass  the value returned from the cfg_connect()
       routine.  Specifies the name of the  subsystem  for  which
       you  are  requesting  default attribute values.  On input,
       names the  attributes  for  which  you  are  requesting  a
       default value.

              On  return,  contains  information  about the named
              attributes. The information includes the attributespecific
   status   of   the  cfg_subsys_defaults()
              request and the default value of the  attribute  as
              specified in the /etc/sysconfigtab database.  Specifies
  the  number  of  attributes  in  the   input
              attribute list.

DESCRIPTION    [Toc]    [Back]

       Use  the  cfg_subsys_defaults() routine to get information
       about the value assigned to attributes in the /etc/sysconfigtab
  database. You can request information about one or
       more attributes, but you can get  information  about  only
       one  subsystem  at  a  time.  (For  information  about the
       /etc/sysconfigtab database, see sysconfigtab(4).)

       In the call to  the  cfg_subsys_defaults()  routine,  your
       application passes the subsystem name and a list of one or
       more attribute names. The system  reads  this  information
       and  finds  and  collects  the information about the named
       attributes. The system then returns the attribute information
 to your application.

       The  information  returned  from the cfg_subsys_defaults()
       routine is passed in a structure of  type  cfg_attr_t.  If
       your  application requests information about more than one
       attribute, an array of structures is returned. For  information
 about this structure, see libcfg(3).

       The  following  list describes the information returned to
       your application when it calls  the  cfg_subsys_defaults()
       routine:  Attributes  can  be  integer,  string, or binary
       data. However, the system is unable to determine the  data
       type   of  attributes  by  reading  the  /etc/sysconfigtab
       database.  Therefore, this field returns the CFG_ATTR_STRTYPE
 data type for all attributes.  The definition of each
       attribute in the subsystem attribute table determines what
       operations you can perform on the attribute. The system is
       unable to determine this information from the /etc/sysconfigtab
  database,  so  this  field  is NULL on return from
       cfg_subsys_defaults()   requests.    During   a   cfg_subsys_defaults()
  request, the system assigns each attribute
       a status. The following table describes the status  values
       your  application  might  receive on return from this routine:


              ---------------------------------------------------------------------
              Status Code        Meaning
              ---------------------------------------------------------------------
              CFG_ATTR_SUCCESS   Successful operation
              CFG_ATTR_EEXISTS   No attribute by that name exists
              CFG_ATTR_EOP       Attribute does not support the query operation
              CFG_ATTR_ESUBSYS   Subsystem  failure  (code  within  the  subsystem
                                 returned an error)
              CFG_ATTR_EINDEX    The  index  for  an  indexed  attribute is out of
                                 range
              CFG_ATTR_EMEM      Unable to allocate memory to return the attribute
                                 value
              ---------------------------------------------------------------------
              The value of each attribute is returned in a structure,
 which  contains  a  string  representing  the
              value  of  the  attribute  as  it is defined in the
              /etc/sysconfigtab  database.  If  an  attribute  is
              omitted    from    the   database,   the   cfg_subsys_defaults()
 routine  returns  a  NULL  attribute
              value.

              The  cfg_subsys_defaults() routine returns NULL for
              other fields in the attribute value structure.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, cfg_subsys_defaults()  returns
       CFG_SUCCESS.  Other  return  values indicate that an error
       has occurred. For information about handling return values
       from routines in the configuration management library, see
       libcfg(3).

EXAMPLES    [Toc]    [Back]

       The following example illustrates the use of the  cfg_subsys_defaults()
 routine:

       cfg_attr_t                  attributes[2];    cfg_status_t
       retval;      cfg_handle_t                 handle;      int
       i;

       /*****************************************************/ /*
       Initialize attribute names for the request       */

       strcpy    (attributes[0].name,     "bufcache");     strcpy
       (attributes[1].name, "max-vnodes");

       /***************************************************/   /*
       Call the cfg_subsys_defaults routine          */

       retval = cfg_subsys_defaults(&handle,  "vfs",  attributes,
       2);

       if (retval != CFG_SUCCESS)
           print_error (retval);

       else {
            /*  Use data returned from the request        */

            for (i=0; i<2; i++) {
                printf ("%s", attributes[i].name);
                if (attributes[i].status != CFG_ATTR_SUCCESS) {
                    switch (attributes[i].status){
                    case CFG_ATTR_EEXISTS:
                      printf("unknown attribute\n");
                      break;
                    case CFG_ATTR_EOP:
                      printf("attribute does not allow this operation\n");

                      break;
                    .
                    .
                    .
                    default:
                      printf("unknown error\n");
                      break;
                   }
               continue;
               }

          /*     Display attribute value to application user   */

               printf ("%s\n", attributes[i].attr.str.val);
            }
          free(attributes[i].attr.str.val);
          break; }

       In  this  example,  the  application  requests information
       about two attributes, bufcache and  max-vnodes.  When  the
       cfg_subsys_defaults()  routine  returns  information about
       those attributes, the application tests the return  status
       of  the  routine  and  reports any errors returned. If the
       cfg_subsys_defaults()  routine  returns  CFG_SUCCESS,  the
       status  for  each  attribute  is tested and any errors are
       reported. The application displays the  default  value  of
       attributes that return CFG_ATTR_SUCCESS.

SEE ALSO    [Toc]    [Back]

      
      
       Commands: cfgmgr(8), sysconfig(8)

       Routines:    cfg_connect(3),   cfg_subsys_defaults_all(3),
       libcfg(3)

       Files: sysconfigtab(4)



                                           cfg_subsys_defaults(3)
[ Back ]
 Similar pages
Name OS Title
cfg_subsys_defaults_all Tru64 determine the /etc/sysconfigtab value for all attributes of a subsystem
cfg_subsys_query Tru64 determine the value of selected subsystem attributes
cfg_subsys_query_all Tru64 determine the value of all attributes for a subsystem
cfg_query Tru64 General: Determines the values of selected subsystem attributes
XlateAddr Tru64 Atom routines used to determine the instrumented PC for selected instructions
Xlate Tru64 Atom routines used to determine the instrumented PC for selected instructions
XlateInstTextStart Tru64 Atom routines used to determine the instrumented PC for selected instructions
XlateLoadShift Tru64 Atom routines used to determine the instrumented PC for selected instructions
CreateXlate Tru64 Atom routines used to determine the instrumented PC for selected instructions
AddXlateEntry Tru64 Atom routines used to determine the instrumented PC for selected instructions
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service