Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ drv_getparm(D3) — UnixWare 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought






       drv_getparm(D3)                                      drv_getparm(D3)


       NAME
             drv_getparm - retrieve kernel state information

       SYNOPSIS
             #include <sys/types.h>
             #include <sys/ddi.h>
             int drv_getparm(ulong_t parm, void *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:

                   DRV_MAXBIOSIZE
                             Get the maximum possible I/O transfer size, a
                             value which is returned as MAXBIOSIZE.  This
                             value can then be used when allocating data
                             structures or to perform other optimizations.

                   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


                           Copyright 1994 Novell, Inc.               Page 1













      drv_getparm(D3)                                      drv_getparm(D3)


                            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).

                  STRMSGSIZE
                            Return the value of the maximum STREAMS
                            message size (strmsgsz).

                  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.

                  UPROCP    Retrieve a pointer to the process structure
                            for the current process.  The value returned
                            in *value_p is of type (proc_t *) and the only
                            valid use of the value is as an argument to
                            vtop(D3), or when calling psignal(D3) on those
                            systems which do not have the new
                            proc_signal(D3) interfaces.  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.

                  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.




                          Copyright 1994 Novell, Inc.               Page 2













       drv_getparm(D3)                                      drv_getparm(D3)


          Level
             Base only when using the UPROCP or UCRED argument values.

             Initialization, Base or Interrupt when using the
             DRV_MAXBIOSIZE, 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),
             proc_signal(D3), psignal(D3), vtop(D3)

       NOTICES
          Portability
             All processors

          Applicability
             ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp

             The value_p argument is currently defined as a pointer to a
             void data type.  In earlier releases, it was a pointer to a
             ulong_t data type.






















                           Copyright 1994 Novell, Inc.               Page 3








Typewritten Software • bear@typewritten.org • Edmonds, WA 98026