Next | Prev | Up | Top | Contents | Index

User Process Administration

The kernel supplies a small group of functions, summarized in Table 9-15, that help a driver upper-half routine learn about the current user process.

Functions for User Process Management
Function NameHeader FilesCan Sleep?Purpose
drv_getparm(D3) ddi.hNRetrieve kernel state information.
drv_priv(D3) ddi.hNTest for privileged user.
drv_setparm(D3) ddi.hNSet kernel state information.
proc_ref(D3) ddi.hNObtain a reference to a process for signaling.
proc_signal(D3) ddi.h & signal.hNSend a signal to a process.
proc_unref(D3) ddi.hNRelease a reference to a process.

Use drv_getparm() to retrieve certain miscellaneous bits of information including the process ID of the current process. In a character device driver, the current process is the user process that caused entry to the driver, for example by calling the open(), ioctl(), or read() system functions. In a block device driver, the current process has no direct relationship to any particular user; it is usually a daemon process of some kind.

The drv_setparm() function is primarily of use to terminal drivers.

The drv_priv() function tests a cred_t object to see if it represents a privileged user. A cred_t object is passed in to several driver entry points, and the address of the current one can be retrieved drv_getparm().


Sending a Process Signal

Next | Prev | Up | Top | Contents | Index