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

sysconfig Subroutine


Provides a service for controlling system/kernel configuration.


Standard C Library (libc.a)


#include <sys/types.h>
#include <sys/sysconfig.h>
int sysconfig (Cmd, Parmp, Parmlen)
int Cmd;
void *Parmp;
int Parmlen;


The sysconfig subroutine is used to customize the operating system. This subroutine provides a means of loading, unloading, and configuring kernel extensions. These kernel extensions can be additional kernel services, system calls, device drivers, or file systems. The sysconfig subroutine also provides the ability to read and set system run-time operating parameters.

Use of the sysconfig subroutine requires appropriate privilege.

The particular operation that the sysconfig subroutine provides is defined by the value of the Cmd parameter. The following operations are defined:

SYS_KLOAD Loads a kernel extension object file into kernel memory.
SYS_SINGLELOAD Loads a kernel extension object file only if it is not already loaded.
SYS_QUERYLOAD Determines if a specified kernel object file is loaded.
SYS_KULOAD Unloads a previously loaded kernel object file.
SYS_QDVSW Checks the status of a device switch entry in the device switch table.
SYS_CFGDD Calls the specified device driver configuration routine (module entry point).
SYS_CFGKMOD Calls the specified module at its module entry point for configuration purposes.
SYS_GETPARMS Returns a structure containing the current values of run-time system parameters found in the var structure.
SYS_SETPARMS Sets run-time system parameters from a caller-provided structure.

In addition, the SYS_64BIT flag can be bitwise or'ed with the Cmd parameter (if the Cmd parameter is SYS_KLOAD or SYS_SINGLELOAD). For kernel extensions, this indicates that the kernel extension does not export 64-bit system calls, but that all 32-bit system calls also work for 64-bit applications. For device drivers, this indicates that the device driver can be used by 64-bit applications.

"Loader Symbol Binding Support" explains the symbol binding support provided when loading kernel object files.


Cmd Specifies the function that the sysconfig subroutine is to perform.
Parmp Specifies a user-provided structure.
Parmlen Specifies the length of the user-provided structure indicated by the Parmp parameter.

Return Values

These sysconfig operations return a value of 0 upon successful completion of the subroutine. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.

Any sysconfig operation requiring a structure from the caller fails if the structure is not entirely within memory addressable by the calling process. A return value of -1 is passed back and the errno global variable is set to EFAULT.

Related Information

The ddconfig device driver entry point.

Device Driver Kernel Extension Overview, Device Configuration Subsystem Programming Introduction, Programming in the Kernel Environment Overview, Understanding Kernel Extension Binding, Understanding the Device Switch Table in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.

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