Sets the kernel run-time tunable parameters.
The SYS_SETPARMS sysconfig operation sets the current system parameters from a copy of the system parameter var structure provided by the caller. Only the run-time tunable parameters in the var structure can be set by this subroutine.
If the var_vers and var_gen values in the caller-provided structure do not match the var_vers and var_gen values in the current system var structure, no parameters are modified and an error is returned. The var_vers, var_gen, and var_size fields in the structure should not be altered. The var_vers value is assigned by the kernel and is used to insure that the correct version of the structure is being used. The var_gen value is a generation number having a new value for each read of the structure. This provides consistency between the data read by the SYS_GETPARMS operation and the data written by the SYS_SETPARMS operation.
The parmp parameter on the sysconfig subroutine points to a buffer that contains all or part of the var structure as defined in the sys/var.h file.
The parmlen parameter on the subroutine should be set either to the length of the var structure or to the size of the structure containing the parameters to be modified. The number of system parameters modified by this operation is determined either by the parmlen parameter value or by the var_size field in the caller-provided var structure. (The smaller of the two values is used.)
The structure provided by the caller must contain at least the header fields of the var structure. Otherwise, an error will be returned. Partial modification of a parameter in the var structure can occur if the caller's data area does not contain enough data to end on a field boundary. It is up to the caller to ensure that this does not happen.
The SYS_SETPARMS sysconfig operation returns a value of -1 if an error occurred.
When an error occurs, the errno global variable is set to one of the following values:
sys/var.h | Contains structure definitions. |
The sysconfig subroutine.
The SYS_GETPARMS sysconfig operation.
Programming in the Kernel Environment Overview in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.