 |
Index for Section 9 |
|
 |
Alphabetical listing for Special Characters |
|
 |
Bottom of page |
|
_IOWR(9r)
NAME
_IOWR - General: Defines ioctl types for device control operations
SYNOPSIS
#include <sys/ioctl.h>
_IOWR(
g,
n,
t );
ARGUMENTS
g Specifies the group that this ioctl type belongs to. This argument must
be a nonnegative 8-bit number (that is, in the range 0-255 inclusive).
You can pass the value zero (0) to this argument if a new ioctl group
is not being defined.
n Specifies the specific ioctl type within the group. These types should
be sequentially assigned numbers for each different ioctl operation the
driver supports. This argument must be a nonnegative 8-bit number (that
is, in the range 0-255 inclusive).
t Specifies the size of the data passed from the user application back to
the kernel. The kernel determines the number of bytes to transfer by
passing the value in this argument to the sizeof operator. Upon
completion of the ioctl operation, this same data structure contains
the data returned from the driver back to the user level application.
DESCRIPTION
The _IOWR macro defines ioctl types for situations where data is
transferred from the user's buffer into the kernel. The driver then
performs the appropriate ioctl operation and returns data of the same size
back up to the user-level application. Typically, this data consists of
device control or status information passed to the driver from the
application program.
EXAMPLE
The following example uses the _IOWR macro to construct an ioctl called
DN_SETVERIFY. Note that DN_SETVERIFY passes the value zero (0) for the
group that this ioctl belongs to and the value 4 to identify the specific
ioctl type within the group. The DN_SETVERIFY ioctl also passes the data
type int, which the kernel passes to the sizeof operator to determine how
much data is passed from the user application back to the kernel.
#define DN_SETVERIFY _IOWR(0,4,int)
SEE ALSO
ioctl Commands: _IO(9r), _IOR(9r), _IOW(9r)
 |
Index for Section 9 |
|
 |
Alphabetical listing for Special Characters |
|
 |
Top of page |
|