.TH size "" "" "Entry-Point Routine"
.PC "Return the size of a block device"
.B "#include <sys/types.h>"
.B "#include <kernel/param.h>"
\fBint \fIprefix\fBsize(\fIdevice\^\fB)\fR
\fBdev_t \fIdevice\^\fB;\fR
.PP
The
.B size
routine returns the size, in blocks, of
.IR device .
Should this routine fail (e.g.,
.I device
cannot be read), it returns -1.
.II NBPSCTR
The number of bytes in a block is set by the manifest constant
.B NBPSCTR ,
which is defined in the header file
.BR <kernel/param.h> .
.SH "See Also"
.B
entry-point routines
.R
.SH Notes
This routine is used only by the DDI/DKI interface.
Under this interface, it is required for block drivers.
.PP
The
.B size
routine has user context and can sleep.
