1SD_BUS_IS_OPEN(3) sd_bus_is_open SD_BUS_IS_OPEN(3)
2
3
4
6 sd_bus_is_open, sd_bus_is_ready - Check whether the bus connection is
7 open or ready
8
10 #include <systemd/sd-bus.h>
11
12 int sd_bus_is_open(sd_bus *bus);
13
14 int sd_bus_is_ready(sd_bus *bus);
15
17 sd_bus_is_open() checks whether the specified bus connection is open,
18 i.e. in the process of being established, already established or in the
19 process of being torn down. It returns zero when the connection has not
20 been started yet (i.e. sd_bus_start(3) or some equivalent call has not
21 been invoked yet), or is fully terminated again (for example after
22 sd_bus_close(3)), it returns positive otherwise.
23
24 sd_bus_is_ready() checks whether the specified connection is fully
25 established, i.e. completed the connection and authentication phases of
26 the protocol and received the Hello() method call response, and is not
27 in the process of being torn down again. It returns zero outside of
28 this state, and positive otherwise. Effectively, this function returns
29 positive while regular messages can be sent or received on the
30 connection.
31
32 To be notified when the connection is fully established, use
33 sd_bus_set_connected_signal(3) and install a match for the Connected()
34 signal on the "org.freedesktop.DBus.Local" interface. To be notified
35 when the connection is torn down again, install a match for the
36 Disconnected() signal on the "org.freedesktop.DBus.Local" interface.
37
39 On success, these functions return 0 or a positive integer. On failure,
40 they return a negative errno-style error code.
41
42 Errors
43 Returned errors may indicate the following problems:
44
45 -ECHILD
46 The bus connection has been created in a different process.
47
49 These APIs are implemented as a shared library, which can be compiled
50 and linked to with the libsystemd pkg-config(1) file.
51
53 systemd(1), sd-bus(3), sd_bus_start(3), sd_bus_close(3),
54 sd_bus_set_connected_signal(3)
55
56
57
58systemd 246 SD_BUS_IS_OPEN(3)