€•=Œ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”Œ'/translations/zh_CN/filesystems/dnotify”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/zh_TW/filesystems/dnotify”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/it_IT/filesystems/dnotify”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ja_JP/filesystems/dnotify”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ko_KR/filesystems/dnotify”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/pt_BR/filesystems/dnotify”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/sp_SP/filesystems/dnotify”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒA/var/lib/git/docbuild/linux/Documentation/filesystems/dnotify.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒLinux Directory Notification”h]”hŒLinux Directory Notification”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ block_quote”“”)”}”(hŒ(Stephen Rothwell ”h]”hŒ paragraph”“”)”}”(hŒ'Stephen Rothwell ”h]”(hŒStephen Rothwell <”…””}”(hhåh²hh³Nh´NubhŒ reference”“”)”}”(hŒsfr@canb.auug.org.au”h]”hŒsfr@canb.auug.org.au”…””}”(hhïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:sfr@canb.auug.org.au”uh1híhhåubhŒ>”…””}”(hhåh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khhßubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhä)”}”(hX=The intention of directory notification is to allow user applications to be notified when a directory, or any of the files in it, are changed. The basic mechanism involves the application registering for notification on a directory using a fcntl(2) call and the notifications themselves being delivered using signals.”h]”hX=The intention of directory notification is to allow user applications to be notified when a directory, or any of the files in it, are changed. The basic mechanism involves the application registering for notification on a directory using a fcntl(2) call and the notifications themselves being delivered using signals.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K hhÊh²hubhä)”}”(hŒgThe application decides which "events" it wants to be notified about. The currently defined events are:”h]”hŒkThe application decides which “events†it wants to be notified about. The currently defined events are:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KhhÊh²hubhÞ)”}”(hX ========= ===================================================== DN_ACCESS A file in the directory was accessed (read) DN_MODIFY A file in the directory was modified (write,truncate) DN_CREATE A file was created in the directory DN_DELETE A file was unlinked from directory DN_RENAME A file in the directory was renamed DN_ATTRIB A file in the directory had its attributes changed (chmod,chown) ========= ===================================================== ”h]”hŒtable”“”)”}”(hhh]”hŒtgroup”“”)”}”(hhh]”(hŒcolspec”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K uh1j9hj6ubj:)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K5uh1j9hj6ubhŒtbody”“”)”}”(hhh]”(hŒrow”“”)”}”(hhh]”(hŒentry”“”)”}”(hhh]”hä)”}”(hŒ DN_ACCESS”h]”hŒ DN_ACCESS”…””}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khj[ubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjVubjZ)”}”(hhh]”hä)”}”(hŒ+A file in the directory was accessed (read)”h]”hŒ+A file in the directory was accessed (read)”…””}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khjrubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjVubeh}”(h]”h ]”h"]”h$]”h&]”uh1jThjQubjU)”}”(hhh]”(jZ)”}”(hhh]”hä)”}”(hŒ DN_MODIFY”h]”hŒ DN_MODIFY”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khj’ubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjubjZ)”}”(hhh]”hä)”}”(hŒ5A file in the directory was modified (write,truncate)”h]”hŒ5A file in the directory was modified (write,truncate)”…””}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khj©ubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jThjQubjU)”}”(hhh]”(jZ)”}”(hhh]”hä)”}”(hŒ DN_CREATE”h]”hŒ DN_CREATE”…””}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KhjÉubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjÆubjZ)”}”(hhh]”hä)”}”(hŒ#A file was created in the directory”h]”hŒ#A file was created in the directory”…””}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khjàubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjÆubeh}”(h]”h ]”h"]”h$]”h&]”uh1jThjQubjU)”}”(hhh]”(jZ)”}”(hhh]”hä)”}”(hŒ DN_DELETE”h]”hŒ DN_DELETE”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjýubjZ)”}”(hhh]”hä)”}”(hŒ"A file was unlinked from directory”h]”hŒ"A file was unlinked from directory”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjýubeh}”(h]”h ]”h"]”h$]”h&]”uh1jThjQubjU)”}”(hhh]”(jZ)”}”(hhh]”hä)”}”(hŒ DN_RENAME”h]”hŒ DN_RENAME”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhj4ubjZ)”}”(hhh]”hä)”}”(hŒ#A file in the directory was renamed”h]”hŒ#A file in the directory was renamed”…””}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KhjNubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhj4ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jThjQubjU)”}”(hhh]”(jZ)”}”(hhh]”hä)”}”(hŒ DN_ATTRIB”h]”hŒ DN_ATTRIB”…””}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khjnubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjkubjZ)”}”(hhh]”hä)”}”(hŒ@A file in the directory had its attributes changed (chmod,chown)”h]”hŒ@A file in the directory had its attributes changed (chmod,chown)”…””}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khj…ubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjkubeh}”(h]”h ]”h"]”h$]”h&]”uh1jThjQubeh}”(h]”h ]”h"]”h$]”h&]”uh1jOhj6ubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1j4hj1ubah}”(h]”h ]”h"]”h$]”h&]”uh1j/hj+ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhä)”}”(hŒÎUsually, the application must reregister after each notification, but if DN_MULTISHOT is or'ed with the event mask, then the registration will remain until explicitly removed (by registering for no events).”h]”hŒÐUsually, the application must reregister after each notification, but if DN_MULTISHOT is or’ed with the event mask, then the registration will remain until explicitly removed (by registering for no events).”…””}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KhhÊh²hubhä)”}”(hXoBy default, SIGIO will be delivered to the process and no other useful information. However, if the F_SETSIG fcntl(2) call is used to let the kernel know which signal to deliver, a siginfo structure will be passed to the signal handler and the si_fd member of that structure will contain the file descriptor associated with the directory in which the event occurred.”h]”hXoBy default, SIGIO will be delivered to the process and no other useful information. However, if the F_SETSIG fcntl(2) call is used to let the kernel know which signal to deliver, a siginfo structure will be passed to the signal handler and the si_fd member of that structure will contain the file descriptor associated with the directory in which the event occurred.”…””}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K hhÊh²hubhä)”}”(hXPreferably the application will choose one of the real time signals (SIGRTMIN + ) so that the notifications may be queued. This is especially important if DN_MULTISHOT is specified. Note that SIGRTMIN is often blocked, so it is better to use (at least) SIGRTMIN + 1.”h]”hXPreferably the application will choose one of the real time signals (SIGRTMIN + ) so that the notifications may be queued. This is especially important if DN_MULTISHOT is specified. Note that SIGRTMIN is often blocked, so it is better to use (at least) SIGRTMIN + 1.”…””}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K&hhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ3Implementation expectations (features and bugs :-))”h]”hŒ3Implementation expectations (features and bugs :-))”…””}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjåh²hh³hÇh´K,ubhä)”}”(hX'The notification should work for any local access to files even if the actual file system is on a remote server. This implies that remote access to files served by local user mode servers should be notified. Also, remote accesses to files served by a local kernel NFS server should be notified.”h]”hX'The notification should work for any local access to files even if the actual file system is on a remote server. This implies that remote access to files served by local user mode servers should be notified. Also, remote accesses to files served by a local kernel NFS server should be notified.”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K.hjåh²hubhä)”}”(hXwIn order to make the impact on the file system code as small as possible, the problem of hard links to files has been ignored. So if a file (x) exists in two directories (a and b) then a change to the file using the name "a/x" should be notified to a program expecting notifications on directory "a", but will not be notified to one expecting notifications on directory "b".”h]”hXƒIn order to make the impact on the file system code as small as possible, the problem of hard links to files has been ignored. So if a file (x) exists in two directories (a and b) then a change to the file using the name “a/x†should be notified to a program expecting notifications on directory “aâ€, but will not be notified to one expecting notifications on directory “bâ€.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K4hjåh²hubhä)”}”(hŒmAlso, files that are unlinked, will still cause notifications in the last directory that they were linked to.”h]”hŒmAlso, files that are unlinked, will still cause notifications in the last directory that they were linked to.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K;hjåh²hubeh}”(h]”Œ-implementation-expectations-features-and-bugs”ah ]”h"]”Œ3implementation expectations (features and bugs :-))”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K,ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ Configuration”h]”hŒ Configuration”…””}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj(h²hh³hÇh´K?ubhä)”}”(hŒ€Dnotify is controlled via the CONFIG_DNOTIFY configuration option. When disabled, fcntl(fd, F_NOTIFY, ...) will return -EINVAL.”h]”hŒ€Dnotify is controlled via the CONFIG_DNOTIFY configuration option. When disabled, fcntl(fd, F_NOTIFY, ...) will return -EINVAL.”…””}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KAhj(h²hubeh}”(h]”Œ configuration”ah ]”h"]”Œ configuration”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K?ubhÉ)”}”(hhh]”(hÎ)”}”(hŒExample”h]”hŒExample”…””}”(hjRh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjOh²hh³hÇh´KEubhä)”}”(hŒFSee tools/testing/selftests/filesystems/dnotify_test.c for an example.”h]”hŒFSee tools/testing/selftests/filesystems/dnotify_test.c for an example.”…””}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KFhjOh²hubeh}”(h]”Œexample”ah ]”h"]”Œexample”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KEubhÉ)”}”(hhh]”(hÎ)”}”(hŒNOTE”h]”hŒNOTE”…””}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjvh²hh³hÇh´KIubhä)”}”(hŒˆBeginning with Linux 2.6.13, dnotify has been replaced by inotify. See Documentation/filesystems/inotify.rst for more information on it.”h]”hŒˆBeginning with Linux 2.6.13, dnotify has been replaced by inotify. See Documentation/filesystems/inotify.rst for more information on it.”…””}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KJhjvh²hubeh}”(h]”Œnote”ah ]”h"]”Œnote”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KIubeh}”(h]”Œlinux-directory-notification”ah ]”h"]”Œlinux directory notification”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”jYŒ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Ÿj%j"jLjIjsjpjšj—uŒ nametypes”}”(j¢‰j%‰jL‰js‰jš‰uh}”(jŸhÊj"jåjIj(jpjOj—jvuŒ 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.