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