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-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>
65 <xi:include href=
"version-info.xml" xpointer=
"v246"/></listitem>
69 <term><constant>-ENOPKG
</constant></term>
71 <listitem><para>The bus cannot be resolved.
</para>
73 <xi:include href=
"version-info.xml" xpointer=
"v246"/></listitem>
77 <term><constant>-ECHILD
</constant></term>
79 <listitem><para>The bus was created in a different process, library or module instance.
</para>
81 <xi:include href=
"version-info.xml" xpointer=
"v246"/></listitem>
85 <term><constant>-ENOMEM
</constant></term>
87 <listitem><para>Memory allocation failed.
</para>
89 <xi:include href=
"version-info.xml" xpointer=
"v246"/></listitem>
95 <xi:include href=
"libsystemd-pkgconfig.xml" />
98 <title>History
</title>
99 <para><function>sd_bus_get_name_machine_id()
</function> was added in version
246.
</para>
103 <title>See Also
</title>
105 <para><simplelist type=
"inline">
106 <member><citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
107 <member><citerefentry><refentrytitle>sd-bus
</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>