]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_id128_randomize.xml
Merge pull request #8822 from fbuihuu/rfc-tmpfiles-safe-upstream
[thirdparty/systemd.git] / man / sd_id128_randomize.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="sd_id128_randomize" xmlns:xi="http://www.w3.org/2001/XInclude">
10
11 <refentryinfo>
12 <title>sd_id128_randomize</title>
13 <productname>systemd</productname>
14 </refentryinfo>
15
16 <refmeta>
17 <refentrytitle>sd_id128_randomize</refentrytitle>
18 <manvolnum>3</manvolnum>
19 </refmeta>
20
21 <refnamediv>
22 <refname>sd_id128_randomize</refname>
23 <refpurpose>Generate 128-bit IDs</refpurpose>
24 </refnamediv>
25
26 <refsynopsisdiv>
27 <funcsynopsis>
28 <funcsynopsisinfo>#include &lt;systemd/sd-id128.h&gt;</funcsynopsisinfo>
29
30 <funcprototype>
31 <funcdef>int <function>sd_id128_randomize</function></funcdef>
32 <paramdef>sd_id128_t *<parameter>ret</parameter></paramdef>
33 </funcprototype>
34
35 </funcsynopsis>
36 </refsynopsisdiv>
37
38 <refsect1>
39 <title>Description</title>
40
41 <para><function>sd_id128_randomize()</function> generates a new
42 randomized 128-bit ID and returns it in
43 <parameter>ret</parameter>. Every invocation returns a new
44 randomly generated ID. This uses the
45 <filename>/dev/urandom</filename> kernel random number
46 generator.</para>
47
48 <para>Note that <function>sd_id128_randomize()</function> always
49 returns a UUID v4-compatible ID.</para>
50
51 <para>For more information about the <literal>sd_id128_t</literal>
52 type, see
53 <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
54
55 <para><citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
56 <option>--new-id128</option> option may be used as a command line
57 front-end for <function>sd_id128_randomize()</function>.</para>
58 </refsect1>
59
60 <refsect1>
61 <title>Return Value</title>
62
63 <para>The call returns 0 on success (in which case
64 <parameter>ret</parameter> is filled in), or a negative
65 errno-style error code.</para>
66 </refsect1>
67
68 <xi:include href="libsystemd-pkgconfig.xml" />
69
70 <refsect1>
71 <title>See Also</title>
72
73 <para>
74 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
75 <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
76 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
77 <citerefentry><refentrytitle>random</refentrytitle><manvolnum>4</manvolnum></citerefentry>,
78 <citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry>
79 </para>
80 </refsect1>
81
82 </refentry>