]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_machine_get_class.xml
path-util: fix breakage in path_is_mount_point
[thirdparty/systemd.git] / man / sd_machine_get_class.xml
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">
4
5 <!--
6 This file is part of systemd.
7
8 Copyright 2014 Lennart Poettering
9
10 systemd 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.
14
15 systemd 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.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="sd_machine_get_class">
25
26 <refentryinfo>
27 <title>sd_machine_get_class</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>sd_machine_get_class</refentrytitle>
42 <manvolnum>3</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>sd_machine_get_class</refname>
47 <refname>sd_machine_get_ifindices</refname>
48 <refpurpose>Determine the class and network interface
49 indices of a locally running virtual machine or
50 container.</refpurpose>
51 </refnamediv>
52
53 <refsynopsisdiv>
54 <funcsynopsis>
55 <funcsynopsisinfo>#include &lt;systemd/sd-login.h&gt;</funcsynopsisinfo>
56
57 <funcprototype>
58 <funcdef>int <function>sd_machine_get_class</function></funcdef>
59 <paramdef>const char* <parameter>machine</parameter></paramdef>
60 <paramdef>char *<parameter>class</parameter></paramdef>
61 </funcprototype>
62
63 <funcprototype>
64 <funcdef>int <function>sd_machine_get_ifindices</function></funcdef>
65 <paramdef>const char* <parameter>machine</parameter></paramdef>
66 <paramdef>int **<parameter>ifindices</parameter></paramdef>
67 </funcprototype>
68 </funcsynopsis>
69 </refsynopsisdiv>
70
71 <refsect1>
72 <title>Description</title>
73
74 <para><function>sd_machine_get_class()</function> may
75 be used to determine the class of a locally running
76 virtual machine or container that is registered with
77 <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. The
78 string returned is either <literal>vm</literal> or
79 <literal>container</literal>. The returned string
80 needs to be freed with the libc <citerefentry
81 project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
82 call after use.</para>
83
84 <para><function>sd_machine_get_ifindices()</function>
85 may be used to determine the numeric indices of the
86 network interfaces on the host that are pointing
87 towards the specified locally running virtual machine
88 or container that is registered with
89 <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. The
90 returned array needs to be freed with the libc
91 <citerefentry
92 project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
93 call after use.</para>
94 </refsect1>
95
96 <refsect1>
97 <title>Return Value</title>
98
99 <para>On success, these calls return 0 or a positive
100 integer. On failure, these calls return a negative
101 errno-style error code.</para>
102 </refsect1>
103
104 <refsect1>
105 <title>Notes</title>
106
107 <para>The <function>sd_machine_get_class()</function> and
108 <function>sd_machine_get_ifindices()</function> interfaces are
109 available as a shared library, which can be compiled
110 and linked to with the
111 <constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
112 file.</para>
113 </refsect1>
114
115 <refsect1>
116 <title>See Also</title>
117
118 <para>
119 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
120 <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
121 <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
122 <citerefentry><refentrytitle>sd_pid_get_machine_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>
123 </para>
124 </refsect1>
125
126 </refentry>