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