SD_BUS_CAN_SEND(3)
π SD_BUS_CAN_SEND(3) π
okay so bestie, welcome to sd_bus_can_send β that's the page you're on, from the sd_bus_can_send corner of the systemd manuals, and it's literally the "can I send this tho?" function. tiny page, big vibes, let's go β¨
πΈ NAME πΈ
sd_bus_can_send β check which types can be sent over a bus object π¦
β¨ SYNOPSIS β¨
#include <systemd/sd-bus.h>
int sd_bus_can_send(sd_bus *bus, char type);
π DESCRIPTION π
so sd_bus_can_send() is mostly used for checking if file descriptor passing is available on the given bus. that's the main character use case, fr fr π
type can be any of the SD_BUS_TYPE constants. any of them. it's giving "pick your fighter" π
π RETURN VALUE π
ngl the return value here is doing a whole three-ways thing:
- on failure,
sd_bus_can_send()returns a negative errno-style error code π - if values of the given type can be sent over the given bus, it returns a positive integer β slay β
- otherwise, it returns zero β nope, not today π
π Errors π
returned errors may indicate the following problems:
-ENOPKGβ the bus objectbuscould not be resolved. it's lost in the void, bestie π«-ENOTCONNβ the input parameterbusisNULLor the bus is not connected. no connection, no conversation π΅-ECHILDβ the bus objectbuswas created in a different process. not your bus, not your problem, it's not gonna talk to you π«
π§ NOTES π§
the 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, love it, pkg-config it π
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 likeβ¦ share the object, don't share the object at the same time, ykwim? β
β οΈ 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. like, do your environment stuff first, before the party starts π lowkey important, no cap.
π HISTORY π
sd_bus_can_send() was added in version 221. an icon, a legend, a moment π
π₯ SEE ALSO π₯
and that's the whole page, bestie π«Ά β brought to you by systemd 261.3, which is literally the source of this whole manual page moment. go forth and vibe check your bus types ππ β¨
π¦ 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