| 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 <systemd/sd-bus.h></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>.</para></listitem> |
| 70 |
</varlistentry> |
| 71 |
|
| 72 |
<varlistentry> |
| 73 |
<term><constant>-ENOPKG</constant></term> |
| 74 |
|
| 75 |
<listitem><para>The bus cannot be resolved.</para></listitem> |
| 76 |
</varlistentry> |
| 77 |
|
| 78 |
<varlistentry> |
| 79 |
<term><constant>-ECHILD</constant></term> |
| 80 |
|
| 81 |
<listitem><para>The bus was created in a different process, library or module instance.</para></listitem> |
| 82 |
</varlistentry> |
| 83 |
|
| 84 |
<varlistentry> |
| 85 |
<term><constant>-ENOMEM</constant></term> |
| 86 |
|
| 87 |
<listitem><para>Memory allocation failed.</para></listitem> |
| 88 |
</varlistentry> |
| 89 |
|
| 90 |
<varlistentry> |
| 91 |
<term><constant>-ENOTCONN</constant></term> |
| 92 |
|
| 93 |
<listitem><para>The bus is not connected.</para></listitem> |
| 94 |
</varlistentry> |
| 95 |
</variablelist> |
| 96 |
</refsect2> |
| 97 |
</refsect1> |
| 98 |
|
| 99 |
<xi:include href="libsystemd-pkgconfig.xml" /> |
| 100 |
|
| 101 |
<refsect1> |
| 102 |
<title>History</title> |
| 103 |
<para><function>sd_bus_list_names()</function> was added in version 221.</para> |
| 104 |
</refsect1> |
| 105 |
|
| 106 |
<refsect1> |
| 107 |
<title>See Also</title> |
| 108 |
|
| 109 |
<para><simplelist type="inline"> |
| 110 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 111 |
<member><citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 112 |
</simplelist></para> |
| 113 |
</refsect1> |
| 114 |
</refentry> |