systemd/man/sd_id128_get_boot.html
Michael Stapelberg ba573a3afc Use orig tarball systemd-204.tar.xz.
Instead of tracking git upstream directly, the upstream branch now
contains the contents of the orig tarball available at
http://www.freedesktop.org/software/systemd/
2014-04-26 10:16:11 +02:00

63 lines
5.8 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>sd_id128_get_machine</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 204</span><hr><div class="refentry"><a name="sd_id128_get_machine"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_id128_get_machine, sd_id128_get_boot — Retrieve 128 bit IDs</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;systemd/sd-id128.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">sd_id128_get_machine</b>(</code></td><td>sd_id128_t* <var class="pdparam">ret</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">sd_id128_get_boot</b>(</code></td><td>sd_id128_t* <var class="pdparam">ret</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm259796301024"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><code class="function">sd_id128_get_machine()</code>
returns the machine ID of the executing host. This
reads and parses the
<a href="machine-id.html"><span class="citerefentry"><span class="refentrytitle">machine-id</span>(5)</span></a>
file. This function caches the machine ID internally
to make retrieving the machine ID a cheap
operation.</p><p><code class="function">sd_id128_get_boot()</code> returns
the boot ID of the executing kernel. This reads and
parses the
<code class="filename">/proc/sys/kernel/random/boot_id</code>
file exposed by the kernel. It is randomly generated
early at boot and is unique for every running kernel
instance. See
<a href="random.html"><span class="citerefentry"><span class="refentrytitle">random</span>(4)</span></a>
for more information. This function also internally
caches the returned ID to make this call a cheap
operation.</p><p>Note that
<code class="function">sd_id128_get_boot()</code> always returns
a UUID v4 compatible
ID. <code class="function">sd_id128_get_machine()</code> will
also return a UUID v4 compatible ID on new
installations, but might not on older. It is possible
to convert the machine ID into an UUID v4 compatible
one. For more information see
<a href="machine-id.html"><span class="citerefentry"><span class="refentrytitle">machine-id</span>(5)</span></a>.</p><p>For more information about the
<code class="literal">sd_id128_t</code> type see
<a href="sd-id128.html"><span class="citerefentry"><span class="refentrytitle">sd-id128</span>(3)</span></a>.</p></div><div class="refsect1"><a name="idm259794659168"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value"></a></h2><p>The two calls return 0 on success (in which
case <em class="parameter"><code>ret</code></em> is filled in), or a
negative errno-style error code.</p></div><div class="refsect1"><a name="idm259794657328"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes"></a></h2><p>The <code class="function">sd_id128_get_machine()</code>
and <code class="function">sd_id128_get_boot()</code>
interfaces are available as shared library, which can
be compiled and linked to with the
<code class="literal">libsystemd-id128</code>
<a href="pkg-config.html"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
file.</p></div><div class="refsect1"><a name="idm259794652976"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
<a href="sd-id128.html"><span class="citerefentry"><span class="refentrytitle">sd-id128</span>(3)</span></a>,
<a href="machine-id.html"><span class="citerefentry"><span class="refentrytitle">machine-id</span>(5)</span></a>,
<a href="random.html"><span class="citerefentry"><span class="refentrytitle">random</span>(4)</span></a>,
<a href="sd_id128_randomize.html"><span class="citerefentry"><span class="refentrytitle">sd_id128_randomize</span>(3)</span></a>
</p></div></div></body></html>