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 -->
6 <refentry id=
"sd_bus_get_name_machine_id" xmlns:
xi=
"http://www.w3.org/2001/XInclude">
9 <title>sd_bus_get_name_machine_id
</title>
10 <productname>systemd
</productname>
14 <refentrytitle>sd_bus_get_name_machine_id
</refentrytitle>
15 <manvolnum>3</manvolnum>
19 <refname>sd_bus_get_name_machine_id
</refname>
21 <refpurpose>Retrieve a bus client's machine identity
</refpurpose>
26 <funcsynopsisinfo>#include
<systemd/sd-bus.h
></funcsynopsisinfo>
29 <funcdef>int
<function>sd_bus_get_name_machine_id
</function></funcdef>
30 <paramdef>sd_bus *
<parameter>bus
</parameter></paramdef>
31 <paramdef>const char *
<parameter>name
</parameter></paramdef>
32 <paramdef>sd_id128_t *
<parameter>machine
</parameter></paramdef>
38 <title>Description
</title>
40 <para><function>sd_bus_get_name_machine_id()
</function> retrieves the D-Bus machine identity of the
41 machine that the bus client identified by
<parameter>name
</parameter> is running on. Internally, it calls
42 the
<function>GetMachineId
</function> method of the
<constant>org.freedesktop.DBus.Peer
</constant>
43 interface. The D-Bus machine identity is a
128-bit UUID. On Linux systems running systemd, this
44 corresponds to the contents of
<filename>/etc/machine-id
</filename>. On success, the machine identity is
45 stored in
<parameter>machine
</parameter>.
</para>
49 <title>Return Value
</title>
51 <para>On success, this function returns a non-negative integer. On failure, it returns a negative
52 errno-style error code.
</para>
57 <para>Returned errors may indicate the following problems:
</para>
61 <term><constant>-EINVAL
</constant></term>
63 <listitem><para>An argument is invalid.
</para></listitem>
67 <term><constant>-ENOPKG
</constant></term>
69 <listitem><para>The bus cannot be resolved.
</para></listitem>
73 <term><constant>-ECHILD
</constant></term>
75 <listitem><para>The bus was created in a different process, library or module instance.
</para></listitem>
79 <term><constant>-ENOMEM
</constant></term>
81 <listitem><para>Memory allocation failed.
</para></listitem>
87 <xi:include href=
"libsystemd-pkgconfig.xml" />
90 <title>History
</title>
91 <para><function>sd_bus_get_name_machine_id()
</function> was added in version
221.
</para>
95 <title>See Also
</title>
97 <para><simplelist type=
"inline">
98 <member><citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
99 <member><citerefentry><refentrytitle>sd-bus
</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>