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.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
6 <refentry id=
"sd_bus_list_names"
7 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
10 <title>sd_bus_list_names
</title>
11 <productname>systemd
</productname>
15 <refentrytitle>sd_bus_list_names
</refentrytitle>
16 <manvolnum>3</manvolnum>
20 <refname>sd_bus_list_names
</refname>
22 <refpurpose>Retrieve information about registered names on a bus
</refpurpose>
27 <funcsynopsisinfo>#include
<systemd/sd-bus.h
></funcsynopsisinfo>
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>
39 <title>Description
</title>
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 any string arrays returned by
<function>sd_bus_list_names()
</function>
49 is transferred to the caller and hence, the caller is responsible for freeing any results stored by
50 <function>sd_bus_list_names()
</function> in
<parameter>acquired
</parameter> and
51 <parameter>activatable
</parameter>.
</para>
55 <title>Return Value
</title>
57 <para>On success,
<function>sd_bus_list_names()
</function> returns a non-negative integer. On failure,
58 it returns a negative errno-style error code.
</para>
63 <para>Returned errors may indicate the following problems:
</para>
67 <term><constant>-EINVAL
</constant></term>
69 <listitem><para><parameter>bus
</parameter> or both
<parameter>acquired
</parameter> and
70 <parameter>activatable
</parameter> were
<constant>NULL
</constant>.
75 <term><constant>-ENOPKG
</constant></term>
77 <listitem><para>The bus cannot be resolved.
</para></listitem>
81 <term><constant>-ECHILD
</constant></term>
83 <listitem><para>The bus was created in a different process.
</para></listitem>
87 <term><constant>-ENOMEM
</constant></term>
89 <listitem><para>Memory allocation failed.
</para></listitem>
93 <term><constant>-ENOTCONN
</constant></term>
95 <listitem><para>The bus is not connected.
</para></listitem>
101 <xi:include href=
"libsystemd-pkgconfig.xml" />
104 <title>See Also
</title>
107 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
108 <citerefentry><refentrytitle>sd-bus
</refentrytitle><manvolnum>3</manvolnum></citerefentry>