SD_BUS_PE...THOD_CALLS(3)
β¨ SD_BUS_PE...THOD_CALLS(3) β¨
okay so bestie, this one's from the sd_bus_pending_method_calls corner of the manual, and it's genuinely so useful β it's the "how many texts have I sent that they haven't replied to yet" of D-Bus π
πΈ NAME πΈ
sd_bus_pending_method_calls β returns the number of currently pending, outgoing method calls π
π¦ SYNOPSIS π¦
#include <systemd/sd-bus.h>
int sd_bus_pending_method_calls(sd_bus *bus);
π DESCRIPTION π
so sd_bus_pending_method_calls() literally just hands you back the count of currently pending outgoing method calls. and what does that mean? it means method calls that were enqueued with sd_bus_call_async(3) where no reply has come back yet, and which haven't hit a timeout yet either. like, still in flight, still waiting on read receipts, no cap π«Ά
and here's the cute part: the bus argument can totally be NULL, and in that case you just get zero back. no drama, no crash, just a lil zero β¨
β RETURN VALUE β
this function returns 0 if there are no pending method calls, or if a NULL bus object was specified. and if something goes wrong? you get a negative errno-style error code back. π
π Errors
the errors it can throw at you may indicate these problems:
-ECHILDβ the bus connection was created in a different process, library or module instance. like, wrong group chat entirely, bestie π
π 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. slay π
all functions listed here are thread-agnostic, and only a single thread may operate on a given object at any given time. different threads can access the same object at different times, and multiple independent objects can be used from different threads in parallel. so like β share the object, just not at the same second, iykyk π
heads up bestie: the code described here usesgetenv(3), which is declared to be not multi-thread-safe. that means the code calling the functions described here must not callsetenv(3)from a parallel thread. the recommendation is to only do calls tosetenv()from an early phase of the program, when no other threads have been started yet. don't be messy about it π
π§ HISTORY π§
sd_bus_pending_method_calls() was added in version 257. iconic behavior, honestly π
π SEE ALSO π
systemd(1), sd-bus(3), sd_bus_call_async(3)
and that's the whole page, bestie β brought to you by systemd 261.3, the version this gorgeous lil manual page ships with. go count those pending calls, you're gonna ate πβ¨π
π¦ 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