From f9378423b9758861850748aeb49ae0d3300e56e6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 23 Jun 2010 00:31:54 +0200 Subject: man: document sd-daemon.[ch] --- man/sd_booted.xml | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 man/sd_booted.xml (limited to 'man/sd_booted.xml') diff --git a/man/sd_booted.xml b/man/sd_booted.xml new file mode 100644 index 0000000000..6129a777c2 --- /dev/null +++ b/man/sd_booted.xml @@ -0,0 +1,122 @@ + + + + + + + + + sd_booted + systemd + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_booted + 3 + + + + sd_booted + Test whether the system is running the systemd init system. + + + + + #include "sd-daemon.h" + + + int sd_booted + void + + + + + + Description + sd_booted() checks whether + the system was booted up using the systemd init system. + + + + Return Value + + 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 + postive return value, zero otherwise. + + + + Notes + + This function is provided by the reference + implementation of APIs for new-style daemons and + distributed with the systemd package. The algorithm it + implements is simple, and can easily be reimplemented + in daemons if it is important to support this + interface without using the reference + implementation. + + Internally, this function checks whether the + /cgroup/systemd virtual file + system is mounted, by comparing the st_dev value of + the stat() data of + /cgroup and + /cgroup/systemd. + + For details about the algorithm check the + liberally licensed reference implementation sources: + + resp. + + sd_booted() is implemented + in the reference implementation's drop-in + sd-daemon.c and + sd-daemon.h files. It is + recommended that applications consuming these APIs + copy the implementation into their source tree. For + more details about the reference implementation see + sd_daemon7 + + If -DDISABLE_SYSTEMD is set during compilation + this function will always return 0 and otherwise + become a NOP. + + + + See Also + + sd_daemon7, + systemd8 + + + + -- cgit v1.2.3-54-g00ecf