€• Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ6/translations/zh_CN/userspace-api/ioctl/ioctl-decoding”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ6/translations/zh_TW/userspace-api/ioctl/ioctl-decoding”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ6/translations/it_IT/userspace-api/ioctl/ioctl-decoding”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ6/translations/ja_JP/userspace-api/ioctl/ioctl-decoding”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ6/translations/ko_KR/userspace-api/ioctl/ioctl-decoding”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ6/translations/sp_SP/userspace-api/ioctl/ioctl-decoding”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒDecoding an IOCTL Magic Number”h]”hŒDecoding an IOCTL Magic Number”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒP/var/lib/git/docbuild/linux/Documentation/userspace-api/ioctl/ioctl-decoding.rst”h KubhŒ paragraph”“”)”}”(hŒTo decode a hex IOCTL code:”h]”hŒTo decode a hex IOCTL code:”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hŒMost architectures use this generic format, but check include/ARCH/ioctl.h for specifics, e.g. powerpc uses 3 bits to encode read/write and 13 bits for size.”h]”hŒMost architectures use this generic format, but check include/ARCH/ioctl.h for specifics, e.g. powerpc uses 3 bits to encode read/write and 13 bits for size.”…””}”(hhÇhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubhŒ block_quote”“”)”}”(hXr====== ================================== bits meaning ====== ================================== 31-30 00 - no parameters: uses _IO macro 10 - read: _IOR 01 - write: _IOW 11 - read/write: _IOWR 29-16 size of arguments 15-8 ascii character supposedly unique to each driver 7-0 function # ====== ================================== ”h]”hŒtable”“”)”}”(hhh]”hŒtgroup”“”)”}”(hhh]”(hŒcolspec”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1håhhâubhæ)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K"uh1håhhâubhŒthead”“”)”}”(hhh]”hŒrow”“”)”}”(hhh]”(hŒentry”“”)”}”(hhh]”h¸)”}”(hŒbits”h]”hŒbits”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)”}”(hhh]”h¸)”}”(hŒmeaning”h]”hŒmeaning”…””}”(hj!hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhhýubah}”(h]”h ]”h"]”h$]”h&]”uh1hûhhâubhŒtbody”“”)”}”(hhh]”(j)”}”(hhh]”(j)”}”(hhh]”h¸)”}”(hŒ31-30”h]”hŒ31-30”…””}”(hjLhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhjIubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjFubj)”}”(hhh]”h¸)”}”(hŒZ00 - no parameters: uses _IO macro 10 - read: _IOR 01 - write: _IOW 11 - read/write: _IOWR”h]”hŒZ00 - no parameters: uses _IO macro 10 - read: _IOR 01 - write: _IOW 11 - read/write: _IOWR”…””}”(hjchžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khj`ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjFubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjCubj)”}”(hhh]”(j)”}”(hhh]”h¸)”}”(hŒ29-16”h]”hŒ29-16”…””}”(hjƒhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khj€ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj}ubj)”}”(hhh]”h¸)”}”(hŒsize of arguments”h]”hŒsize of arguments”…””}”(hjšhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj}ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjCubj)”}”(hhh]”(j)”}”(hhh]”h¸)”}”(hŒ15-8”h]”hŒ15-8”…””}”(hjºhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khj·ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj´ubj)”}”(hhh]”h¸)”}”(hŒ0ascii character supposedly unique to each driver”h]”hŒ0ascii character supposedly unique to each driver”…””}”(hjÑhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhjÎubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj´ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjCubj)”}”(hhh]”(j)”}”(hhh]”h¸)”}”(hŒ7-0”h]”hŒ7-0”…””}”(hjñhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khjîubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjëubj)”}”(hhh]”h¸)”}”(hŒ function #”h]”hŒ function #”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjëubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjCubeh}”(h]”h ]”h"]”h$]”h&]”uh1jAhhâubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1hàhhÝubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhh×ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÕhŸh¶h K hh£hžhubh¸)”}”(hŒ}So for example 0x82187201 is a read with arg length of 0x218, character 'r' function 1. Grepping the source reveals this is::”h]”hŒ€So for example 0x82187201 is a read with arg length of 0x218, character ‘r’ function 1. Grepping the source reveals this is:”…””}”(hj;hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubhŒ literal_block”“”)”}”(hŒG#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2])”h]”hŒG#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2])”…””}”hjKsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jIhŸh¶h Khh£hžhubeh}”(h]”Œdecoding-an-ioctl-magic-number”ah ]”h"]”Œdecoding an ioctl magic number”ah$]”h&]”uh1h¡hhhžhhŸh¶h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h¶uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¦NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”jŒfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j…Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h¶Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”j`j]sŒ nametypes”}”j`‰sh}”j]h£sŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.