From 4dfefc1914bad6a025e2d6738999e45b74715002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 25 Sep 2014 17:27:40 -0400 Subject: [PATCH] man: document sd_event_add_{defer,post,exit} --- Makefile-man.am | 12 +++ man/sd_event_add_child.xml | 1 + man/sd_event_add_defer.xml | 191 ++++++++++++++++++++++++++++++++++++++++++++ man/sd_event_add_signal.xml | 1 + man/sd_event_add_time.xml | 1 + 5 files changed, 206 insertions(+) create mode 100644 man/sd_event_add_defer.xml diff --git a/Makefile-man.am b/Makefile-man.am index 53e2f2cf17..bd5306e676 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -742,6 +742,7 @@ MANPAGES += \ man/sd_bus_path_encode.3 \ man/sd_bus_request_name.3 \ man/sd_event_add_child.3 \ + man/sd_event_add_defer.3 \ man/sd_event_add_signal.3 \ man/sd_event_add_time.3 \ man/sd_event_new.3 \ @@ -802,6 +803,8 @@ MANPAGES_ALIAS += \ man/sd_bus_ref.3 \ man/sd_bus_release_name.3 \ man/sd_bus_unref.3 \ + man/sd_event_add_exit.3 \ + man/sd_event_add_post.3 \ man/sd_event_default.3 \ man/sd_event_ref.3 \ man/sd_event_source_get_child_pid.3 \ @@ -867,6 +870,8 @@ man/sd_bus_path_decode.3: man/sd_bus_path_encode.3 man/sd_bus_ref.3: man/sd_bus_new.3 man/sd_bus_release_name.3: man/sd_bus_request_name.3 man/sd_bus_unref.3: man/sd_bus_new.3 +man/sd_event_add_exit.3: man/sd_event_add_defer.3 +man/sd_event_add_post.3: man/sd_event_add_defer.3 man/sd_event_default.3: man/sd_event_new.3 man/sd_event_ref.3: man/sd_event_new.3 man/sd_event_source_get_child_pid.3: man/sd_event_add_child.3 @@ -1040,6 +1045,12 @@ man/sd_bus_release_name.html: man/sd_bus_request_name.html man/sd_bus_unref.html: man/sd_bus_new.html $(html-alias) +man/sd_event_add_exit.html: man/sd_event_add_defer.html + $(html-alias) + +man/sd_event_add_post.html: man/sd_event_add_defer.html + $(html-alias) + man/sd_event_default.html: man/sd_event_new.html $(html-alias) @@ -1555,6 +1566,7 @@ EXTRA_DIST += \ man/sd_bus_path_encode.xml \ man/sd_bus_request_name.xml \ man/sd_event_add_child.xml \ + man/sd_event_add_defer.xml \ man/sd_event_add_signal.xml \ man/sd_event_add_time.xml \ man/sd_event_new.xml \ diff --git a/man/sd_event_add_child.xml b/man/sd_event_add_child.xml index a3b4d85ac8..f282a5094a 100644 --- a/man/sd_event_add_child.xml +++ b/man/sd_event_add_child.xml @@ -198,6 +198,7 @@ along with systemd; If not, see . sd_event_new3, sd_event_add_time3, sd_event_add_signal3, + sd_event_add_defer3, sd_event_source_set_enabled3 diff --git a/man/sd_event_add_defer.xml b/man/sd_event_add_defer.xml new file mode 100644 index 0000000000..6c937098b2 --- /dev/null +++ b/man/sd_event_add_defer.xml @@ -0,0 +1,191 @@ + + + + + + + + + sd_event_add_defer + systemd + + + + More text + Zbigniew + Jędrzejewski-Szmek + zbyszek@in.waw.pl + + + + + + sd_event_add_defer + 3 + + + + sd_event_add_defer + sd_event_add_post + sd_event_add_exit + + Add static event sources to an event loop + + + + + #include <systemd/sd-bus.h> + + + int sd_event_add_defer + sd_event *event + sd_event_source **source + sd_event_handler_t handler + void *userdata + + + + int sd_event_add_post + sd_event *event + sd_event_source **source + sd_event_handler_t handler + void *userdata + + + + int sd_event_add_exit + sd_event *event + sd_event_source **source + sd_event_handler_t handler + void *userdata + + + + typedef int (*sd_event_handler_t) + sd_event_source *s + void *userdata + + + + + + + Description + + Those three functions add new event sources to an event loop + object. The event loop is specified in + event, the event source is returned in the + source parameter. The event sources are + enabled statically and will "fire" when the event loop is run and + the conditions described below are met. The handler function will + be passed the userdata pointer, which may + be chosen freely by the caller. + + sd_event_add_defer() adds a new event + source that will "fire" the next time the event loop is run. By + default, the handler will be called once + (SD_EVENT_ONESHOT). + + sd_event_add_defer() adds a new event + source that will "fire" if any event handlers are invoked whenever + the event loop is run. By default, the source is enabled + permanently (SD_EVENT_ON). + + sd_event_add_exit() adds a new event + source that will "fire" when the event loop is terminated + with sd_event_exit(). + + The + sd_event_source_set_enabled3 + function may be used to enable the event source permanently + (SD_EVENT_ON) or to make it fire just once + (SD_EVENT_ONESHOT). If the handler function + returns a negative error code, it will be disabled after the + invocation, even if SD_EVENT_ON mode is + set. + + + + Return Value + + On success, this functions return 0 or a positive + integer. On failure, they return a negative errno-style error + code. + + + + Errors + + Returned errors may indicate the following problems: + + + + -ENOMEM + + Not enough memory to allocate an object. + + + + -EINVAL + + An invalid argument has been passed. + + + + -ESTALE + + The event loop is already terminated. + + + + -ECHILD + + The event loop has been created in a different process. + + + + + + + Notes + + Functions described here are available as a shared library, + which can be compiled and linked to with the + libsystemd pkg-config1 + file. + + + + See Also + + + systemd1, + sd-event3, + sd_event_new3, + sd_event_add_time3, + sd_event_add_signal3, + sd_event_add_child3, + sd_event_source_set_enabled3 + + + + diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml index 2b656b67a2..1517c1021c 100644 --- a/man/sd_event_add_signal.xml +++ b/man/sd_event_add_signal.xml @@ -190,6 +190,7 @@ along with systemd; If not, see . sd_event_new3, sd_event_add_time3, sd_event_add_child3, + sd_event_add_defer3, sd_event_source_set_enabled3 diff --git a/man/sd_event_add_time.xml b/man/sd_event_add_time.xml index e64ed8e207..f16b84f605 100644 --- a/man/sd_event_add_time.xml +++ b/man/sd_event_add_time.xml @@ -250,6 +250,7 @@ along with systemd; If not, see . sd_event_new3, sd_event_add_signal3, sd_event_add_child3, + sd_event_add_defer3, clock_gettime2, sd_event_source_set_enabled3