Hsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget9/translations/zh_CN/userspace-api/media/cec/cec-func-openmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget9/translations/zh_TW/userspace-api/media/cec/cec-func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget9/translations/it_IT/userspace-api/media/cec/cec-func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget9/translations/ja_JP/userspace-api/media/cec/cec-func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget9/translations/ko_KR/userspace-api/media/cec/cec-func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget9/translations/sp_SP/userspace-api/media/cec/cec-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:spacepreserveuh1hhhhhhS/var/lib/git/docbuild/linux/Documentation/userspace-api/media/cec/cec-func-open.rsthKubhtarget)}(h.. _cec-func-open:h]h}(h]h ]h"]h$]h&]refid cec-func-openuh1hhKhhhhhhubhsection)}(hhh](htitle)}(h cec open()h]h cec open()}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hNameh]hName}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh paragraph)}(hcec-open - Open a cec deviceh]hcec-open - Open a cec 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](singleCEC.open (C function) c.CEC.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|)}(hX``flags`` Open flags. Access mode must be ``O_RDWR``. When the ``O_NONBLOCK`` flag is given, the :ref:`CEC_RECEIVE ` and :ref:`CEC_DQEVENT ` ioctls will return the ``EAGAIN`` error code when no message or event is available, and ioctls :ref:`CEC_TRANSMIT `, :ref:`CEC_ADAP_S_PHYS_ADDR ` and :ref:`CEC_ADAP_S_LOG_ADDRS ` all return 0. 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 ``O_RDWR``.h](h Open flags. Access mode must be }(hjhhhNhNubj)}(h ``O_RDWR``h]hO_RDWR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hXkWhen the ``O_NONBLOCK`` flag is given, the :ref:`CEC_RECEIVE ` and :ref:`CEC_DQEVENT ` ioctls will return the ``EAGAIN`` error code when no message or event is available, and ioctls :ref:`CEC_TRANSMIT `, :ref:`CEC_ADAP_S_PHYS_ADDR ` and :ref:`CEC_ADAP_S_LOG_ADDRS ` all return 0.h](h When the }(hjhhhNhNubj)}(h``O_NONBLOCK``h]h O_NONBLOCK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag is given, the }(hjhhhNhNubh)}(h :ref:`CEC_RECEIVE `h]hinline)}(hjh]h CEC_RECEIVE}(hjhhhNhNubah}(h]h ](xrefstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdoc%userspace-api/media/cec/cec-func-open refdomainj$reftyperef refexplicitrefwarn reftarget cec_receiveuh1hhhhK!hjubh and }(hjhhhNhNubh)}(h :ref:`CEC_DQEVENT `h]j)}(hj>h]h CEC_DQEVENT}(hj@hhhNhNubah}(h]h ](j#stdstd-refeh"]h$]h&]uh1jhj<ubah}(h]h ]h"]h$]h&]refdocj0 refdomainjJreftyperef refexplicitrefwarnj6 cec_dqeventuh1hhhhK!hjubh ioctls will return the }(hjhhhNhNubj)}(h ``EAGAIN``h]hEAGAIN}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh> error code when no message or event is available, and ioctls }(hjhhhNhNubh)}(h":ref:`CEC_TRANSMIT `h]j)}(hjth]h CEC_TRANSMIT}(hjvhhhNhNubah}(h]h ](j#stdstd-refeh"]h$]h&]uh1jhjrubah}(h]h ]h"]h$]h&]refdocj0 refdomainjreftyperef refexplicitrefwarnj6 cec_transmituh1hhhhK!hjubh, }(hjhhhNhNubh)}(h2:ref:`CEC_ADAP_S_PHYS_ADDR `h]j)}(hjh]hCEC_ADAP_S_PHYS_ADDR}(hjhhhNhNubah}(h]h ](j#stdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj0 refdomainjreftyperef refexplicitrefwarnj6cec_adap_s_phys_addruh1hhhhK!hjubh and }(hjhhhNhNubh)}(h2:ref:`CEC_ADAP_S_LOG_ADDRS `h]j)}(hjh]hCEC_ADAP_S_LOG_ADDRS}(hjhhhNhNubah}(h]h ](j#stdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj0 refdomainjreftyperef refexplicitrefwarnj6cec_adap_s_log_addrsuh1hhhhK!hjubh all return 0.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK!hjubh)}(hOther flags have no effect.h]hOther flags have no effect.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubeh}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhK,ubh)}(hTo open a cec 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 cec device applications call }(hjhhhNhNubh)}(h:c:func:`open()`h]j)}(hj'h]hopen()}(hj)hhhNhNubah}(h]h ](j#j#c-funceh"]h$]h&]uh1jhj%ubah}(h]h ]h"]h$]h&]refdocj0 refdomainj#reftypefunc refexplicitrefwarn c:parent_keysphinx.domains.c LookupKey)}data]jD ASTIdentifier)} identifierCECsbNasbj6openuh1hhhhK.hjubhk with the desired device name. The function has no side effects; the device configuration remain unchanged.}(hjhhhNhNubeh}(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 }(hj]hhhNhNubj)}(h ``errno``h]herrno}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhj]ubh will be set to EBADF.}(hj]hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK2hj hhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhK,ubh)}(hhh](h)}(h Return Valueh]h Return Value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK7ubh)}(h:c:func:`open()` returns the new file descriptor on success. On error, -1 is returned, and ``errno`` is set appropriately. Possible error codes include:h](h)}(h:c:func:`open()`h]j)}(hjh]hopen()}(hjhhhNhNubah}(h]h ](j#j#c-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj0 refdomainj#reftypefunc refexplicitrefwarnjCjGj6openuh1hhhhK9hjubhK returns the new file descriptor on success. On error, -1 is returned, and }(hjhhhNhNubj)}(h ``errno``h]herrno}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh4 is set appropriately. Possible error codes include:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK9hjhhubjw)}(hhh](j|)}(h<``EACCES`` The requested access to the file is not allowed. h](j)}(h ``EACCES``h]j)}(hjh]hEACCES}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK>hjubj)}(hhh]h)}(h0The requested access to the file is not allowed.h]h0The requested access to the file is not allowed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhK>hjubj|)}(hE``EMFILE`` The process already has the maximum number of files open. h](j)}(h ``EMFILE``h]j)}(hjh]hEMFILE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKAhjubj)}(hhh]h)}(h9The process already has the maximum number of files open.h]h9The process already has the maximum number of files open.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhj+ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKAhjhhubj|)}(hP``ENFILE`` The system limit on the total number of open files has been reached. h](j)}(h ``ENFILE``h]j)}(hjNh]hENFILE}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjLubah}(h]h ]h"]h$]h&]uh1jhhhKDhjHubj)}(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.}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjcubah}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1j{hhhKDhjhhubj|)}(h5``ENOMEM`` Insufficient kernel memory was available. h](j)}(h ``ENOMEM``h]j)}(hjh]hENOMEM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKGhjubj)}(hhh]h)}(h)Insufficient kernel memory was available.h]h)Insufficient kernel memory was available.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKGhjhhubj|)}(h+``ENODEV`` Device not found or was removed.h](j)}(h ``ENODEV``h]j)}(hjh]hENODEV}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKIhjubj)}(hhh]h)}(h Device not found or was removed.h]h Device not found or was removed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKIhjhhubeh}(h]h ]h"]h$]h&]uh1jvhjhhhhhNubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhK7ubeh}(h](cec-openheh ]h"]( cec open() cec-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_handlerj.error_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]h3Hyperlink target "cec-func-open" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1juba transformerN include_log] decorationNhhub.