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

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

cfg_subsys_list(3)

Contents


NAME    [Toc]    [Back]

       cfg_subsys_list  -  determine  the names and states of all
       subsystems registered on the system

SYNOPSIS    [Toc]    [Back]

       #include <cfg.h>

       cfg_status_t cfg_subsys_list(
               cfg_handle_t *handle,
               caddr_t **subsys,
               unsigned int **state,
               int *nsubsys );

LIBRARY    [Toc]    [Back]

       Configuration Management Library (libcfg.a)

PARAMETERS    [Toc]    [Back]

       Structure identifying the means of  communication  between
       your  application and the configuration management server.
       For local requests,  pass  NULL  in  this  parameter.  For
       remote requests, pass the value returned from the cfg_connect()
 routine.  Returns the names of subsystems currently
       registered  on the system. The system allocates memory for
       this array, which you should free when the information  in
       the  array  is  no longer needed.  Returns an array of bit
       flags,  defined  in  <sys/sysconfig.h>,  representing  the
       state  of  the subsystems. The system allocates memory for
       this array, which you should free when the information  in
       the  array  is  no  longer needed. The following flags are
       currently defined:  loaded  and  configured.   Returns  an
       integer  designating  how  many subsystem names and states
       are being returned.

DESCRIPTION    [Toc]    [Back]

       Use the cfg_subsys_list() routine to determine  the  names
       of  subsystems  available  on  the  system and the current
       state of those subsystems.

       The subsys array returns NULL terminated  subsystem  names
       of   length   CFG_SUBSYS_NAME_SZ.  (CFG_SUBSYS_NAME_SZ  is
       defined in the <sys/sysconfig.h> header file.)

       The value returned in the state parameter is an array containing
  integer  representations  of  binary  values. The
       least significant bit  in  each  binary  value  designates
       whether  or  not  the  subsystem is loaded. If this bit is
       set, the subsystem is loaded. If the next higher order bit
       is set, the subsystem is configured.

       You can determine the state of a subsystem by using one of
       the values returned in the state parameter  in  a  bitwise
       AND  operation.  The <sys/sysconfig.h> header file defines
       constants for this purpose. See the EXAMPLES  section  for
       more information about using these constants.

       The  array of subsystems states and the array of subsystem
       names are parallel arrays. In other words, the first  element
  of the state array contains the state of the subsystem
 named in the first element of the  subsys  array.  The
       second  element  of the state array gives the state of the
       second element in the subsys array, and so on.

RETURN VALUES    [Toc]    [Back]

       Upon  successful  completion,  cfg_subsys_list()   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_list()
 library routine:

       cfg_status_t                   retval;        cfg_handle_t
       handle;  caddr_t                  *subsys;  unsigned   int
       *state;      int                          nsubsys;     int
       i;

       retval = cfg_subsys_list(&handle, &subsys, &state,  &nsubsys);


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

            /*    Walk  through  the array of subsystem names and
       the array    */
            /*   of subsystem  states.   Display  each  name  and
       state.         */

           for (i=0; i<nsubsys; i++){
            if (state[i] & CFG_STATE_LOADED) {
               if (state[i] & CFG_STATE_CONFIGURED)
                  printf("Subsystem  '%s'  is  loaded and configured.\n",

                          subsys[i]);
               else
                  printf("Subsystem  '%s'  is  loaded.\n",   subsys[i]);

            else
                  printf("Subsystem  '%s'  is  unloaded.\n", subsys[i]);

            }
           }
           free(subsys);
           free(state); }

       In this example, the cfg_subsys_list() routine returns  an
       array of subsystem names and an array of subsystem states.
       The application determines whether the call to the routine
       was  successful.  If the call was successful, the application
 displays the name and state of each subsystem  available
 on the system.

       The  system  allocates memory in which to return the state
       and subsys arrays. After the application is finished using
       the values in those arrays, it calls the free() routine to
       make that memory available for use by other  applications.

SEE ALSO    [Toc]    [Back]

      
      
       Commands: cfgmgr(8), sysconfig(8)

       Routines: cfg_subsys_state(3), libcfg(3)



                                               cfg_subsys_list(3)
[ Back ]
 Similar pages
Name OS Title
gss_compare_name HP-UX allow an application to compare two internal names to determine whether they are equivalent
ALgetparams IRIX (obsolete) get/set the value of the specified audio device states
fdatasync HP-UX synchronize a file's in-core and on-disk states
fsync HP-UX synchronize a file's in-core and on-disk states
gfxinit IRIX initialize all graphics subsystems
kcmodule HP-UX manage kernel modules and subsystems
gfxinfo IRIX display graphics subsystems information
hwmgr_show Tru64 Displays information from kernel-based hardware subsystems
autosysconfig Tru64 Maintains the list of dynamic kernel subsystems that are automatically configured
fstyp HP-UX determine file system type
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service