summaryrefslogtreecommitdiff
path: root/man/sd_event_add_inotify.xml
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-10-02 09:51:36 +0200
committerLennart Poettering <lennart@poettering.net>2020-10-07 09:40:16 +0200
commitb9350e70aa050d97c47ff59994e84fa8c3de4738 (patch)
tree467bb5ba1acd7393c22cab9c002955d560b5a9b3 /man/sd_event_add_inotify.xml
parentbac0bfc1d0ee1e57055dffb78c77a1ee021ce536 (diff)
downloadsystemd-b9350e70aa050d97c47ff59994e84fa8c3de4738.tar.gz
sd-event: support callback=NULL in IO/child/inotify/defer event sources, too
Also, document this functionality more prominently, including with a reference from sd_event_exit(). This is mostly to make things complete, as previously we supported NULL callbacks only in _add_time() and _add_signal(). However, I think this makes snese for IO event sources too (think: when some fd such as a pipe end sees SIGHUP or so, exit), as well as defer or post event sources (i.e. exit once we got nothing else to do). This also adds support for inotify event sources, simply to complete things (I can't see the immediate use, but maybe someone else comes up with it). The only event source type that doesn't allow callback=NULL now are exit callbacks, but for them they make little sense, as the event loop is exiting then anyway.
Diffstat (limited to 'man/sd_event_add_inotify.xml')
-rw-r--r--man/sd_event_add_inotify.xml13
1 files changed, 10 insertions, 3 deletions
diff --git a/man/sd_event_add_inotify.xml b/man/sd_event_add_inotify.xml
index 826f4c4ada..27d43853e6 100644
--- a/man/sd_event_add_inotify.xml
+++ b/man/sd_event_add_inotify.xml
@@ -95,9 +95,16 @@
it with
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
- <para>If the second parameter of <function>sd_event_add_inotify()</function> is passed as NULL no reference to the
- event source object is returned. In this case the event source is considered "floating", and will be destroyed
- implicitly when the event loop itself is destroyed.</para>
+ <para>If the second parameter of <function>sd_event_add_inotify()</function> is passed as
+ <constant>NULL</constant> no reference to the event source object is returned. In this case the event
+ source is considered "floating", and will be destroyed implicitly when the event loop itself is
+ destroyed.</para>
+
+ <para>If the <parameter>handler</parameter> parameter to <function>sd_event_add_inotify()</function> is
+ <constant>NULL</constant>, and the event source fires, this will be considered a request to exit the
+ event loop. In this case, the <parameter>userdata</parameter> parameter, cast to an integer, is passed as
+ the exit code parameter to
+ <citerefentry><refentrytitle>sd_event_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para><function>sd_event_source_get_inotify_mask()</function> retrieves the configured inotify watch mask of an
event source created previously with <function>sd_event_add_inotify()</function>. It takes the event source object