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

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

cfg_subsys_state(3)

Contents


NAME    [Toc]    [Back]

       cfg_subsys_state  -  determine the state of the named subsystem

SYNOPSIS    [Toc]    [Back]

       #include <cfg.h>

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

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 you receive when you call
       the cfg_connect() routine.  Specifies the name of the subsystem
  for  which  you  are requesting state information.
       Returns a collection of bit flags representing  the  state
       of  the  subsystem.  The  bit  flags  are  defined  in the
       <sys/sysconfig.h> header file.  The  following  flags  are
       currently          defined:          CFG_STATE_CONFIGURED,
       CFG_STATE_DYNAMIC, and CFG_STATE_LOADED.

DESCRIPTION    [Toc]    [Back]

       Use the cfg_subsys_state() routine to determine the  state
       of  a  particular  subsystem.  Subsystems  can  be loaded,
       loaded and configured, or unloaded.  (Subsystems  must  be
       loaded  to be configured.) In addition, a subsystem can be
       either static (the CFG_STATE_DYNAMIC bit flag is not  set)
       or dynamic (the CFG_STATE_DYNAMIC bit flag is set). Static
       subsystems are linked into the kernel at  build  time  and
       the  only  way to add or remove them from the kernel is to
       rebuild the kernel. Dynamic subsystems are loadable, meaning
  that  they  can  be added and removed from the kernel
       while the system is running.

       The value returned in the state parameter  is  an  integer
       representation  of  a  binary value. The bits in the value
       designate the state of the  subsystem.  For  example,  the
       least  significant bit designates whether 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
       the value 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.

RETURN VALUES    [Toc]    [Back]

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

       cfg_status_t                   retval;        cfg_handle_t
       handle; unsigned int            state;

       retval = cfg_subsys_state(&handle, "vfs", &state);

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

            /*   Determine whether or not the subsystem is loaded
       */
            /*    and  configured.   Display a message describing
       the          */
            /*                   subsystem                 state.
       */

            if (state & CFG_STATE_LOADED) {
               if (state & CFG_STATE_CONFIGURED)
                  printf("The  subsystem  is  loaded  and configured.\n");

               else
                  printf("The subsystem is loaded but not configured.\n");

            else
               printf("The subsystem is unloaded.\n");
            } }

       In  this example, the cfg_subsys_state() routine returns a
       value representing the state of  the  vfs  subsystem.  The
       application determines whether the call to the routine was
       successful and, if it was, displays a  message  describing
       the state of the subsystem.

SEE ALSO    [Toc]    [Back]

      
      
       Commands: cfgmgr(8), sysconfig(8)

       Routines: cfg_subsys_list(3), libcfg(3)



                                              cfg_subsys_state(3)
[ Back ]
 Similar pages
Name OS Title
cfg_subsys_query_all Tru64 determine the value of all attributes for a subsystem
cfg_subsys_query Tru64 determine the value of selected subsystem attributes
cfg_subsys_defaults_all Tru64 determine the /etc/sysconfigtab value for all attributes of a subsystem
cfg_subsys_defaults Tru64 determine the /etc/sysconfigtab value for selected attributes of a subsystem
ipsec_mgr Tru64 Manipulate the state of the IPsec subsystem
mbsinit Tru64 Determine whether a multibyte-character string is in the initial conversion state
pathfind IRIX search for named file in named directories
mbsinit NetBSD determines whether the state object is initial state
named.conf FreeBSD configuration file for named(8)
setextattr OpenBSD set a named extended attribute
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service