[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 2

SYS_QUERYLOAD sysconfig Operation

Purpose

Determines if a kernel object file has already been loaded.

Description

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.

Return Values

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.

Error Codes

On error, the subroutine returns a -1 and the errno global variable is set to one of the following values:

EACCES The calling process does not have the required privilege.
EFAULT The calling process does not have sufficient authority to access the data area described by the parmp and parmlen parameters provided on the subroutine. This error is also returned if an I/O error occurred when accessing data in this area.
EFAULT The path parameter points to a location outside of the allocated address space of the process.
EIO An I/O error occurred during the operation.

Related Information

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.


[ Previous | Next | Contents | Glossary | Home | Search ]