From 850df10ac10aedbc2140bcd1152d6e86fdad9b48 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Jun 2015 22:18:36 +0200 Subject: man: various documentation improvements for sd-bus --- man/sd_bus_default.xml | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) (limited to 'man/sd_bus_default.xml') diff --git a/man/sd_bus_default.xml b/man/sd_bus_default.xml index fbf10d019f..9b4c71b677 100644 --- a/man/sd_bus_default.xml +++ b/man/sd_bus_default.xml @@ -109,26 +109,30 @@ Description sd_bus_default() acquires a bus - connection object to the user bus when invoked in user context or + connection object to the user bus when invoked in user context, or to the system bus otherwise. The connection object is associated to the calling thread. Each time the function is invoked from the same thread the same object is returned, but its reference count - increased by one, as long as at least one reference is kept. When - the last reference to the connection is dropped (using the - sd_bus_unref() call), the connection is - terminated. Note that the connection is not automatically - terminated when the associated thread ends. It is important to - drop the last reference to the bus connection explicitly before - the thread ends or otherwise the connection will be leaked. + is increased by one, as long as at least one reference is + kept. When the last reference to the connection is dropped (using + the + sd_bus_unref3 + call), the connection is terminated. Note that the connection is + not automatically terminated when the associated thread ends. It + is important to drop the last reference to the bus connection + explicitly before the thread ends or otherwise the connection will + be leaked. sd_bus_default_user() returns a user bus connection object associated to the calling thread. sd_bus_default_system() is similar, but - connects to the system bus. + connects to the system bus. Note that + sd_bus_default() is identical to these two + calls, depending on the execution context. sd_bus_open() creates a new, independent bus connection to the user bus when invoked in user - context or the system bus + context, or the system bus otherwise. sd_bus_open_user() is similar, but connects only to the user bus. sd_bus_open_system() does the same, but @@ -162,8 +166,10 @@ sd_bus_open_system_remote() connects to the system bus on the specified host using - SSH. host consists of an optional user name - followed by the @ symbol, and the hostname. + ssh1. host + consists of an optional user name followed by the + @ symbol, and the hostname. sd_bus_open_system_container() connects @@ -171,7 +177,18 @@ where machine is the name of a local container. See machinectl1 - for more information about "machines". + for more information about the "machine" concept. Note that + connections into local containers are only available to privileged + processes at this time. + + These calls allocate a bus connection object and initiate + the connection ot a well-known bus of some form. An alternative to + using these high-level calls is to create an unconnected bus + object with + sd_bus_new3 + and to connect it with + sd_bus_start3. + @@ -185,8 +202,8 @@ Reference ownership - The functions sd_bus_open_user(), - sd_bus_open(), + The functions sd_bus_open(), + sd_bus_open_user(), sd_bus_open_system(), sd_bus_open_system_remote(), and sd_bus_open_system_machine() return a new -- cgit v1.2.3-54-g00ecf