%<sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget@/translations/zh_CN/userspace-api/media/mediactl/media-func-openmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/zh_TW/userspace-api/media/mediactl/media-func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/it_IT/userspace-api/media/mediactl/media-func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/ja_JP/userspace-api/media/mediactl/media-func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/ko_KR/userspace-api/media/mediactl/media-func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/sp_SP/userspace-api/media/mediactl/media-func-openmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-laterh]h8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhZ/var/lib/git/docbuild/linux/Documentation/userspace-api/media/mediactl/media-func-open.rsthKubhtarget)}(h.. _media-func-open:h]h}(h]h ]h"]h$]h&]refidmedia-func-openuh1hhKhhhhhhubhsection)}(hhh](htitle)}(h media open()h]h media open()}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hNameh]hName}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh paragraph)}(h media-open - Open a media deviceh]h media-open - Open a media device}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubeh}(h]nameah ]h"]nameah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hSynopsish]hSynopsis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh literal_block)}(h#include h]h#include }hjsbah}(h]h ]h"]h$]h&]hhforcelanguagechighlight_args}uh1jhhhKhjhhubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleMC.open (C function) c.MC.openhNtauh1j&hjhhhNhNubhdesc)}(hhh](hdesc_signature)}(h.int open( const char *device_name, int flags )h]hdesc_signature_line)}(h,int open(const char *device_name, int flags)h](hdesc_sig_keyword_type)}(hinth]hint}(hjJhhhNhNubah}(h]h ]ktah"]h$]h&]uh1jHhjDhhhhhKubhdesc_sig_space)}(h h]h }(hj[hhhNhNubah}(h]h ]wah"]h$]h&]uh1jYhjDhhhhhKubh desc_name)}(hopenh]h desc_sig_name)}(hopenh]hopen}(hjrhhhNhNubah}(h]h ]nah"]h$]h&]uh1jphjlubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jjhjDhhhhhKubhdesc_parameterlist)}(h$(const char *device_name, int flags)h](hdesc_parameter)}(hconst char *device_nameh](hdesc_sig_keyword)}(hconsth]hconst}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubjI)}(hcharh]hchar}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubhdesc_sig_punctuation)}(h*h]h*}(hjhhhNhNubah}(h]h ]pah"]h$]h&]uh1jhjubjq)}(h device_nameh]h device_name}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(h int flagsh](jI)}(hinth]hint}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubjq)}(hflagsh]hflags}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubeh}(h]h ]h"]h$]h&]hhuh1jhjDhhhhhKubeh}(h]h ]h"]h$]h&]hh add_permalinkuh1jBsphinx_line_type declaratorhj>hhhhhKubah}(h]j5ah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1j<hhhKhj9hhubh desc_content)}(hhh]h}(h]h ]h"]h$]h&]uh1jEhj9hhhhhKubeh}(h]h ](j#functioneh"]h$]h&]domainj#objtypejSdesctypejSnoindex noindexentrynocontentsentryuh1j7hhhjhNhNubeh}(h]synopsisah ]h"]synopsisah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Argumentsh]h Arguments}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehhhhhKubhdefinition_list)}(hhh](hdefinition_list_item)}(h%``device_name`` Device to be opened. h](hterm)}(h``device_name``h]hliteral)}(hjh]h device_name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhj}ubh definition)}(hhh]h)}(hDevice to be opened.h]hDevice to be opened.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhj}ubeh}(h]h ]h"]h$]h&]uh1j{hhhKhjxubj|)}(hi``flags`` Open flags. Access mode must be either ``O_RDONLY`` or ``O_RDWR``. Other flags have no effect. h](j)}(h ``flags``h]j)}(hjh]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK hjubj)}(hhh]h)}(h^Open flags. Access mode must be either ``O_RDONLY`` or ``O_RDWR``. Other flags have no effect.h](h'Open flags. Access mode must be either }(hjhhhNhNubj)}(h ``O_RDONLY``h]hO_RDONLY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or }(hjhhhNhNubj)}(h ``O_RDWR``h]hO_RDWR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. Other flags have no effect.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhK hjxhhubeh}(h]h ]h"]h$]h&]uh1jvhjehhhhhNubeh}(h] argumentsah ]h"] argumentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Descriptionh]h Description}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj%hhhhhK#ubh)}(hTo open a media device applications call :c:func:`open()` with the desired device name. The function has no side effects; the device configuration remain unchanged.h](h)To open a media device applications call }(hj6hhhNhNubh)}(h:c:func:`open()`h]j)}(hj@h]hopen()}(hjBhhhNhNubah}(h]h ](xrefj#c-funceh"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&]refdoc,userspace-api/media/mediactl/media-func-open refdomainj#reftypefunc refexplicitrefwarn c:parent_keysphinx.domains.c LookupKey)}data]j_ ASTIdentifier)} identifierMCsbNasb reftargetopenuh1hhhhK%hj6ubhk with the desired device name. The function has no side effects; the device configuration remain unchanged.}(hj6hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK%hj%hhubh)}(hWhen the device is opened in read-only mode, attempts to modify its configuration will result in an error, and ``errno`` will be set to EBADF.h](hoWhen the device is opened in read-only mode, attempts to modify its configuration will result in an error, and }(hjyhhhNhNubj)}(h ``errno``h]herrno}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjyubh will be set to EBADF.}(hjyhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK)hj%hhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhK#ubh)}(hhh](h)}(h Return Valueh]h Return Value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK.ubh)}(h:c:func:`open()` returns the new file descriptor on success. On error, -1 is returned, and ``errno`` is set appropriately. Possible error codes are:h](h)}(h:c:func:`open()`h]j)}(hjh]hopen()}(hjhhhNhNubah}(h]h ](jLj#c-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjX refdomainj#reftypefunc refexplicitrefwarnj^jbjmopenuh1hhhhK0hjubhK returns the new file descriptor on success. On error, -1 is returned, and }(hjhhhNhNubj)}(h ``errno``h]herrno}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh0 is set appropriately. Possible error codes are:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK0hjhhubjw)}(hhh](j|)}(h8EACCES The requested access to the file is not allowed. h](j)}(hEACCESh]hEACCES}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK5hjubj)}(hhh]h)}(h0The requested access to the file is not allowed.h]h0The requested access to the file is not allowed.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhK5hjubj|)}(hAEMFILE The process already has the maximum number of files open. h](j)}(hEMFILEh]hEMFILE}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK8hj#ubj)}(hhh]h)}(h9The process already has the maximum number of files open.h]h9The process already has the maximum number of files open.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hj5ubah}(h]h ]h"]h$]h&]uh1jhj#ubeh}(h]h ]h"]h$]h&]uh1j{hhhK8hjhhubj|)}(hLENFILE The system limit on the total number of open files has been reached. h](j)}(hENFILEh]hENFILE}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK;hjRubj)}(hhh]h)}(hDThe system limit on the total number of open files has been reached.h]hDThe system limit on the total number of open files has been reached.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjdubah}(h]h ]h"]h$]h&]uh1jhjRubeh}(h]h ]h"]h$]h&]uh1j{hhhK;hjhhubj|)}(h1ENOMEM Insufficient kernel memory was available. h](j)}(hENOMEMh]hENOMEM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK>hjubj)}(hhh]h)}(h)Insufficient kernel memory was available.h]h)Insufficient kernel memory was available.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhK>hjhhubj|)}(hAENXIO No device corresponding to this device special file exists.h](j)}(hENXIOh]hENXIO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK@hjubj)}(hhh]h)}(h;No device corresponding to this device special file exists.h]h;No device corresponding to this device special file exists.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhK@hjhhubeh}(h]h ]h"]h$]h&]uh1jvhjhhhhhNubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhK.ubeh}(h]( media-openheh ]h"]( media open()media-func-openeh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}jhsexpect_referenced_by_id}hhsubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}h]hasnameids}(jhjjhhjbj_j"jjjjju nametypes}(jjhjbj"jjuh}(hhjhhhj_jj5j>jjejj%jju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h5Hyperlink target "media-func-open" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1juba transformerN include_log] decorationNhhub.