.TH getmajor() "" "" "DDI/DKI Kernel Routine"
.PC "Get the internal major-device number"
.B "#include <sys/types.h>"
.B "#include <sys/ddi.h>"
\fBmajor_t getmajor(\fIdev\^\fB)\fR
\fBdev_t \fIdevice\^\fB;\fR
.PP
.B getmajor()
returns the internal major number for
.IR device .
For a description of external and internal major numbers, see the entry for
.BR getemajor() .
.SH "See Also"
.B
DDI/DKI kernel routines,
device numbers,
etoimajor(),
getemajor(),
geteminor(),
getminor(),
makedevice()
.R
.SH Notes
.B getmajor()
has base or interrupt level.
It does not sleep.
.PP
A driver can hold a
driver-defined basic lock, read/write lock, or sleep lock
across a call to this function.
.PP
Note that
.B getmajor()
performs no validity checking:
if
.I device
is bogus, it returns an bogus major-device number.
