man-pages/man3/sd_booted.3.html
2021-03-31 01:06:50 +01:00

100 lines
2.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SD_BOOTED</TITLE>
</HEAD><BODY>
<H1>SD_BOOTED</H1>
Section: sd_booted (3)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sd_booted - Test whether the system is running the systemd init system
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>
</B><PRE>
#include &lt;<A HREF="file:///usr/include/systemd/sd-daemon.h">systemd/sd-daemon.h</A>&gt;
</PRE>
<DL COMPACT>
<DT id="1">
<B>int sd_booted(void);</B>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<B>sd_booted()</B>
<DD>checks whether the system was booted up using the systemd init system.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
<P>
On failure, this call returns a negative errno-style error code. If the system was booted up with systemd as init system, this call returns a positive return value, zero otherwise.
<A NAME="lbAF">&nbsp;</A>
<H2>NOTES</H2>
<P>
These APIs are implemented as a shared library, which can be compiled and linked to with the
<B>libsystemd</B>&nbsp;<B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
file.
<P>
Internally, this function checks whether the directory
/run/systemd/system/
exists. A simple check like this can also be implemented trivially in shell or any other language.
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?3+sd-daemon">sd-daemon</A></B>(3)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="2"><A HREF="#lbAB">NAME</A><DD>
<DT id="3"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="4"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="5"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="6"><A HREF="#lbAF">NOTES</A><DD>
<DT id="7"><A HREF="#lbAG">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:54 GMT, March 31, 2021
</BODY>
</HTML>