Determines if a kernel object file has already been loaded.
The SYS_QUERYLOAD sysconfig operation performs a query operation to determine if a given object file has been loaded. This object file is specified by the path field in the cfg_load structure passed in with the parmp parameter. This operation utilizes the same cfg_load structure that is specified for the SYS_KLOAD operation.
If the specified object file is not loaded, the kmid field in the cfg_load structure is set to a value of 0 on return. Otherwise, the kernel module ID of the module is returned in the kmid field. If multiple instances of the module have been loaded into the kernel, the module ID of the one most recently loaded is returned.
The libpath field in the cfg_load structure is not used for this option.
Note: A path-name comparison is done to determine if the specified object file has been loaded. However, this operation will erroneously return a not loaded condition if the path name to the object file is expressed differently than it was on a previous load request.
"Loader Symbol Binding Support" explains the symbol binding support provided when loading kernel object files.
If the specified object file is found, the module ID is returned in the kmid variable within the cfg_load structure and the subroutine returns a 0. If the specified file is not found, a kmid variable of 0 is returned with a return code of 0.
On error, the subroutine returns a -1 and the errno global variable is set to one of the following values:
The sysconfig subroutine.
The SYS_SINGLELOAD sysconfig operation, SYS_KLOAD sysconfig operation.
Programming in the Kernel Environment Overview in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.
Understanding Kernel Extension Binding Overview in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.