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 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>
54 <title>Return Value
</title>
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>
62 <para>Returned errors may indicate the following problems:
</para>
66 <term><constant>-EINVAL
</constant></term>
68 <listitem><para><parameter>bus
</parameter> or both
<parameter>acquired
</parameter> and
69 <parameter>activatable
</parameter> were
<constant>NULL
</constant>.
74 <term><constant>-ENOPKG
</constant></term>
76 <listitem><para>The bus cannot be resolved.
</para></listitem>
80 <term><constant>-ECHILD
</constant></term>
82 <listitem><para>The bus was created in a different process.
</para></listitem>
86 <term><constant>-ENOMEM
</constant></term>
88 <listitem><para>Memory allocation failed.
</para></listitem>
92 <term><constant>-ENOTCONN
</constant></term>
94 <listitem><para>The bus is not connected.
</para></listitem>
100 <xi:include href=
"libsystemd-pkgconfig.xml" />
103 <title>See Also
</title>
106 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
107 <citerefentry><refentrytitle>sd-bus
</refentrytitle><manvolnum>3</manvolnum></citerefentry>