]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_booted.xml
Fix SPDX license tags
[thirdparty/systemd.git] / man / sd_booted.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 SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="sd_booted"
10 xmlns:xi="http://www.w3.org/2001/XInclude">
11
12 <refentryinfo>
13 <title>sd_booted</title>
14 <productname>systemd</productname>
15
16 <authorgroup>
17 <author>
18 <contrib>Developer</contrib>
19 <firstname>Lennart</firstname>
20 <surname>Poettering</surname>
21 <email>lennart@poettering.net</email>
22 </author>
23 </authorgroup>
24 </refentryinfo>
25
26 <refmeta>
27 <refentrytitle>sd_booted</refentrytitle>
28 <manvolnum>3</manvolnum>
29 </refmeta>
30
31 <refnamediv>
32 <refname>sd_booted</refname>
33 <refpurpose>Test whether the system is running the systemd init system</refpurpose>
34 </refnamediv>
35
36 <refsynopsisdiv>
37 <funcsynopsis>
38 <funcsynopsisinfo>#include &lt;systemd/sd-daemon.h&gt;</funcsynopsisinfo>
39
40 <funcprototype>
41 <funcdef>int <function>sd_booted</function></funcdef>
42 <paramdef>void</paramdef>
43 </funcprototype>
44 </funcsynopsis>
45 </refsynopsisdiv>
46
47 <refsect1>
48 <title>Description</title>
49 <para><function>sd_booted()</function> checks whether the system
50 was booted up using the systemd init system.</para>
51 </refsect1>
52
53 <refsect1>
54 <title>Return Value</title>
55
56 <para>On failure, this call returns a negative errno-style error
57 code. If the system was booted up with systemd as init system,
58 this call returns a positive return value, zero otherwise.</para>
59 </refsect1>
60
61 <refsect1>
62 <title>Notes</title>
63
64 <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
65
66 <para>Internally, this function checks whether the directory
67 <filename>/run/systemd/system/</filename> exists. A simple check
68 like this can also be implemented trivially in shell or any other
69 language.</para>
70 </refsect1>
71
72 <refsect1>
73 <title>See Also</title>
74 <para>
75 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
76 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>
77 </para>
78 </refsect1>
79
80 </refentry>