]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_booted.xml
Merge pull request #8822 from fbuihuu/rfc-tmpfiles-safe-upstream
[thirdparty/systemd.git] / man / sd_booted.xml
CommitLineData
f9378423
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
f9378423
LP
4
5<!--
572eb058 6 SPDX-License-Identifier: LGPL-2.1+
f9378423
LP
7-->
8
6a70f3aa 9<refentry id="sd_booted"
798d3a52
ZJS
10 xmlns:xi="http://www.w3.org/2001/XInclude">
11
12 <refentryinfo>
13 <title>sd_booted</title>
14 <productname>systemd</productname>
798d3a52
ZJS
15 </refentryinfo>
16
17 <refmeta>
18 <refentrytitle>sd_booted</refentrytitle>
19 <manvolnum>3</manvolnum>
20 </refmeta>
21
22 <refnamediv>
23 <refname>sd_booted</refname>
24 <refpurpose>Test whether the system is running the systemd init system</refpurpose>
25 </refnamediv>
26
27 <refsynopsisdiv>
28 <funcsynopsis>
29 <funcsynopsisinfo>#include &lt;systemd/sd-daemon.h&gt;</funcsynopsisinfo>
30
31 <funcprototype>
32 <funcdef>int <function>sd_booted</function></funcdef>
33 <paramdef>void</paramdef>
34 </funcprototype>
35 </funcsynopsis>
36 </refsynopsisdiv>
37
38 <refsect1>
39 <title>Description</title>
40 <para><function>sd_booted()</function> checks whether the system
41 was booted up using the systemd init system.</para>
42 </refsect1>
43
44 <refsect1>
45 <title>Return Value</title>
46
47 <para>On failure, this call returns a negative errno-style error
48 code. If the system was booted up with systemd as init system,
49 this call returns a positive return value, zero otherwise.</para>
50 </refsect1>
51
52 <refsect1>
53 <title>Notes</title>
54
55 <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
56
57 <para>Internally, this function checks whether the directory
58 <filename>/run/systemd/system/</filename> exists. A simple check
59 like this can also be implemented trivially in shell or any other
60 language.</para>
61 </refsect1>
62
63 <refsect1>
64 <title>See Also</title>
65 <para>
66 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
67 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>
68 </para>
69 </refsect1>
f9378423
LP
70
71</refentry>