diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-11-09 00:10:58 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-11-09 13:02:13 +0100 |
commit | e67d738a8771c220a2e1ee81d5499a90589dd15d (patch) | |
tree | ed40beac18c7f439376f94bb737b04ee19f6b537 /man/sd_event_add_inotify.xml | |
parent | 53baf2efa420cab6c4b1904c9a0c46a0c4ec80a1 (diff) | |
download | systemd-e67d738a8771c220a2e1ee81d5499a90589dd15d.tar.gz |
sd-event: add sd_event_add_inotify_fd() call
sd_event_add_inotify_fd() is like sd_event_add_inotify(), but takes an
fd to an inode instead of a path, and is hence a ton nicer.
Diffstat (limited to 'man/sd_event_add_inotify.xml')
-rw-r--r-- | man/sd_event_add_inotify.xml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/man/sd_event_add_inotify.xml b/man/sd_event_add_inotify.xml index 1681143eb1..d632bf7282 100644 --- a/man/sd_event_add_inotify.xml +++ b/man/sd_event_add_inotify.xml @@ -17,6 +17,7 @@ <refnamediv> <refname>sd_event_add_inotify</refname> + <refname>sd_event_add_inotify_fd</refname> <refname>sd_event_source_get_inotify_mask</refname> <refname>sd_event_inotify_handler_t</refname> @@ -47,6 +48,16 @@ </funcprototype> <funcprototype> + <funcdef>int <function>sd_event_add_inotify_fd</function></funcdef> + <paramdef>sd_event *<parameter>event</parameter></paramdef> + <paramdef>sd_event_source **<parameter>source</parameter></paramdef> + <paramdef>int <parameter>fd</parameter></paramdef> + <paramdef>uint32_t <parameter>mask</parameter></paramdef> + <paramdef>sd_event_inotify_handler_t <parameter>handler</parameter></paramdef> + <paramdef>void *<parameter>userdata</parameter></paramdef> + </funcprototype> + + <funcprototype> <funcdef>int <function>sd_event_source_get_inotify_mask</function></funcdef> <paramdef>sd_event_source *<parameter>source</parameter></paramdef> <paramdef>uint32_t *<parameter>mask</parameter></paramdef> @@ -71,6 +82,11 @@ <citerefentry project='man-pages'><refentrytitle>inotify</refentrytitle><manvolnum>7</manvolnum></citerefentry> for further information.</para> + <para><function>sd_event_add_inotify_fd()</function> is identical to + <function>sd_event_add_inotify()</function>, except that it takes a file descriptor to an inode (possibly + an <constant>O_PATH</constant> one, but any other will do too) instead of a path in the file + system.</para> + <para>If multiple event sources are installed for the same inode the backing inotify watch descriptor is automatically shared. The mask parameter may contain any flag defined by the inotify API, with the exception of <constant>IN_MASK_ADD</constant>.</para> @@ -157,6 +173,19 @@ <listitem><para>The passed event source is not an inotify process event source.</para></listitem> </varlistentry> + <varlistentry> + <term><constant>-EBADF</constant></term> + + <listitem><para>The passed file descriptor is not valid.</para></listitem> + </varlistentry> + + <varlistentry> + <term><constant>-ENOSYS</constant></term> + + <listitem><para><function>sd_event_add_inotify_fd()</function> was called without + <filename>/proc/</filename> mounted.</para></listitem> + </varlistentry> + </variablelist> </refsect2> </refsect1> |