MEsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftargetA/translations/zh_CN/userspace-api/gpio/gpio-lineinfo-changed-readmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/zh_TW/userspace-api/gpio/gpio-lineinfo-changed-readmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/it_IT/userspace-api/gpio/gpio-lineinfo-changed-readmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/ja_JP/userspace-api/gpio/gpio-lineinfo-changed-readmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/ko_KR/userspace-api/gpio/gpio-lineinfo-changed-readmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/sp_SP/userspace-api/gpio/gpio-lineinfo-changed-readmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh[/var/lib/git/docbuild/linux/Documentation/userspace-api/gpio/gpio-lineinfo-changed-read.rsthKubhtarget)}(h.. _GPIO_LINEINFO_CHANGED_READ:h]h}(h]h ]h"]h$]h&]refidgpio-lineinfo-changed-readuh1hhKhhhhhhubhsection)}(hhh](htitle)}(hGPIO_LINEINFO_CHANGED_READh]hGPIO_LINEINFO_CHANGED_READ}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubhwarning)}(h[This ioctl is part of chardev_v1.rst and is obsoleted by gpio-v2-lineinfo-changed-read.rst.h]h paragraph)}(h[This ioctl is part of chardev_v1.rst and is obsoleted by gpio-v2-lineinfo-changed-read.rst.h]h[This ioctl is part of chardev_v1.rst and is obsoleted by gpio-v2-lineinfo-changed-read.rst.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hhh](h)}(hNameh]hName}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hZGPIO_LINEINFO_CHANGED_READ - Read line info change events for watched lines from the chip.h]hZGPIO_LINEINFO_CHANGED_READ - Read line info change events for watched lines from the chip.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]nameah ]h"]nameah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hSynopsish]hSynopsis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h2``int read(int chip_fd, void *buf, size_t count)``h]hliteral)}(hj-h]h.int read(int chip_fd, void *buf, size_t count)}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1j/hj+ubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]synopsisah ]h"]synopsisah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Argumentsh]h Arguments}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLhhhhhKubhdefinition_list)}(hhh](hdefinition_list_item)}(hS``chip_fd`` The file descriptor of the GPIO character device returned by `open()`. h](hterm)}(h ``chip_fd``h]j0)}(hjlh]hchip_fd}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1j/hjjubah}(h]h ]h"]h$]h&]uh1jhhhhKhjdubh definition)}(hhh]h)}(hFThe file descriptor of the GPIO character device returned by `open()`.h](h=The file descriptor of the GPIO character device returned by }(hjhhhNhNubhtitle_reference)}(h`open()`h]hopen()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjdubeh}(h]h ]h"]h$]h&]uh1jbhhhKhj_ubjc)}(hK``buf`` The buffer to contain the :c:type:`events`. h](ji)}(h``buf``h]j0)}(hjh]hbuf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j/hjubah}(h]h ]h"]h$]h&]uh1jhhhhKhjubj)}(hhh]h)}(hBThe buffer to contain the :c:type:`events`.h](hThe buffer to contain the }(hjhhhNhNubh)}(h':c:type:`events`h]j0)}(hjh]hevents}(hjhhhNhNubah}(h]h ](xrefcc-typeeh"]h$]h&]uh1j/hjubah}(h]h ]h"]h$]h&]refdoc-userspace-api/gpio/gpio-lineinfo-changed-read refdomainjreftypetype refexplicitrefwarn reftargetgpioline_info_changeduh1hhhhKhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jbhhhKhj_hhubjc)}(h``count`` The number of bytes available in ``buf``, which must be at least the size of a :c:type:`gpioline_info_changed` event. h](ji)}(h ``count``h]j0)}(hjh]hcount}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j/hjubah}(h]h ]h"]h$]h&]uh1jhhhhK#hjubj)}(hhh]h)}(huThe number of bytes available in ``buf``, which must be at least the size of a :c:type:`gpioline_info_changed` event.h](h!The number of bytes available in }(hj1hhhNhNubj0)}(h``buf``h]hbuf}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1j/hj1ubh', which must be at least the size of a }(hj1hhhNhNubh)}(h:c:type:`gpioline_info_changed`h]j0)}(hjMh]hgpioline_info_changed}(hjOhhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1j/hjKubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjgpioline_info_changeduh1hhhhK"hj1ubh event.}(hj1hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK"hj.ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jbhhhK#hj_hhubeh}(h]h ]h"]h$]h&]uh1j]hjLhhhhhNubeh}(h] argumentsah ]h"] argumentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Descriptionh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK&ubh)}(h=Read line info change events for watched lines from the chip.h]h=Read line info change events for watched lines from the chip.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjhhubhnote)}(hX(Monitoring line info changes is not generally required, and would typically only be performed by a system monitoring component. These events relate to changes in a line's request state or configuration, not its value. Use gpio-lineevent-data-read.rst to receive events when a line changes value.h](h)}(hMonitoring line info changes is not generally required, and would typically only be performed by a system monitoring component.h]hMonitoring line info changes is not generally required, and would typically only be performed by a system monitoring component.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjubh)}(hThese events relate to changes in a line's request state or configuration, not its value. Use gpio-lineevent-data-read.rst to receive events when a line changes value.h]hThese events relate to changes in a line’s request state or configuration, not its value. Use gpio-lineevent-data-read.rst to receive events when a line changes value.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(hA line must be watched using gpio-get-lineinfo-watch-ioctl.rst to generate info changed events. Subsequently, a request, release, or reconfiguration of the line will generate an info changed event.h]hA line must be watched using gpio-get-lineinfo-watch-ioctl.rst to generate info changed events. Subsequently, a request, release, or reconfiguration of the line will generate an info changed event.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjhhubh)}(hThe kernel timestamps events when they occur and stores them in a buffer from where they can be read by userspace at its convenience using `read()`.h](hThe kernel timestamps events when they occur and stores them in a buffer from where they can be read by userspace at its convenience using }(hjhhhNhNubj)}(h`read()`h]hread()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK6hjhhubh)}(hJThe size of the kernel event buffer is fixed at 32 events per ``chip_fd``.h](h>The size of the kernel event buffer is fixed at 32 events per }(hjhhhNhNubj0)}(h ``chip_fd``h]hchip_fd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j/hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK9hjhhubh)}(hThe buffer may overflow if bursts of events occur quicker than they are read by userspace. If an overflow occurs then the most recent event is discarded. Overflow cannot be detected from userspace.h]hThe buffer may overflow if bursts of events occur quicker than they are read by userspace. If an overflow occurs then the most recent event is discarded. Overflow cannot be detected from userspace.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjhhubh)}(hEvents read from the buffer are always in the same order that they were detected by the kernel, including when multiple lines are being monitored by the one ``chip_fd``.h](hEvents read from the buffer are always in the same order that they were detected by the kernel, including when multiple lines are being monitored by the one }(hj1hhhNhNubj0)}(h ``chip_fd``h]hchip_fd}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1j/hj1ubh.}(hj1hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK?hjhhubh)}(hXTo minimize the number of calls required to copy events from the kernel to userspace, `read()` supports copying multiple events. The number of events copied is the lower of the number available in the kernel buffer and the number that will fit in the userspace buffer (``buf``).h](hVTo minimize the number of calls required to copy events from the kernel to userspace, }(hjQhhhNhNubj)}(h`read()`h]hread()}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubh supports copying multiple events. The number of events copied is the lower of the number available in the kernel buffer and the number that will fit in the userspace buffer (}(hjQhhhNhNubj0)}(h``buf``h]hbuf}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1j/hjQubh).}(hjQhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKChjhhubh)}(hcA `read()` will block if no event is available and the ``chip_fd`` has not been set **O_NONBLOCK**.h](hA }(hjhhhNhNubj)}(h`read()`h]hread()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh- will block if no event is available and the }(hjhhhNhNubj0)}(h ``chip_fd``h]hchip_fd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j/hjubh has not been set }(hjhhhNhNubhstrong)}(h**O_NONBLOCK**h]h O_NONBLOCK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKHhjhhubh)}(hxThe presence of an event can be tested for by checking that the ``chip_fd`` is readable using `poll()` or an equivalent.h](h@The presence of an event can be tested for by checking that the }(hjhhhNhNubj0)}(h ``chip_fd``h]hchip_fd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j/hjubh is readable using }(hjhhhNhNubj)}(h`poll()`h]hpoll()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or an equivalent.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKKhjhhubh)}(hFirst added in 5.7.h]hFirst added in 5.7.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjhhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhK&ubh)}(hhh](h)}(h Return Valueh]h Return Value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKQubh)}(huOn success the number of bytes read, which will be a multiple of the size of a :c:type:`gpioline_info_changed` event.h](hOOn success the number of bytes read, which will be a multiple of the size of a }(hj"hhhNhNubh)}(h:c:type:`gpioline_info_changed`h]j0)}(hj,h]hgpioline_info_changed}(hj.hhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1j/hj*ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjgpioline_info_changeduh1hhhhKShj"ubh event.}(hj"hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKShjhhubh)}(hqOn error -1 and the ``errno`` variable is set appropriately. Common error codes are described in error-codes.rst.h](hOn error -1 and the }(hjShhhNhNubj0)}(h ``errno``h]herrno}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1j/hjSubhT variable is set appropriately. Common error codes are described in error-codes.rst.}(hjShhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKVhjhhubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhKQubeh}(h](hid1eh ]h"]gpio_lineinfo_changed_readah$]gpio_lineinfo_changed_readah&]uh1hhhhhhhhK referencedKexpect_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}(jhjjjIjFjjjj jxjuu nametypes}(jjjIjjjxuh}(hhj}hjhjFjjjLj jjuju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jKsRparse_messages]hsystem_message)}(hhh]h)}(h=Duplicate implicit target name: "gpio_lineinfo_changed_read".h]hADuplicate implicit target name: “gpio_lineinfo_changed_read”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]j}alevelKtypeINFOsourcehlineKuh1jhhhhhhhKubatransform_messages]j)}(hhh]h)}(hhh]h@Hyperlink target "gpio-lineinfo-changed-read" is not referenced.}hj2sbah}(h]h ]h"]h$]h&]uh1hhj/ubah}(h]h ]h"]h$]h&]levelKtypej*sourcehlineKuh1juba transformerN include_log] decorationNhhub.