2
.\" Title: sd_id128_get_machine
3
.\" Author: Lennart Poettering <lennart@poettering.net>
4
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
6
.\" Manual: sd_id128_get_machine
10
.TH "SD_ID128_GET_MACHINE" "3" "" "systemd" "sd_id128_get_machine"
11
.\" -----------------------------------------------------------------
12
.\" * Define some portability stuff
13
.\" -----------------------------------------------------------------
14
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
.\" http://bugs.debian.org/507673
16
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
.\" -----------------------------------------------------------------
21
.\" * set default formatting
22
.\" -----------------------------------------------------------------
23
.\" disable hyphenation
25
.\" disable justification (adjust text to left margin only)
27
.\" -----------------------------------------------------------------
28
.\" * MAIN CONTENT STARTS HERE *
29
.\" -----------------------------------------------------------------
31
sd_id128_get_machine, sd_id128_get_boot \- Retrieve 128 bit IDs
36
#include <systemd/sd\-id128\&.h>
39
.HP \w'int\ sd_id128_get_machine('u
40
.BI "int sd_id128_get_machine(sd_id128_t*\ " "ret" ");"
41
.HP \w'int\ sd_id128_get_boot('u
42
.BI "int sd_id128_get_boot(sd_id128_t*\ " "ret" ");"
45
\fBsd_id128_get_machine()\fR
46
returns the machine ID of the executing host\&. This reads and parses the
48
file\&. This function caches the machine ID internally to make retrieving the machine ID a cheap operation\&.
50
\fBsd_id128_get_boot()\fR
51
returns the boot ID of the executing kernel\&. This reads and parses the
52
/proc/sys/kernel/random/boot_id
53
file exposed by the kernel\&. It is randomly generated early at boot and is unique for every running kernel instance\&. See
55
for more information\&. This function also internally caches the returned ID to make this call a cheap operation\&.
58
\fBsd_id128_get_boot()\fR
59
always returns a UUID v4 compatible ID\&.
60
\fBsd_id128_get_machine()\fR
61
will also return a UUID v4 compatible ID on new installations, but might not on older\&. It is possible to convert the machine ID into an UUID v4 compatible one\&. For more information see
62
\fBmachine-id\fR(5)\&.
64
For more information about the
70
The two calls return 0 on success (in which case
72
is filled in), or a negative errno\-style error code\&.
76
\fBsd_id128_get_machine()\fR
78
\fBsd_id128_get_boot()\fR
79
interfaces are available as shared library, which can be compiled and linked to with the
90
\fBsd_id128_randomize\fR(3)