]> git.proxmox.com Git - systemd.git/blob - man/sd_id128_randomize.html
Imported Upstream version 219
[systemd.git] / man / sd_id128_randomize.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>sd_id128_randomize</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</span><hr><div class="refentry"><a name="sd_id128_randomize"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_id128_randomize — Generate 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_randomize</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="idm139888702754960"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><code class="function">sd_id128_randomize()</code> generates a new
23 randomized 128-bit ID and returns it in
24 <em class="parameter"><code>ret</code></em>. Every invocation returns a new
25 randomly generated ID. This uses the
26 <code class="filename">/dev/urandom</code> kernel random number
27 generator.</p><p>Note that <code class="function">sd_id128_randomize()</code> always
28 returns a UUID v4-compatible ID.</p><p>For more information about the "<code class="literal">sd_id128_t</code>"
29 type, see
30 <a href="sd-id128.html"><span class="citerefentry"><span class="refentrytitle">sd-id128</span>(3)</span></a>.</p><p><a href="journalctl.html"><span class="citerefentry"><span class="refentrytitle">journalctl</span>(1)</span></a>'s
31 <code class="option">--new-id</code> option may be used as a command line
32 front-end for <code class="function">sd_id128_randomize()</code>.</p></div><div class="refsect1"><a name="idm139888702746752"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value"></a></h2><p>The call returns 0 on success (in which case
33 <em class="parameter"><code>ret</code></em> is filled in), or a negative
34 errno-style error code.</p></div><div class="refsect1"><a name="idm139888702744912"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes"></a></h2><p>The <code class="function">sd_id128_randomize()</code> interface is
35 available as a shared library, which can be compiled and linked to
36 with the
37 "<code class="literal">libsystemd</code>" <a href="http://linux.die.net/man/1/pkg-config"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
38 file.</p></div><div class="refsect1"><a name="idm139888706643664"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
39 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
40 <a href="sd-id128.html"><span class="citerefentry"><span class="refentrytitle">sd-id128</span>(3)</span></a>,
41 <a href="machine-id.html"><span class="citerefentry"><span class="refentrytitle">machine-id</span>(5)</span></a>,
42 <a href="http://man7.org/linux/man-pages/man4/random.4.html"><span class="citerefentry"><span class="refentrytitle">random</span>(4)</span></a>,
43 <a href="sd_id128_get_machine.html"><span class="citerefentry"><span class="refentrytitle">sd_id128_get_machine</span>(3)</span></a>
44 </p></div></div></body></html>