.TH itoemajor() "" "" "DDI/DKI Kernel Routine"
.PC "Convert internal to external major number"
.B "#include <sys/types.h>"
.B "#include <sys/ddi.h>"
\fBmajor_t itoemajor(\fIimajor\^\fB, \fIprevemajor\^\fB)\fR
\fBmajor_t \fIimajor\^\fB, \fIprevemajor\^\fB;\fR
.PP
.B itoemajor()
returns the external major number that corresponds to the
internal major number
.IR imajor .
See
.B getemajor()
for an explanation of external and internal major numbers.
.PP
.I prevemajor
gives the most recently obtained external major number.
When you call
.B itoemajor()
for the first time, set this to
.BR NODEV .
Because an internal major number can be associated more than external
major number, this mechanism lets you call
.B itoemajor()
repeated to find all of the external major numbers.
When it has returned all external major numbers associated with
.IR imajor ,
it returns
.BR NODEV .
.SH "See Also"
.B
DDI/DKI kernel routines,
etoimajor(),
getemajor(),
geteminor(),
getmajor(),
getminor(),
makedevice()
.R
.SH Notes
.B itoemajor()
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.
