LIBSYSTEMD(3)

πŸ’… LIBSYSTEMD(3) πŸ’…

okay so bestie, welcome to the libsystemd manual page (that's libsystemd, section 3 of the manual β€” iykyk) πŸŽ€


✨ NAME ✨

libsystemd β€” the functions for implementing services and for interacting with systemd πŸ’–


🌸 SYNOPSIS 🌸

like, here's literally everything you can include, no cap:

#include <systemd/sd-bus.h>
#include <systemd/sd-daemon.h>
#include <systemd/sd-device.h>
#include <systemd/sd-event.h>
#include <systemd/sd-gpt.h>
#include <systemd/sd-hwdb.h>
#include <systemd/sd-id128.h>
#include <systemd/sd-journal.h>
#include <systemd/sd-json.h>
#include <systemd/sd-login.h>
#include <systemd/sd-messages.h>
#include <systemd/sd-path.h>
#include <systemd/sd-varlink.h>

and then to actually build against it, you do:

pkg-config --cflags --libs libsystemd

slay, that's the whole setup 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the libsystemd library is giving main character energy β€” it hands you a whole bunch of functions that let you interact with the various interfaces that the systemd(1) service manager provides, plus a bunch of other functions and constants that are just, like, genuinely useful for implementing services in general ✨

and if you wanna know about the different parts of the library interface, go read sd-bus(3), sd-bus-errors(3), sd-daemon(3), sd-device(3), sd-event(3), sd-hwdb(3), sd-id128(3), sd-journal(3), sd-json(3), sd-login(3), sd-path(3), and sd-varlink(3) β€” they're all right there, iconic behavior honestly πŸ‘‘


πŸ‘‘ INTERFACE STABILITY πŸ‘‘

strict backwards-compatibility is maintained for the API (application programming interface) and the ABI (application binary interface), fr fr. they use symbol versioning, which means symbols only ever get added β€” they never get removed πŸ’… periodt.


πŸŽ€ NOTES πŸŽ€

the functions described here are available as a shared library, which you can compile against and link to with the libsystemd pkg-config(1) file 🌸

⚠️ okay important safety moment: the code described here uses getenv(3), and getenv(3) is declared to be not multi-thread-safe. that means any code calling the functions described here must not call setenv(3) from a parallel thread. the recommendation is to only do calls to setenv() from an early phase of the program, back when no other threads have been started yet. like, do it before the party starts 🧚

🌈 SEE ALSO 🌈

systemd(1), libudev(3), pkg-config(1), Interface Portability and Stability Promise[1]


πŸ’œ NOTES πŸ’œ

  1. Interface Portability and Stability Promise https://systemd.io/PORTABILITY_AND_STABILITY/

ok that's the whole page bestie, go build something iconic πŸ¦‹πŸ’–

systemd 261.3 Β· LIBSYSTEMD(3) β€” mwah, catch you in the next manpage πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from