drv_getparm(D3)

drv_getparm - retrieve kernel state information

As shipped in IRIX 6.5.22. Last changed in IRIX 6.5.5.

NAME
     drv_getparm - retrieve kernel state information

SYNOPSIS
     #include <sys/types.h>
     #include <sys/ddi.h>
     int drv_getparm(ulong_t parm, ulong_t *value_p);

   Arguments
     parm      The kernel parameter to be obtained.

     value_p   A pointer to the data space into which the value of the
               parameter is to be copied.

DESCRIPTION
     drv_getparm returns the value of the parameter specified by parm in the
     location pointed to by value_p.

   Return Values
     On success, drv_getparm returns 0.  On failure it returns -1 to indicate
     that parm specified an invalid parameter.

USAGE
     drv_getparm does not explicitly check to see whether the driver has the
     appropriate context when the function is called.  It is the
     responsibility of the driver to use this function only when it is
     appropriate to do so and to correctly declare the data space needed.

     Valid values for parm are:

          LBOLT     Read the number of clock ticks since the last system
                    reboot.  The difference between the values returned from
                    successive calls to retrieve this parameter provides an
                    indication of the elapsed time between the calls in units
                    of clock ticks.  The length of a clock tick can vary
                    across different implementations, and therefore drivers
                    should not include any hard-coded assumptions about the
                    length of a tick.  The drv_hztousec(D3) and
                    drv_usectohz(D3) functions can be used, as necessary, to
                    convert between clock ticks and microseconds
                    (implementation independent units).

          TIME      Read the time in seconds.  This is the same time value
                    that is returned by the time(2) system call.  The value is
                    defined as the time in seconds since 00:00:00 GMT, January
                    1, 1970.  This definition presupposes that the
                    administrator has set the correct system date and time.

          UCRED     Retrieve a pointer to the credential structure describing
                    the current user credentials for the current process.  The
                    value returned in *value_p is of type (cred_t *) and the
                    only valid use of the value is as an argument to
                    drv_priv(D3).  Since this value is associated with the
                    current process, the caller must have process context
                    (that is, must be at base level) when attempting to
                    retrieve this value.  Also, this value should only be used
                    in the context of the process in which it was retrieved.

          PGRP      Read the process group identification number. This number
                    determines which processes should receive a HANGUP or
                    BREAK signal when detected by a driver.

          PPID      Read process identification number.

          PSID      Read process identification number.

   Level
     Base only when using the UCREDP argument values.
     Initialization, Base, or Interrupt when using the LBOLT or TIME argument
     values.

   Synchronization Constraints
     Does not sleep.
     Driver-defined basic locks, read/write locks, and sleep locks may be held
     across calls to this function

REFERENCES
     drv_hztousec(D3), drv_priv(D3), drv_usectohz(D3)