2 .\" opyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH DRV_GETPARM 9F "Jan 16, 2006"
9 drv_getparm \- retrieve kernel state information
17 \fBint\fR \fBdrv_getparm\fR(\fBunsigned int\fR \fIparm\fR, \fBvoid *\fR\fIvalue_p\fR);
23 Architecture independent level 1 (DDI/DKI).
31 The kernel parameter to be obtained. Possible values are:
40 Read the value of \fBlbolt\fR. \fBlbolt\fR is a \fBclock_t\fR that is
41 unconditionally incremented by one at each clock tick. No special treatment is
42 applied when this value overflows the maximum value of the signed integral type
43 \fBclock_t\fR. When this occurs, its value will be negative, and its magnitude
44 will be decreasing until it again passes zero. It can therefore not be relied
45 upon to provide an indication of the amount of time that passes since the last
46 system reboot, nor should it be used to mark an absolute time in the system.
47 Only the difference between two measurements of \fBlbolt\fR is significant. It
48 is used in this way inside the system kernel for timing purposes.
57 Read the process group identification number. This number determines which
58 processes should receive a \fBHANGUP\fR or \fBBREAK\fR signal when detected by
68 Read the process table token value.
77 Read process identification number.
86 Read process session identification number.
104 Return a pointer to the caller's credential structure.
113 A pointer to the data space in which the value of the parameter is to be
120 Since the release of the Solaris 2.6 operating environment, the
121 \fBdrv_getparm()\fR function has been replaced by \fBddi_get_lbolt\fR(9F),
122 \fBddi_get_time\fR(9F), and \fBddi_get_pid\fR(9F).
125 The \fBdrv_getparm()\fR function verifies that \fIparm\fR corresponds to a
126 kernel parameter that may be read. If the value of \fIparm\fR does not
127 correspond to a parameter or corresponds to a parameter that may not be read,
128 \fB-1\fR is returned. Otherwise, the value of the parameter is stored in the
129 data space pointed to by \fIvalue_p\fR.
132 The \fBdrv_getparm()\fR function does not explicitly check to see whether the
133 device has the appropriate context when the function is called and the function
134 does not check for correct alignment in the data space pointed to by
135 \fIvalue_p\fR. It is the responsibility of the driver writer to use this
136 function only when it is appropriate to do so and to correctly declare the data
137 space needed by the driver.
141 The \fBdrv_getparm()\fR function returns \fB0\fR to indicate success, \fB-1\fR
142 to indicate failure. The value stored in the space pointed to by \fIvalue_p\fR
143 is the value of the parameter if \fB0\fR is returned, or undefined if \fB-1\fR
144 is returned. \fB-1\fR is returned if you specify a value other than
145 \fBLBOLT\fR, \fBPPGRP\fR, \fBPPID\fR, \fBPSID\fR, \fBTIME\fR, \fBUCRED\fR, or
146 \fBUPROCP\fR. Always check the return code when using this function.
150 The \fBdrv_getparm()\fR function can be called from user context only when
151 using \fBPPGRP\fR, \fBPPID\fR, \fBPSID\fR, \fBUCRED\fR, or \fBUPROCP\fR. It can
152 be called from user, interrupt, or kernel context when using the \fBLBOLT\fR or
157 \fBddi_get_lbolt\fR(9F), \fBddi_get_pid\fR(9F), \fBddi_get_time\fR(9F),
161 \fIWriting Device Drivers\fR