.\" -*- nroff -*- .\" .\" copyright (C) 1997 Stephen Williams .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .TH MAJOR 9 "$Date:$" "Linux DDI" "Kernel Functions" .\" .\" Turn off hyphenation and right justification for the first sections. .hlm 0 .na .\" The name should be formatted this way for apropos to work .SH NAME MAJOR, MINOR, MKDEV \- macros to manipulate device major/minor numbers .\" .\" .SH SYNOPSIS .B #include .sp .BI "#define MAJOR(" dev ")" .br .BI "#define MINOR(" dev ")" .br .BI "#define MKDEV(" major ", " minor ")" .HP .\" .\" Turn hyphenation and adjustment back on. .hlm 1 .ad .SH DESCRIPTION The .B MAJOR and .B MINOR macros extract from a device id (of type .IR dev_t ) the major and minor numbers respectively. It is the combined device number that is found in the .B "struct~file" structure. .PP The .B MKDEV macro assembles a device number from the supplied major and minor numbers. .SH "RETURN VALUE" Describe the return values. Enumerate all the distinct values and all the ranges. .SH AVAILABILITY Linux 0.0+ .PP In later kernels (Linux 2.1 and later) there is movement towards using 64bit device numbers. Although it is generally a good idea to not presume to know how device numbers are constructed, it is during this period of transition fundamentally important that you ONLY use these functions to manipulate device numbers. .SH "SEE ALSO" .hlm 0 .na .BR mknod "(1)" .ad .hlm 1 .PP Also list some source files for the kernel that implement the functions of the page. .SH AUTHOR Stephen Williams .SH BUGS These are macros, so parameters may be evaluated multiple times.