~ubuntu-branches/ubuntu/trusty/systemd/trusty

« back to all changes in this revision

Viewing changes to man/sd_id128_get_machine.3

Tags: upstream-202
ImportĀ upstreamĀ versionĀ 202

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
'\" t
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/>
5
 
.\"      Date: 03/07/2013
6
 
.\"    Manual: sd_id128_get_machine
7
 
.\"    Source: systemd
8
 
.\"  Language: English
9
 
.\"
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
 
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
 
.ie \n(.g .ds Aq \(aq
19
 
.el       .ds Aq '
20
 
.\" -----------------------------------------------------------------
21
 
.\" * set default formatting
22
 
.\" -----------------------------------------------------------------
23
 
.\" disable hyphenation
24
 
.nh
25
 
.\" disable justification (adjust text to left margin only)
26
 
.ad l
27
 
.\" -----------------------------------------------------------------
28
 
.\" * MAIN CONTENT STARTS HERE *
29
 
.\" -----------------------------------------------------------------
30
 
.SH "NAME"
31
 
sd_id128_get_machine, sd_id128_get_boot \- Retrieve 128 bit IDs
32
 
.SH "SYNOPSIS"
33
 
.sp
34
 
.ft B
35
 
.nf
36
 
#include <systemd/sd\-id128\&.h>
37
 
.fi
38
 
.ft
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" ");"
43
 
.SH "DESCRIPTION"
44
 
.PP
45
 
\fBsd_id128_get_machine()\fR
46
 
returns the machine ID of the executing host\&. This reads and parses the
47
 
\fBmachine-id\fR(5)
48
 
file\&. This function caches the machine ID internally to make retrieving the machine ID a cheap operation\&.
49
 
.PP
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
54
 
\fBrandom\fR(4)
55
 
for more information\&. This function also internally caches the returned ID to make this call a cheap operation\&.
56
 
.PP
57
 
Note that
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)\&.
63
 
.PP
64
 
For more information about the
65
 
sd_id128_t
66
 
type see
67
 
\fBsd-id128\fR(3)\&.
68
 
.SH "RETURN VALUE"
69
 
.PP
70
 
The two calls return 0 on success (in which case
71
 
\fIret\fR
72
 
is filled in), or a negative errno\-style error code\&.
73
 
.SH "NOTES"
74
 
.PP
75
 
The
76
 
\fBsd_id128_get_machine()\fR
77
 
and
78
 
\fBsd_id128_get_boot()\fR
79
 
interfaces are available as shared library, which can be compiled and linked to with the
80
 
libsystemd\-id128
81
 
\fBpkg-config\fR(1)
82
 
file\&.
83
 
.SH "SEE ALSO"
84
 
.PP
85
 
 
86
 
\fBsystemd\fR(1),
87
 
\fBsd-id128\fR(3),
88
 
\fBmachine-id\fR(5),
89
 
\fBrandom\fR(4),
90
 
\fBsd_id128_randomize\fR(3)