]> git.proxmox.com Git - systemd.git/blob - man/sd_id128_get_machine.3
Imported Upstream version 219
[systemd.git] / man / sd_id128_get_machine.3
1 '\" t
2 .TH "SD_ID128_GET_MACHINE" "3" "" "systemd 219" "sd_id128_get_machine"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 sd_id128_get_machine, sd_id128_get_boot \- Retrieve 128\-bit IDs
24 .SH "SYNOPSIS"
25 .sp
26 .ft B
27 .nf
28 #include <systemd/sd\-id128\&.h>
29 .fi
30 .ft
31 .HP \w'int\ sd_id128_get_machine('u
32 .BI "int sd_id128_get_machine(sd_id128_t\ *" "ret" ");"
33 .HP \w'int\ sd_id128_get_boot('u
34 .BI "int sd_id128_get_boot(sd_id128_t\ *" "ret" ");"
35 .SH "DESCRIPTION"
36 .PP
37 \fBsd_id128_get_machine()\fR
38 returns the machine ID of the executing host\&. This reads and parses the
39 \fBmachine-id\fR(5)
40 file\&. This function caches the machine ID internally to make retrieving the machine ID a cheap operation\&.
41 .PP
42 \fBsd_id128_get_boot()\fR
43 returns the boot ID of the executing kernel\&. This reads and parses the
44 /proc/sys/kernel/random/boot_id
45 file exposed by the kernel\&. It is randomly generated early at boot and is unique for every running kernel instance\&. See
46 \fBrandom\fR(4)
47 for more information\&. This function also internally caches the returned ID to make this call a cheap operation\&.
48 .PP
49 Note that
50 \fBsd_id128_get_boot()\fR
51 always returns a UUID v4 compatible ID\&.
52 \fBsd_id128_get_machine()\fR
53 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 a UUID v4\-compatible one\&. For more information, see
54 \fBmachine-id\fR(5)\&.
55 .PP
56 For more information about the
57 "sd_id128_t"
58 type see
59 \fBsd-id128\fR(3)\&.
60 .SH "RETURN VALUE"
61 .PP
62 The two calls return 0 on success (in which case
63 \fIret\fR
64 is filled in), or a negative errno\-style error code\&.
65 .SH "NOTES"
66 .PP
67 The
68 \fBsd_id128_get_machine()\fR
69 and
70 \fBsd_id128_get_boot()\fR
71 interfaces are available as a shared library, which can be compiled and linked to with the
72 "libsystemd"\ \&\fBpkg-config\fR(1)
73 file\&.
74 .SH "SEE ALSO"
75 .PP
76 \fBsystemd\fR(1),
77 \fBsd-id128\fR(3),
78 \fBmachine-id\fR(5),
79 \fBrandom\fR(4),
80 \fBsd_id128_randomize\fR(3)