.TH getemajor() "" "" "DDI/DKI Kernel Routine"
.PC "Get an external major-device number"
.B "#include <sys/types.h>"
.B "#include <sys/ddi.h>"
\fBmajor_t getemajor(\fIdevice\^\fB)\fR
\fBdev_t \fIdevice\^\fB;\fR
.PP
.B getemajor()
returns the external major number for
.IR device .
.PP
.II "external major number"
.II "internal major number"
.II "major number^external"
.II "major number^internal"
An external major-device number is the number visible to the user, e.g.,
through the command
.BR "ls -l" .
An internal major-device number is visible only to the kernel.
Because the range of major-device numbers is large and sparsely populated,
the kernel maps external numbers to internal to save space.
Every entry point to a driver uses an external, not internal,
major-device number.
.SH "See Also"
.B
DDI/DKI kernel routines,
device numbers,
etoimajor(),
geteminor(),
getmajor(),
getminor(),
makedevice()
.R
.SH Notes
.B getemajor()
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.
