.TH io "" "" "Internal Data Structure"
.PC "Manage communication with a device"
.B "#include <sys/io.h>"
.PP
The kernel uses structure
.B io
to manage communication with a device.
It is defined in header file
.BR <sys/io.h> .
.PP
A driver's
.B read
function can use the following fields within
.BR io ,
as follows:
.IP \fBio_seek\fR 1.0i
Point at which reading begins.
It is in the form of the
number of bytes from the beginning of the file or device.
This is, of course, is meaningless for devices for devices like serial ports.
.II BSIZE
In the case of disk drives, this number must indicate the block to be read,
i.e., the number must be evenly divisible by constant
.BR BSIZE ,
which gives the size of a \*(CO block.
If this is not true, an error has occurred.
.IS \fBio_ioc\fR
The number of bytes to read or write.
When the read is completed, this should be set to the number of bytes
that remain to be read or written.
If it is not reset to zero, then an error has occurred.
.IS \fBio_base\fR
The offset of data to be transferred into the user's memory space.
This is converted to a physical or virtual memory address before
performing the read.
.IS \fBio_flag\fR
Flags.
.II io.h
.B IONDLY
indicates that the request should not delay for data if the requested results
are not immediately available; it is equivalent to the DDI/DKI value
.BR O_NDELAY .
.B IONONBLOCK
indicates that the driver is non-block; it is equivalent ot the DDI/DKI value
.BR O_NONBLOCK .
.SH "See Also"
.B
internal data structures
.R
