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