diff --git a/man/rules/meson.build b/man/rules/meson.build
index 659edab1ab..7b5b13b176 100644
--- a/man/rules/meson.build
+++ b/man/rules/meson.build
@@ -388,6 +388,7 @@ manpages = [
'sd_bus_set_anonymous',
'sd_bus_set_trusted'],
''],
+ ['sd_bus_set_exit_on_disconnect', '3', ['sd_bus_get_exit_on_disconnect'], ''],
['sd_bus_set_method_call_timeout',
'3',
['sd_bus_get_method_call_timeout'],
diff --git a/man/sd-bus.xml b/man/sd-bus.xml
index c073d3bccc..9918e0c737 100644
--- a/man/sd-bus.xml
+++ b/man/sd-bus.xml
@@ -77,6 +77,7 @@
sd_bus_get_current_message3,
sd_bus_get_current_slot3,
sd_bus_get_current_userdata3,
+sd_bus_get_exit_on_disconnect3,
sd_bus_get_fd3,
sd_bus_get_method_call_timeout3,
sd_bus_get_n_queued_read3,
@@ -124,16 +125,17 @@
sd_bus_request_name3,
sd_bus_send3,
sd_bus_set_address3,
+sd_bus_set_bus_client3,
+sd_bus_set_close_on_exit3,
sd_bus_set_connected_signal3,
sd_bus_set_description3,
+sd_bus_set_exit_on_disconnect3,
sd_bus_set_method_call_timeout3,
sd_bus_set_property3,
sd_bus_set_propertyv3,
sd_bus_set_sender3,
-sd_bus_set_bus_client3,
sd_bus_set_server3,
sd_bus_set_watch_bind3
-sd_bus_set_close_on_exit3,
sd_bus_slot_get_current_handler3,
sd_bus_slot_get_current_message3,
sd_bus_slot_get_current_userdata3,
diff --git a/man/sd_bus_set_close_on_exit.xml b/man/sd_bus_set_close_on_exit.xml
index 751fc0a729..64ca356443 100644
--- a/man/sd_bus_set_close_on_exit.xml
+++ b/man/sd_bus_set_close_on_exit.xml
@@ -20,7 +20,8 @@
sd_bus_set_close_on_exit
sd_bus_get_close_on_exit
- Control whether to close the bus connection during the event loop exit phase
+ Control whether to close the bus connection during the event loop exit phase
+
@@ -44,30 +45,35 @@
Description
- sd_bus_set_close_on_exit() may be used to enable or disable whether the bus connection
- is automatically flushed (as in
- sd_bus_flush3) and closed (as in
- sd_bus_close3) during the exit
- phase of the event loop. This logic only applies to bus connections that are attached to an
- sd-event3 event loop, see
- sd_bus_attach_event3. By default
- this mechanism is enabled and makes sure that any pending messages that have not been written to the bus connection
- are written out when the event loop is shutting down. In some cases this behaviour is not desirable, for example
- when the bus connection shall remain usable until after the event loop exited. If b is
- true, the feature is enabled (which is the default), otherwise disabled.
+ sd_bus_set_close_on_exit() may be used to enable or disable whether
+ the bus connection is automatically flushed (as in
+ sd_bus_flush3)
+ and closed (as in
+ sd_bus_close3)
+ during the exit phase of the event loop. This logic only applies to bus connections that are
+ attached to an
+ sd-event3
+ event loop, see
+ sd_bus_attach_event3.
+ By default this mechanism is enabled and makes sure that any pending messages that have not been
+ written to the bus connection are written out when the event loop is shutting down. In some
+ cases this behaviour is not desirable, for example when the bus connection shall remain usable
+ until after the event loop exited. If b is true, the feature is enabled
+ (which is the default), otherwise disabled.
- sd_bus_get_close_on_exit() may be used to query the current setting of this feature. It
- returns zero when the feature is disabled, and positive if enabled.
+ sd_bus_get_close_on_exit() may be used to query the current setting
+ of this feature. It returns zero when the feature is disabled, and positive if enabled.
Return Value
- On success, sd_bus_set_close_on_exit() returns 0 or a positive integer. On failure, it returns a negative errno-style
- error code.
+ On success, sd_bus_set_close_on_exit() returns a non-negative
+ integer. On failure, it returns a negative errno-style error code.
- sd_bus_get_close_on_exit() returns 0 if the feature is currently turned off or a
- positive integer if it is on. On failure, it returns a negative errno-style error code.
+ sd_bus_get_close_on_exit() returns 0 if the feature is currently
+ disabled or a positive integer if it is enabled. On failure, it returns a negative errno-style
+ error code.
Errors
@@ -78,7 +84,8 @@
-ECHILD
- The bus connection has been created in a different process.
+ The bus connection was created in a different process.
+
@@ -98,5 +105,4 @@
sd_event_add_exit3
-
diff --git a/man/sd_bus_set_exit_on_disconnect.xml b/man/sd_bus_set_exit_on_disconnect.xml
new file mode 100644
index 0000000000..8bd904ba40
--- /dev/null
+++ b/man/sd_bus_set_exit_on_disconnect.xml
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+ sd_bus_set_exit_on_disconnect
+ systemd
+
+
+
+ sd_bus_set_exit_on_disconnect
+ 3
+
+
+
+ sd_bus_set_exit_on_disconnect
+ sd_bus_get_exit_on_disconnect
+
+ Control the exit behavior when the bus object disconnects
+
+
+
+
+ #include <systemd/sd-bus.h>
+
+
+ int sd_bus_set_exit_on_disconnect
+ sd_bus *bus
+ int b
+
+
+
+ int sd_bus_get_exit_on_disconnect
+ sd_bus *bus
+
+
+
+
+
+ Description
+
+ sd_bus_set_exit_on_disconnect() may be used to configure the exit
+ behavior when the given bus object disconnects. If b is zero, no special
+ logic is executed when the bus object disconnects. If b is non-zero, the
+ behavior on disconnect depends on whether the bus object is attached to an event loop or not. If
+ the bus object is attached to an event loop (see
+ sd_bus_attach_event3),
+ the event loop is closed when the bus object disconnects (as if calling
+ sd_event_exit3).
+ Otherwise,
+ exit3
+ is called. The exit code passed to sd_event_exit() and
+ exit() is EXIT_FAILURE. If the bus object has already
+ disconnected when enabling the exit behavior, the exit behavior is executed immediately. By
+ default, the exit behavior is disabled.
+
+ sd_bus_get_exit_on_disconnect() returns whether the exit on
+ disconnect behavior is enabled for the given bus object.
+
+
+
+ Return Value
+
+ On success, sd_bus_set_exit_on_disconnect() returns a non-negative
+ integer. On failure, it returns a negative errno-style error code.
+
+ sd_bus_get_exit_on_disconnect() returns a positive integer if the
+ exit on disconnect behavior is enabled. Otherwise, it returns zero.
+
+
+ Errors
+
+ Returned errors may indicate the following problems:
+
+
+
+ -EINVAL
+
+ A required parameter was NULL.
+
+
+
+ -ENOPKG
+
+ The bus object could not be resolved.
+
+
+
+ -ECHILD
+
+ The bus connection was created in a different process.
+
+
+
+
+
+
+
+
+ See Also
+
+
+ systemd1,
+ sd-bus3,
+ sd_bus_attach_event3,
+ sd-event3,
+ sd_event_exit3
+
+
+
diff --git a/man/sd_bus_set_server.xml b/man/sd_bus_set_server.xml
index 228dc806e4..6b93b92594 100644
--- a/man/sd_bus_set_server.xml
+++ b/man/sd_bus_set_server.xml
@@ -110,7 +110,8 @@
a non-negative integer. On failure, they return a negative errno-style error code.
sd_bus_is_server() and sd_bus_is_bus_client()
- return 1 when the server or client mode is enabled, respectively. Otherwise, they return 0.
+ return a positive integer when the server or client mode is enabled, respectively. Otherwise,
+ they return zero.