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">
6 This file is part of elogind.
8 Copyright 2012 Lennart Poettering
10 elogind is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 elogind is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with elogind; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="sd_id128_randomize">
27 <title>sd_id128_randomize</title>
28 <productname>elogind</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>sd_id128_randomize</refentrytitle>
42 <manvolnum>3</manvolnum>
46 <refname>sd_id128_randomize</refname>
47 <refpurpose>Generate 128-bit IDs</refpurpose>
52 <funcsynopsisinfo>#include <elogind/sd-id128.h></funcsynopsisinfo>
55 <funcdef>int <function>sd_id128_randomize</function></funcdef>
56 <paramdef>sd_id128_t *<parameter>ret</parameter></paramdef>
63 <title>Description</title>
65 <para><function>sd_id128_randomize()</function> generates a new
66 randomized 128-bit ID and returns it in
67 <parameter>ret</parameter>. Every invocation returns a new
68 randomly generated ID. This uses the
69 <filename>/dev/urandom</filename> kernel random number
72 <para>Note that <function>sd_id128_randomize()</function> always
73 returns a UUID v4-compatible ID.</para>
75 <para>For more information about the <literal>sd_id128_t</literal>
77 <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
79 <para><option>--new-id</option> option may be used as a command line
80 front-end for <function>sd_id128_randomize()</function>.</para>
84 <title>Return Value</title>
86 <para>The call returns 0 on success (in which case
87 <parameter>ret</parameter> is filled in), or a negative
88 errno-style error code.</para>
94 <para>The <function>sd_id128_randomize()</function> interface is
95 available as a shared library, which can be compiled and linked to
97 <literal>libelogind</literal> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
102 <title>See Also</title>
105 <citerefentry><refentrytitle>elogind</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
106 <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
107 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
108 <citerefentry><refentrytitle>random</refentrytitle><manvolnum>4</manvolnum></citerefentry>,
109 <citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry>