SD_BUS_SL...ESCRIPTION(3)

🌸 NAME 🌸

okay so welcome to SD_BUS_SL...ESCRIPTION(3), bestie β€” the manual page for sd_bus_slot_set_description() and sd_bus_slot_get_description(), aka the little duo that sets or queries the description of bus slot objects. No cap, that's the whole vibe. ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <systemd/sd-bus.h>

int sd_bus_slot_set_description(sd_bus_slot* slot,
                                const char *description);

int sd_bus_slot_get_description(sd_bus_slot* bus,
                                const char **description);

πŸ’– DESCRIPTION πŸ’–

sd_bus_slot_set_description() sets the description string that is used in logging to the specified string. The string is copied internally and freed when the bus slot object is deallocated. The description argument may be NULL, in which case the description is unset. Slay, but also: it's copied, so it's not just vibing on your pointer forever. 🫢

sd_bus_slot_get_description() returns a description string in description. If the string is not set, e.g. with sd_bus_slot_set_description(), and the slot is a bus match callback slot, the match string will be returned. Otherwise, -ENXIO is returned. That's the fallback lore, iykyk. 😭

⭐ RETURN VALUE ⭐

On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error code. fr fr, no mystery numbers. πŸ”₯

πŸŽ€ Errors πŸŽ€

Returned errors may indicate the following problems:

  • -EINVAL β€” a required argument is NULL. Bestie, you forgot something. πŸ™ˆ
  • -ENXIO β€” the bus slot object has no description. It's giving "no thoughts, head empty." πŸ’€
  • -ENOMEM β€” memory allocation failed. The malloc said nope. 😭

🧚 NOTES 🧚

Functions described here are available as a shared library, which can be compiled against and linked to with the libsystemd pkg-config(1) file. Link it, bestie. ✨

All functions listed here are thread-agnostic and only a single thread may operate on a given object at any given time. Different threads may access the same object at different times. Multiple independent objects may be used from different threads in parallel. So: one thread per object at a time, but the timeline can hand objects around, and separate objects can do parallel main character energy. πŸ‘‘

The code described here uses getenv(3), which is declared to be not multi-thread-safe. This means that the code calling the functions described here must not call setenv(3) from a parallel thread. It is recommended to only do calls to setenv() from an early phase of the program when no other threads have been started. This is the one where I need you to pay attention, okay? No parallel setenv(3) chaos. 🚨

🌈 HISTORY 🌈

sd_bus_slot_set_description() and sd_bus_slot_get_description() were added in version 240. A little retro icon, but still iconic. πŸŽ€

πŸ”₯ SEE ALSO πŸ”₯


mwah πŸ’– β€” source/version: systemd 261.3; the footer didn't give me a date, so no fake date from me, bestie. Page title: SD_BUS_SL...ESCRIPTION(3). πŸŽ€

πŸ“¦ where this page comes from