{"id":4158,"date":"2022-12-20T17:39:33","date_gmt":"2022-12-20T20:39:33","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/major-man9\/"},"modified":"2022-12-20T17:39:33","modified_gmt":"2022-12-20T20:39:33","slug":"major-man9","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/major-man9\/","title":{"rendered":"MAJOR (man9)"},"content":{"rendered":"<h1 align=\"center\">MAJOR<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#AVAILABILITY\">AVAILABILITY<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">MAJOR, MINOR, MKDEV \u2212 macros to manipulate device major\/minor numbers<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <linux\/fs.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#define MAJOR(<\/b><i>dev<\/i><b>) <br \/> #define MINOR(<\/b><i>dev<\/i><b>) <br \/> #define MKDEV(<\/b><i>major<\/i><b>,<\/b> <i>minor<\/i><b>)<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>MAJOR<\/b> and <b>MINOR<\/b> macros extract from a device id (of type <i>dev_t<\/i>) the major and minor numbers respectively. It is the combined device number that is found in the <b>struct~file<\/b> structure.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>MKDEV<\/b> macro assembles a device number from the supplied major and minor numbers.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Describe the return values. Enumerate all the distinct values and all the ranges.<\/p>\n<h2>AVAILABILITY <a name=\"AVAILABILITY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Linux 0.0+<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>mknod<\/b>(1)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Also list some source files for the kernel that implement the functions of the page.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Stephen Williams <steve@icarus.com><\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">These are macros, so parameters may be evaluated multiple times.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  MAJOR, MINOR, MKDEV \u2212 macros to manipulate device major\/minor numbers <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1222],"tags":[1226,1223,1238,1225],"class_list":["post-4158","post","type-post","status-publish","format-standard","hentry","category-9-rutinas-del-nucleo","tag-1226","tag-kernel","tag-major","tag-man9"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4158"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4158\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}