sd_bus_open_user, sd_bus_open_system, sd_bus_open_system_remote, sd_bus_open_system_container, sd_bus_default_user, sd_bus_default_system — Open a connection to the system or user bus
|const char *host,|
|const char *machine,|
sd_bus_open_user() creates a new bus
object and opens a connection to the user bus.
sd_bus_open_system() does the same, but
connects to the system bus.
variable is set
it will be used as the address of the user bus. This variable can
contain multiple addresses separated by "
this variable is not set, a suitable default for the default user
D-Bus instance will be used.
variable is set, it will be used as the address of the system
bus. This variable uses the same syntax as
$DBUS_SESSION_BUS_ADDRESS/. If this variable is
not set, a suitable default for the default system D-Bus instance
will be used.
sd_bus_open_system_remote() connects to
the system bus on the specified
host consists of an optional user name
followed by the "
@" symbol, and the hostname.
to the system bus in the specified
machine is the name of a container.
for more information about "machines".
sd_bus_default_user() returns a bus
object connected to the user bus. Each thread has its own object, but it
may be passed around. It is created on the first invocation of
sd_bus_default_user(), and subsequent
invocations returns a reference to the same object.
sd_bus_default_system() is similar to
sd_bus_default_user(), but connects to the
On success, these calls return 0 or a positive integer. On failure, these calls return a negative errno-style error code.
sd_bus_open_system_machine() return a new
object and the caller owns the sole reference. When not needed
anymore, this reference should be destroyed with
sd_bus_default_system() do not create a new
Returned errors may indicate the following problems:
sd_bus_open_user() and other functions
described here are available as a shared library, which can be
compiled and linked to with the