*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: cfg_subsys_list | Section: 3 | Source: Digital UNIX | File: cfg_subsys_list.3.gz
cfg_subsys_list(3) Library Functions Manual cfg_subsys_list(3) NAME cfg_subsys_list - Determine the names and states of all subsystems reg- istered on the system LIBRARY Configuration Management Library (libcfg.a) SYNOPSIS #include <cfg.h> cfg_status_t cfg_subsys_list( cfg_handle_t *handle, caddr_t **subsys, unsigned int **state, int *nsubsys); PARAMETERS Structure identifying the means of communication between your applica- tion 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 cur- rently 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/syscon- fig.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 de- fined: loaded and configured. Returns an integer designating how many subsystem names and states are being returned. DESCRIPTION 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/syscon- fig.h> header file.) The value returned in the state parameter is an array containing inte- ger 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. EXAMPLES The following example illustrates the use of the cfg_subsys_list() li- brary routine: cfg_status_t retval; cfg_handle_t handle; caddr_t *subsys; unsigned int *state; int nsub- sys; 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 sub- system names and an array of subsystem states. The application deter- mines whether the call to the routine was successful. If the call was successful, the application displays the name and state of each subsys- tem available on the system. The system allocates memory in which to return the state and subsys ar- rays. Once the application is finished using the values in those ar- rays, it calls the free() routine to make that memory available for use by other applications. RETURN VALUES Upon successful completion, cfg_subsys_list() returns CFG_SUCCESS. Other return values indicate that an error has occurred. For informa- tion about handling return values from routines in the configuration management library, see libcfg(3). RELATED INFORMATION Commands: cfgmgr(8), sysconfig(8) Routines: cfg_subsys_state(3), libcfg(3) delim off cfg_subsys_list(3)

Navigation Options