wlm_read_classes Subroutine
Purpose
Reads the characteristics of superclasses or subclasses.
Library
Workload Manager Library (libwlm.a)
Syntax
Description
The wlm_read_classes subroutine is used to get the characteristics of the superclasses or the subclasses of a given subclass of a Workload Manager (WLM) configuration.
- If the name of a configuration is passed in the confdir field,
the wlm_read_classes subroutine reads the property files of
the classes of the specified configuration. If confdir is set
to a null string ('\0'), wlm_read classes reads the classes'
characteristics from the in-core WLM data structures when WLM is on
(and returns an error when WLM is off). Note: These values may be different from the values in the property files of the configuration pointed to by /etc/wlm/current. For instance when a WLM administrator has modified the property files for the configuration pointed to by /etc/wlm/current but has not refreshed WLM yet. Another example is if applications dynamically created or modified classes through the API without saving the changes in the current configuration property files.
If your application specifically needs to access the properties of the classes as described in the /etc/wlm/current configuration, you must specify current as the configuration name in confdir.
If the name of a set of time-based configurations is passed in the confdir field, the wlm_read_classes subroutine reads the classes of the currently applicable configuration of the set.
- If the name of a valid superclass of the given configuration is passed in the name field of the class_descr substructure of wlmargs, wlm_read_classes reads the property files for the subclasses of this superclass. If a null string ('\0') is passed in the name field, wlm_read_classes reads the property files for the superclasses of the WLM configuration described above.
- When wlm_read_classes is successful, the characteristics
of the superclasses or subclasses are copied into the array of class_definition structures
pointed to by class_tbl. The integer value pointed to by nclass indicates
the maximum number of class definitions to be copied. Upon successful
return from the function, this value reflects the actual number of
classes read.
If the number of elements copied by wlm_read_classes is strictly smaller than the number of elements passed as an argument, all the classes have been read. If it is equal, it may mean that some classes were not copied into the class_tbl array because its size is too small.
The maximum number of classes read by wlm_read_classes is 67 (64 user-defined superclasses plus System, Shared and Default) when reading superclasses and 63 (61 user-defined subclasses plus Shared and Default) when reading subclasses characteristics.
- Upon successful return from wlm_read_classes, the substructure class of type struct class_definition of the structure pointed to by wlmargs contains the default values of various class attributes for the returned set of classes.
This operation does not require any special privileges and is accessible to all users.
Parameter
Item | Description |
---|---|
wlmargs | Specifies the
address of a struct wlm_args data structure.
The following fields of the wlm_args structure and the embedded substructures need to be provided:
All the other fields can be left uninitialized. |
Item | Description |
---|---|
class_tbl | Specifies the address of an array of structures of type struct class_definition. Upon successful return from wlm_read_classes, this array contains the characteristics of the classes read. |
nclass | Specifies the address of an integer containing the maximum number of element (class definitions) for wlm_read_classes to copy into the array above. If the call to wlm_read_classes is successful, this integer contains the number of elements actually copied. |
Return Values
Upon successful completion, the wlm_read_classes subroutine returns a value of 0. If the wlm_read_classes subroutine is unsuccessful, a nonzero value is returned.
Error Codes
For a list of the possible error codes returned by the WLM API functions, see the description of the wlm.h header file.