]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_bus_is_open.xml
travis: add more ASan options
[thirdparty/systemd.git] / man / sd_bus_is_open.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
5
6 <refentry id="sd_bus_is_open"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>sd_bus_is_open</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>sd_bus_is_open</refentrytitle>
16 <manvolnum>3</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>sd_bus_is_open</refname>
21 <refname>sd_bus_is_ready</refname>
22
23 <refpurpose>Check whether the a bus connection is open or ready.</refpurpose>
24 </refnamediv>
25
26 <refsynopsisdiv>
27 <funcsynopsis>
28 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
29
30 <funcprototype>
31 <funcdef>int <function>sd_bus_is_open</function></funcdef>
32 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
33 </funcprototype>
34
35 <funcprototype>
36 <funcdef>int <function>sd_bus_is_ready</function></funcdef>
37 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
38 </funcprototype>
39
40 </funcsynopsis>
41 </refsynopsisdiv>
42
43 <refsect1>
44 <title>Description</title>
45
46 <para><function>sd_bus_is_open()</function> checks whether the specified bus connection is open, i.e. in the
47 process of being established, already established or in the process of being torn down. It returns zero when the
48 connection has not been started yet
49 (i.e. <citerefentry><refentrytitle>sd_bus_start</refentrytitle><manvolnum>3</manvolnum></citerefentry> or some
50 equivalent call has not been invoked yet), or is fully terminated again (for example after
51 <citerefentry><refentrytitle>sd_bus_close</refentrytitle><manvolnum>3</manvolnum></citerefentry>), it returns
52 positive otherwise.</para>
53
54 <para><function>sd_bus_is_ready()</function> checks whether the specified connection is fully established,
55 i.e. completed the connection and authentication phases of the protocol and received the
56 <function>Hello()</function> method call response, and is not in the process of being torn down again. It returns
57 zero outside of this state, and positive otherwise. Effectively, this function returns positive while regular
58 messages can be sent or received on the connection.</para>
59
60 <para>To be notified when the connection is fully established, use
61 <citerefentry><refentrytitle>sd_bus_set_connected_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry> and
62 install a match for the <function>Connected()</function> signal on the
63 <literal>org.freedesktop.DBus.Local</literal> interface. To be notified when the connection is torn down again,
64 install a match for the <function>Disconnected()</function> signal on the
65 <literal>org.freedesktop.DBus.Local</literal> interface.</para>
66 </refsect1>
67
68 <refsect1>
69 <title>Return Value</title>
70
71 <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style
72 error code.</para>
73
74 <refsect2>
75 <title>Errors</title>
76
77 <para>Returned errors may indicate the following problems:</para>
78
79 <variablelist>
80 <varlistentry>
81 <term><constant>-ECHILD</constant></term>
82
83 <listitem><para>The bus connection has been created in a different process.</para></listitem>
84 </varlistentry>
85 </variablelist>
86 </refsect2>
87 </refsect1>
88
89 <xi:include href="libsystemd-pkgconfig.xml" />
90
91 <refsect1>
92 <title>See Also</title>
93
94 <para>
95 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
96 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
97 <citerefentry><refentrytitle>sd_bus_start</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
98 <citerefentry><refentrytitle>sd_bus_close</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
99 <citerefentry><refentrytitle>sd_bus_set_connected_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>
100 </para>
101 </refsect1>
102
103 </refentry>