]>
Commit | Line | Data |
---|---|---|
12355095 LP |
1 | <?xml version='1.0'?> <!--*-nxml-*--> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
681eb9cf FB |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ |
4 | <!ENTITY % entities SYSTEM "custom-entities.ent" > | |
5 | %entities; | |
6 | ]> | |
12355095 LP |
7 | |
8 | <!-- | |
9 | This file is part of systemd. | |
10 | ||
11 | Copyright 2012 Lennart Poettering | |
12 | ||
13 | systemd is free software; you can redistribute it and/or modify it | |
14 | under the terms of the GNU Lesser General Public License as published by | |
15 | the Free Software Foundation; either version 2.1 of the License, or | |
16 | (at your option) any later version. | |
17 | ||
18 | systemd is distributed in the hope that it will be useful, but | |
19 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | Lesser General Public License for more details. | |
22 | ||
23 | You should have received a copy of the GNU Lesser General Public License | |
24 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
25 | --> | |
26 | ||
27 | <refentry id="sd_id128_randomize"> | |
28 | ||
798d3a52 ZJS |
29 | <refentryinfo> |
30 | <title>sd_id128_randomize</title> | |
31 | <productname>systemd</productname> | |
32 | ||
33 | <authorgroup> | |
34 | <author> | |
35 | <contrib>Developer</contrib> | |
36 | <firstname>Lennart</firstname> | |
37 | <surname>Poettering</surname> | |
38 | <email>lennart@poettering.net</email> | |
39 | </author> | |
40 | </authorgroup> | |
41 | </refentryinfo> | |
42 | ||
43 | <refmeta> | |
44 | <refentrytitle>sd_id128_randomize</refentrytitle> | |
45 | <manvolnum>3</manvolnum> | |
46 | </refmeta> | |
47 | ||
48 | <refnamediv> | |
49 | <refname>sd_id128_randomize</refname> | |
50 | <refpurpose>Generate 128-bit IDs</refpurpose> | |
51 | </refnamediv> | |
52 | ||
53 | <refsynopsisdiv> | |
54 | <funcsynopsis> | |
55 | <funcsynopsisinfo>#include <systemd/sd-id128.h></funcsynopsisinfo> | |
56 | ||
57 | <funcprototype> | |
58 | <funcdef>int <function>sd_id128_randomize</function></funcdef> | |
59 | <paramdef>sd_id128_t *<parameter>ret</parameter></paramdef> | |
60 | </funcprototype> | |
61 | ||
62 | </funcsynopsis> | |
63 | </refsynopsisdiv> | |
64 | ||
65 | <refsect1> | |
66 | <title>Description</title> | |
67 | ||
68 | <para><function>sd_id128_randomize()</function> generates a new | |
69 | randomized 128-bit ID and returns it in | |
70 | <parameter>ret</parameter>. Every invocation returns a new | |
71 | randomly generated ID. This uses the | |
72 | <filename>/dev/urandom</filename> kernel random number | |
73 | generator.</para> | |
74 | ||
75 | <para>Note that <function>sd_id128_randomize()</function> always | |
76 | returns a UUID v4-compatible ID.</para> | |
77 | ||
78 | <para>For more information about the <literal>sd_id128_t</literal> | |
79 | type, see | |
80 | <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para> | |
81 | ||
82 | <para><citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
83 | <option>--new-id</option> option may be used as a command line | |
84 | front-end for <function>sd_id128_randomize()</function>.</para> | |
85 | </refsect1> | |
86 | ||
87 | <refsect1> | |
88 | <title>Return Value</title> | |
89 | ||
90 | <para>The call returns 0 on success (in which case | |
91 | <parameter>ret</parameter> is filled in), or a negative | |
92 | errno-style error code.</para> | |
93 | </refsect1> | |
94 | ||
95 | <refsect1> | |
96 | <title>Notes</title> | |
97 | ||
98 | <para>The <function>sd_id128_randomize()</function> interface is | |
99 | available as a shared library, which can be compiled and linked to | |
100 | with the | |
101 | <literal>libsystemd</literal> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
102 | file.</para> | |
103 | </refsect1> | |
104 | ||
105 | <refsect1> | |
106 | <title>See Also</title> | |
107 | ||
108 | <para> | |
109 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
110 | <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
111 | <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
112 | <citerefentry><refentrytitle>random</refentrytitle><manvolnum>4</manvolnum></citerefentry>, | |
113 | <citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
114 | </para> | |
115 | </refsect1> | |
12355095 LP |
116 | |
117 | </refentry> |