sysconfig Subroutine

Purpose

Provides a service for controlling system/kernel configuration.

Library

Standard C Library (libc.a)

Syntax

#include <sys/types.h>
#include <sys/sysconfig.h>

int sysconfig ( Cmd,  Parmp,  Parmlen)
int Cmd;
void *Parmp;
int Parmlen;

Description

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 in AIX® Version 7.1 Operating system and device management. 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:

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

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.

Parameters

Item Description
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.