SD_BUS_SLOT_GET_BUS(3)
π NAME π
Okay bestie, welcome to the SD_BUS_SLOT_GET_BUS(3) page β manual name sd_bus_slot_get_bus β starring sd_bus_slot_get_bus, sd_bus_slot_get_current_handler, sd_bus_slot_get_current_message, and sd_bus_slot_get_current_userdata. Itβs literally the βquery information attached to a bus slot objectβ squad, and yes, they ate. π
πΈ SYNOPSIS πΈ
#include <systemd/sd-bus.h>
typedef int (*sd_bus_message_handler_t)(sd_bus_message *m,
void *userdata,
sd_bus_error *ret_error);
sd_bus *sd_bus_slot_get_bus(sd_bus_slot *slot);
sd_bus_message_handler_t
sd_bus_slot_get_current_handler(sd_bus_slot *slot);
sd_bus_message *sd_bus_slot_get_current_message(sd_bus_slot *slot);
void *sd_bus_slot_get_current_userdata(sd_bus_slot *slot);
π¦ DESCRIPTION π¦
sd_bus_slot_get_bus() returns the bus object that message slot is attached to. Itβs giving βwhoβs your bus bestie?β and honestly, iconic. β¨
sd_bus_slot_get_current_handler(), sd_bus_slot_get_current_message(), and sd_bus_slot_get_current_userdata() return the current handler, message, and userdata respectively of the bus slot is attached to if weβre currently executing the callback associated with slot. Basically: when the callback is happening, these let you peek at the current cast and crew. π
π RETURN VALUE π
sd_bus_slot_get_bus() always returns the bus object. No cap. π«Ά
On success, sd_bus_slot_get_current_handler(), sd_bus_slot_get_current_message(), and sd_bus_slot_get_current_userdata() return the requested object. On failure, they return NULL. π
π NOTES π
These functions described here are available as a shared library, which can be compiled against and linked to with the libsystemd pkg-config(1) file. Slay, link it properly. π₯
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. Thatβs the thread lore, bestie. π§
β οΈ The code described here usesgetenv(3), which is declared to be not multi-thread-safe. This means that the code calling the functions described here must not callsetenv(3)from a parallel thread. It is recommended to only do calls tosetenv()from an early phase of the program when no other threads have been started. Please donβt do a chaotic parallelsetenv(), Iβm begging. π
β HISTORY β
sd_bus_slot_get_bus(), sd_bus_slot_get_current_handler(), sd_bus_slot_get_current_message(), and sd_bus_slot_get_current_userdata() were added in version 246. A little vintage, a little legendary. π
π SEE ALSO π
Signing off from the SD_BUS_SLOT_GET_BUS(3) page under systemd 261.3 β thatβs the source/version in the footer, and thereβs no date shown in it, so Iβm not inventing one, periodt. Stay cozy, query those slots, and hydrate. ππ
β¨
π¦ where this page comes from
- ubuntu stonking: libsystemd-dev 261.3-0ubuntu3 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms