[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions , Volume 2

wlm_init_class_definition Subroutine


Initializes a variable of type struct class_definition, defined in <sys/wlm.h> for use as an argument to Workload Manager (WLM) API function calls.


Workload Manager Library (libwlm.a)


#include <sys/wlm.h>

int wlm_init_class_definition ( wlmargs)

struct wlm_args *wlmargs;


The wlm_init_class_definition subroutine initializes or reinitializes the data structure of type struct class_definition, which is part of the argument of type struct wlm_args pointed to by wlmargs (field class), so that this data structure can be used as an argument for the class management subroutines of the WLM API library. The purpose of this call is to allow applications to initialize only the fields that are relevant for the operation they execute. For example, to change a CPU limit or share for an existing class after a call to wlm_init_class_definition, the application has to initialize the fields corresponding to the values it wishes to modify.

This routine initializes all values to specific invalid values so that the WLM library routines can find out which fields have been explicitly initialized by the user. This way, they can set or modify only the corresponding attributes. When creating a class, for instance, it is different to leave a class attribute at its invalid value set by wlm_initialize than setting its value to the current default value for the attribute. In the former case, the attribute will not appear in the property file. In the latter, it will appear and will be set with the value passed.

This makes a difference if a WLM administrator decides to change the default value for an attribute using the special stanza default in a property file. For instance, the system default for the inheritance attribute is no. If a WLM administrator wants the inheritance to be yes by default, using this special stanza, all the classes in the classes property file, for which the inheritance attribute has not been specified, will now use the default of yes. Those for which the inheritance attribute has been specified with its old default of no will not have inheritance.


wlmargs Specifies the address of the struct wlm_args data structure containing the class_definition structure to be initialized.

Only the versflags field of the wlm_args structure passed need to be initialized with WLM_VERSION.

Return Values

Upon successful completion, the wlm_init_class_definition subroutine returns a value of 0. If the wlm_init_class_definition subroutine is unsuccessful a non-0 value is returned.

Error Codes

There are two possible error code returned by wlm_init_class_definition:

BADVERSION Specifies the value of the flags parameter is not a supported version number.
NOTINITED Specifies the WLM API has not been initialized by a prior call to wlm_init.

Related Information

The wlm.h header file.

The wlm_change_class (wlm_change_class Subroutine) subroutine, wlm_create_class (wlm_create_class Subroutine) subroutine, wlm_delete_class (wlm_delete_class Subroutine) subroutine.

[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]