€•*<Œ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Œ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.”…””}”(hhûhž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:”…””}”(hj hž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 uh1j%hj"ubj&)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K5uh1j%hj"ubhŒtbody”“”)”}”(hhh]”(hŒrow”“”)”}”(hhh]”(hŒentry”“”)”}”(hhh]”hÐ)”}”(hŒ DN_ACCESS”h]”hŒ DN_ACCESS”…””}”(hjJhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h KhjGubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjBubjF)”}”(hhh]”hÐ)”}”(hŒ+A file in the directory was accessed (read)”h]”hŒ+A file in the directory was accessed (read)”…””}”(hjahžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h Khj^ubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjBubeh}”(h]”h ]”h"]”h$]”h&]”uh1j@hj=ubjA)”}”(hhh]”(jF)”}”(hhh]”hÐ)”}”(hŒ DN_MODIFY”h]”hŒ DN_MODIFY”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h Khj~ubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj{ubjF)”}”(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&]”uh1jEhj{ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j@hj=ubjA)”}”(hhh]”(jF)”}”(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&]”uh1jEhj²ubjF)”}”(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&]”uh1jEhj²ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j@hj=ubjA)”}”(hhh]”(jF)”}”(hhh]”hÐ)”}”(hŒ DN_DELETE”h]”hŒ DN_DELETE”…””}”(hjïhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h Khjìubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjéubjF)”}”(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&]”uh1jEhjéubeh}”(h]”h ]”h"]”h$]”h&]”uh1j@hj=ubjA)”}”(hhh]”(jF)”}”(hhh]”hÐ)”}”(hŒ DN_RENAME”h]”hŒ DN_RENAME”…””}”(hj&hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h Khj#ubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj ubjF)”}”(hhh]”hÐ)”}”(hŒ#A file in the directory was renamed”h]”hŒ#A file in the directory was renamed”…””}”(hj=hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h Khj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j@hj=ubjA)”}”(hhh]”(jF)”}”(hhh]”hÐ)”}”(hŒ DN_ATTRIB”h]”hŒ DN_ATTRIB”…””}”(hj]hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h KhjZubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjWubjF)”}”(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)”…””}”(hjthžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h Khjqubah}”(h]”h ]”h"]”h$]”h&]”uh1jEhjWubeh}”(h]”h ]”h"]”h$]”h&]”uh1j@hj=ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j;hj"ubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1j hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubah}”(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â€.”…””}”(hjðhž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.”…””}”(hjþhž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”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjhž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.”…””}”(hj%hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h KAhjhžhubeh}”(h]”Œ configuration”ah ]”h"]”Œ configuration”ah$]”h&]”uh1h´hh¶hžhhŸh³h K?ubhµ)”}”(hhh]”(hº)”}”(hŒExample”h]”hŒExample”…””}”(hj>hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj;hž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.”…””}”(hjLhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h KFhj;hžhubeh}”(h]”Œexample”ah ]”h"]”Œexample”ah$]”h&]”uh1h´hh¶hžhhŸh³h KEubhµ)”}”(hhh]”(hº)”}”(hŒNOTE”h]”hŒNOTE”…””}”(hjehžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjbhž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.”…””}”(hjshžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h KJhjbhž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”jEŒ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‹jjj8j5j_j\j†jƒuŒ nametypes”}”(jމj‰j8‰j_‰j†‰uh}”(j‹h¶jjÑj5jj\j;jƒjbuŒ 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.