]>
Commit | Line | Data |
---|---|---|
12355095 LP |
1 | <?xml version='1.0'?> <!--*-nxml-*--> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
12355095 LP |
4 | |
5 | <!-- | |
572eb058 ZJS |
6 | SPDX-License-Identifier: LGPL-2.1+ |
7 | ||
12355095 | 8 | Copyright 2012 Lennart Poettering |
12355095 LP |
9 | --> |
10 | ||
7d6b2723 | 11 | <refentry id="sd_id128_randomize" xmlns:xi="http://www.w3.org/2001/XInclude"> |
12355095 | 12 | |
798d3a52 ZJS |
13 | <refentryinfo> |
14 | <title>sd_id128_randomize</title> | |
15 | <productname>systemd</productname> | |
16 | ||
17 | <authorgroup> | |
18 | <author> | |
19 | <contrib>Developer</contrib> | |
20 | <firstname>Lennart</firstname> | |
21 | <surname>Poettering</surname> | |
22 | <email>lennart@poettering.net</email> | |
23 | </author> | |
24 | </authorgroup> | |
25 | </refentryinfo> | |
26 | ||
27 | <refmeta> | |
28 | <refentrytitle>sd_id128_randomize</refentrytitle> | |
29 | <manvolnum>3</manvolnum> | |
30 | </refmeta> | |
31 | ||
32 | <refnamediv> | |
33 | <refname>sd_id128_randomize</refname> | |
34 | <refpurpose>Generate 128-bit IDs</refpurpose> | |
35 | </refnamediv> | |
36 | ||
37 | <refsynopsisdiv> | |
38 | <funcsynopsis> | |
39 | <funcsynopsisinfo>#include <systemd/sd-id128.h></funcsynopsisinfo> | |
40 | ||
41 | <funcprototype> | |
42 | <funcdef>int <function>sd_id128_randomize</function></funcdef> | |
43 | <paramdef>sd_id128_t *<parameter>ret</parameter></paramdef> | |
44 | </funcprototype> | |
45 | ||
46 | </funcsynopsis> | |
47 | </refsynopsisdiv> | |
48 | ||
49 | <refsect1> | |
50 | <title>Description</title> | |
51 | ||
52 | <para><function>sd_id128_randomize()</function> generates a new | |
53 | randomized 128-bit ID and returns it in | |
54 | <parameter>ret</parameter>. Every invocation returns a new | |
55 | randomly generated ID. This uses the | |
56 | <filename>/dev/urandom</filename> kernel random number | |
57 | generator.</para> | |
58 | ||
59 | <para>Note that <function>sd_id128_randomize()</function> always | |
60 | returns a UUID v4-compatible ID.</para> | |
61 | ||
62 | <para>For more information about the <literal>sd_id128_t</literal> | |
63 | type, see | |
64 | <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para> | |
65 | ||
66 | <para><citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
eda8c27f | 67 | <option>--new-id128</option> option may be used as a command line |
798d3a52 ZJS |
68 | front-end for <function>sd_id128_randomize()</function>.</para> |
69 | </refsect1> | |
70 | ||
71 | <refsect1> | |
72 | <title>Return Value</title> | |
73 | ||
74 | <para>The call returns 0 on success (in which case | |
75 | <parameter>ret</parameter> is filled in), or a negative | |
76 | errno-style error code.</para> | |
77 | </refsect1> | |
78 | ||
7d6b2723 | 79 | <xi:include href="libsystemd-pkgconfig.xml" /> |
798d3a52 ZJS |
80 | |
81 | <refsect1> | |
82 | <title>See Also</title> | |
83 | ||
84 | <para> | |
85 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
86 | <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
87 | <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
88 | <citerefentry><refentrytitle>random</refentrytitle><manvolnum>4</manvolnum></citerefentry>, | |
89 | <citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
90 | </para> | |
91 | </refsect1> | |
12355095 LP |
92 | |
93 | </refentry> |