Provides a service for examining or setting kernel run-time tunable parameters.
Standard C Library (libc.a)
The sys_parm subroutine is used to query and/or customize run-time operating system parameters.
The sys_parm subroutine:
The following operations are supported:
Item | Description |
---|---|
SYSP_GET | Returns a structure containing the current value of the specified run-time parameter found in the var structure. |
SYSP_SET | Sets the value of the specfied run-time parameter. |
The run-time parameters that can be returned or set are found in the var structure as defined in var.h
Item | Description |
---|---|
cmd | Specifies the SYSP_GET or SYSP_SET function. |
parmflag | Specifies the parameter upon which the function will act. |
parmp | Points to the user specified structure from which or to which the system parameter value is copied. parmp points to a structure of type vario as defined in var.h. |
The vario structure is an abstraction of the various fields in the var structure for which each field is size invariant. The size of the data does not depend on the execution environment of the kernel being 32 or 64 bit or the calling application being 32 or 64 bit.
#include <sys/var.h>
#include <stdio.h>
struct vario myvar;
rc=sys_parm(SYSP_GET,SYSP_V_IOSTRUN,&myvar);
if(rc==0)
printf("v.v_iostrun is set to %d\n",myvar.v.v_iostrun.value);
#include <sys/var.h>
#include <stdio.h>
struct vario myvar;
myvar.v.v_iostrun.value=0; /* initialize to false */
rc=sys_parm(SYSP_SET,SYSP_V_IOSTRUN,&myvar);
if(rc==0)
printf("disk usage statistics are not being collected\n");
Other parameters may be examined or set by changing the parmflag parameter.
These operations return a value of 0 upon succesful completion of the subroutine. Otherwise or a value of -1 is returned and the errno global variable is set to indicate the error.
Item | Description |
---|---|
EACCES | The calling process does not have the required privilege. |
EINVAL | One of the following is true:
|
EFAULT | An invalid address was specified by the parmp parameter. |
Item | Description |
---|---|
sys/var.h | Contains structure definitions. |