'\"macro stdmacro
.if n .pH ddi_dki.drv_getparm @(#)drv_getparm	40.6 of 10/10/89
.\" Copyright 1989 AT&T
.de IX
.ie '\\n(.z'' .tm .Index: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9	\\n%
.el \\!.IX \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.nr X
.if \nX=0 .ds x} drv_getparm D3DK "" "DDI/DKI" "\&"
.if \nX=1 .ds x} drv_getparm D3DK "" "DDI/DKI"
.if \nX=2 .ds x} drv_getparm D3DK "" "\&"
.if \nX=3 .ds x} drv_getparm "" "" "\&"
.TH \*(x}
.IX "\f4drv_getparm\fP(D3DK)"
.SH NAME
\f4drv_getparm\f1 \- retrieve kernel state information
.SH "SYNOPSIS" 
.nf
.na
\f4#include <sys/ddi.h>
.sp 0.5
int drv_getparm(unsigned long \f2parm, \f4unsigned long *\f2value_p\f4);\f1
.ad
.fi
.SH ARGUMENTS 
.RS 0n 10
.IP "\f2parm\f1" 10n
The kernel parameter to be obtained from \f4ddi.h\f1.
Possible values are
.P
.RS 12
.TP 10
\f4LBOLT\f1
Read the value of 
the \f4lbolt\f1.  (\f4lbolt\f1 is an integer that
represents the number of clock ticks since the last system reboot.  This value
is used as a counter or timer inside the system kernel.)
.TP
\f4PPGRP\f1
Read the process group identification number.  This number
determines which processes should receive a \f4HANGUP\f1
or \f4BREAK\f1 signal when detected by a driver.
.TP
\f4UPROCP\f1
Read the process table token value.
This information is used for the second
argument of the \f4vtop\f1(D3D) function.
.TP
\f4PPID\f1
Read process identification number.
.TP
\f4PSID\f1
Read process session identification number.
.TP
\f4TIME\f1
Read time in seconds.
.RE
.IP "\f2value_p\f1" 10n
A pointer to the data space in which the value of the
parameter is to be copied.
.RE
.SH "DESCRIPTION" 
This function verifies that \f2parm\f1 corresponds to a kernel
parameter that may be read.  If the value of \f2parm\f1 does not
correspond to a parameter or corresponds to a parameter that
may not be read, \f4-1\f1 is returned.  Otherwise, the value
of the parameter is stored in the data space pointed to
by \f2value_p\f1.
.P
\f4drv_getparm\f1 does not explicitly check to see whether the
device has the appropriate context when the function is called and the function
does not check for correct alignment in the data space pointed to by
\f2value_p\f1.  It is the responsibility of the driver writer to use this
function only when it is appropriate to do so and to correctly 
declare the data space needed by the driver.
.SH "RETURN VALUE" 
\f4drv_getparm\f1 returns 0 to indicate success, \f4-1\f1 to
indicate failure.  The value stored in the space pointed to
by \f2value_p\f1 is the value of the parameter if 0 is
returned, undefined if \f4-1\f1 is returned.
\f4-1\f1 is returned if you specify a value
other than \f4LBOLT, PPGRP, PPID, PSID, TIME\f1 or \f4UPROCP\f1.
.ig
	Note that this means you
	cannot access the current value of any of the \f4SYS*\f1 values set by
	\f4drv_setparm\f1.
..
Always check the return code when using this function.
.SH "LEVEL" 
Base only when using the \f4PPGRP, PPID, PSID, TIME,\f1 or \f4UPROCP\f1
argument values.
.P
Interrupt usable when using the \f4LBOLT\f1 argument value.
.SH "SEE ALSO" 
.na
\f4vtop\f1(D3D),
\f4buf\f1(D4DK)
.ad
