]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_bus_list_names.xml
man: use same version in public and system ident.
[thirdparty/systemd.git] / man / sd_bus_list_names.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="sd_bus_list_names"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>sd_bus_list_names</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>sd_bus_list_names</refentrytitle>
16 <manvolnum>3</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>sd_bus_list_names</refname>
21
22 <refpurpose>Retrieve information about registered names on a bus</refpurpose>
23 </refnamediv>
24
25 <refsynopsisdiv>
26 <funcsynopsis>
27 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
28
29 <funcprototype>
30 <funcdef>int <function>sd_bus_list_names</function></funcdef>
31 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
32 <paramdef>char ***<parameter>acquired</parameter></paramdef>
33 <paramdef>char ***<parameter>activatable</parameter></paramdef>
34 </funcprototype>
35 </funcsynopsis>
36 </refsynopsisdiv>
37
38 <refsect1>
39 <title>Description</title>
40
41 <para><function>sd_bus_list_names()</function> retrieves information about the registered names on a bus.
42 If <parameter>acquired</parameter> is not <constant>NULL</constant>, this function calls
43 <ulink url="https://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-list-names">
44 org.freedesktop.DBus.ListNames</ulink> to retrieve the list of currently-owned names on the bus. If
45 <parameter>acquired</parameter> is not <constant>NULL</constant>, the function calls
46 <ulink url="https://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-list-activatable-names">
47 org.freedesktop.DBus.ListActivableNames</ulink> to retrieve the list of all names on the bus that can be
48 activated. Note that ownership of the arrays returned by <function>sd_bus_list_names()</function> in
49 <parameter>acquired</parameter> and <parameter>activatable</parameter> is transferred to the caller and
50 hence, the caller is responsible for freeing these arrays and their contents.</para>
51 </refsect1>
52
53 <refsect1>
54 <title>Return Value</title>
55
56 <para>On success, <function>sd_bus_list_names()</function> returns a non-negative integer. On failure,
57 it returns a negative errno-style error code.</para>
58
59 <refsect2>
60 <title>Errors</title>
61
62 <para>Returned errors may indicate the following problems:</para>
63
64 <variablelist>
65 <varlistentry>
66 <term><constant>-EINVAL</constant></term>
67
68 <listitem><para><parameter>bus</parameter> or both <parameter>acquired</parameter> and
69 <parameter>activatable</parameter> were <constant>NULL</constant>.
70 </para>
71
72 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
73 </varlistentry>
74
75 <varlistentry>
76 <term><constant>-ENOPKG</constant></term>
77
78 <listitem><para>The bus cannot be resolved.</para>
79
80 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
81 </varlistentry>
82
83 <varlistentry>
84 <term><constant>-ECHILD</constant></term>
85
86 <listitem><para>The bus was created in a different process, library or module instance.</para>
87
88 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
89 </varlistentry>
90
91 <varlistentry>
92 <term><constant>-ENOMEM</constant></term>
93
94 <listitem><para>Memory allocation failed.</para>
95
96 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
97 </varlistentry>
98
99 <varlistentry>
100 <term><constant>-ENOTCONN</constant></term>
101
102 <listitem><para>The bus is not connected.</para>
103
104 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
105 </varlistentry>
106 </variablelist>
107 </refsect2>
108 </refsect1>
109
110 <xi:include href="libsystemd-pkgconfig.xml" />
111
112 <refsect1>
113 <title>History</title>
114 <para><function>sd_bus_list_names()</function> was added in version 246.</para>
115 </refsect1>
116
117 <refsect1>
118 <title>See Also</title>
119
120 <para><simplelist type="inline">
121 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
122 <member><citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
123 </simplelist></para>
124 </refsect1>
125 </refentry>