From: Daan De Meyer Date: Wed, 18 Mar 2020 18:29:57 +0000 (+0100) Subject: sd-bus: sd_bus_set/get_method_call_timeout docs + cleanups. X-Git-Tag: v246-rc1~730 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc46b9d91399aed39eb64fa07283e40eb8262078;p=thirdparty%2Fsystemd.git sd-bus: sd_bus_set/get_method_call_timeout docs + cleanups. --- diff --git a/man/rules/meson.build b/man/rules/meson.build index f9762ffb2e1..6d10df1ab1a 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -340,6 +340,10 @@ manpages = [ 'sd_bus_set_anonymous', 'sd_bus_set_trusted'], ''], + ['sd_bus_set_method_call_timeout', + '3', + ['sd_bus_get_method_call_timeout'], + ''], ['sd_bus_set_sender', '3', ['sd_bus_get_sender'], ''], ['sd_bus_set_watch_bind', '3', ['sd_bus_get_watch_bind'], ''], ['sd_bus_slot_ref', diff --git a/man/sd-bus.xml b/man/sd-bus.xml index 2f6013b7b04..9bd6dbcc66e 100644 --- a/man/sd-bus.xml +++ b/man/sd-bus.xml @@ -55,6 +55,7 @@ sd_bus_error3, sd_bus_error_add_map3, sd_bus_get_fd3, +sd_bus_get_method_call_timeout3, sd_bus_get_n_queued_read3, sd_bus_message_append3, sd_bus_message_append_array3, @@ -87,6 +88,7 @@ sd_bus_request_name3, sd_bus_set_connected_signal3, sd_bus_set_description3, +sd_bus_set_method_call_timeout3, sd_bus_set_sender3, sd_bus_set_watch_bind3 sd_bus_set_close_on_exit3 diff --git a/man/sd_bus_call.xml b/man/sd_bus_call.xml index 689f9505856..6555563793e 100644 --- a/man/sd_bus_call.xml +++ b/man/sd_bus_call.xml @@ -81,15 +81,8 @@ on the reply object returned by sd_bus_call() or passed to the callback of sd_bus_call_async(). - If usec is zero, the timeout set using - sd_bus_set_method_call_timeout3 - is used. If no method call timeout was set, the timeout is read from the - $SYSTEMD_BUS_TIMEOUT environment variable. If this environment variable is - unset or does not contain a valid timeout, the implementation falls back to a predefined method - call timeout of 25 seconds. Note that $SYSTEMD_BUS_TIMEOUT is read once and - cached so callers should not rely on being able to change the default method call timeout at - runtime by changing the value of $SYSTEMD_BUS_TIMEOUT. Instead, call - sd_bus_set_method_call_timeout() to change the default method call timeout. + If usec is zero, the default D-Bus method call timeout is used. See + sd_bus_get_method_call_timeout3. diff --git a/man/sd_bus_set_description.xml b/man/sd_bus_set_description.xml index 3c5580e27ca..bee63cb74e8 100644 --- a/man/sd_bus_set_description.xml +++ b/man/sd_bus_set_description.xml @@ -116,8 +116,8 @@ Return Value - On success, these functions return 0 or a positive integer. On failure, they return a negative - errno-style error code. + On success, these functions return a non-negative integer. On failure, they return a + negative errno-style error code. Errors diff --git a/man/sd_bus_set_method_call_timeout.xml b/man/sd_bus_set_method_call_timeout.xml new file mode 100644 index 00000000000..01857fdf20d --- /dev/null +++ b/man/sd_bus_set_method_call_timeout.xml @@ -0,0 +1,104 @@ + + + + + + + + sd_bus_set_method_call_timeout + systemd + + + + sd_bus_set_method_call_timeout + 3 + + + + sd_bus_set_method_call_timeout + sd_bus_get_method_call_timeout + + Set or query the default D-Bus method call timeout of a bus object + + + + + #include <systemd/sd-bus.h> + + + int sd_bus_set_method_call_timeout + sd_bus *bus + uint64_t usec + + + + int sd_bus_get_method_call_timeout + sd_bus *bus + uint64_t *ret + + + + + + Description + + sd_bus_set_method_call_timeout() sets the default D-Bus method call + timeout of bus to usec microseconds. + + sd_bus_get_method_call_timeout() queries the default D-Bus method + call timeout of bus. If no method call timeout was set using + sd_bus_set_method_call_timeout(), the timeout is read from the + $SYSTEMD_BUS_TIMEOUT environment variable. If this environment variable is + unset or does not contain a valid timeout, the implementation falls back to a predefined method + call timeout of 25 seconds. Note that $SYSTEMD_BUS_TIMEOUT is read once and + cached so callers should not rely on being able to change the default method call timeout at + runtime by changing the value of $SYSTEMD_BUS_TIMEOUT. Instead, call + sd_bus_set_method_call_timeout() to change the default method call timeout. + + + + + Return Value + + On success, these functions return a non-negative integer. On failure, they return a + negative errno-style error code. + + + Errors + + Returned errors may indicate the following problems: + + + + -EINVAL + + The parameters bus or ret + are NULL. + + + + -ENOPKG + + Bus object bus could not be resolved. + + + + + + + + + + + See Also + + + systemd1, + sd-bus3, + sd_bus_call3, + sd_bus_message_seal3 + + + +