SD_BUS_GET_METHOD_CALL_TIMEOUT(3)
π sd_bus_set_method_call_timeout, sd_bus_get_method_call_timeout β section 3 of the systemd manual, bestie
okay so real talk, this is the SD_BUS_GET_METHOD_CALL_TIMEOUT(3) page and it's genuinely so useful β it's all about the default D-Bus method call timeout on a bus object. two functions, one vibe: set it or read it. let's go π«Ά
β¨ NAME β¨
sd_bus_set_method_call_timeout, sd_bus_get_method_call_timeout β set or query the default D-Bus method call timeout of a bus object. that's it, that's the whole personality π
π¦ SYNOPSIS π¦
#include <systemd/sd-bus.h>
int sd_bus_set_method_call_timeout(sd_bus *bus, uint64_t usec);
int sd_bus_get_method_call_timeout(sd_bus *bus, uint64_t *ret);
π DESCRIPTION π
sd_bus_set_method_call_timeout() sets the default D-Bus method call timeout of bus to usec microseconds. slay, you're in charge now β¨
sd_bus_get_method_call_timeout() queries the default D-Bus method call timeout of bus. and here's where it gets kinda dramatic, so pay attention bestie:
- if no method call timeout was set using
sd_bus_set_method_call_timeout(), the timeout is read from the$SYSTEMD_BUS_TIMEOUTenvironment variable π - if that environment variable is unset, or does not contain a valid timeout, the implementation falls back to a predefined method call timeout of 25 seconds π
β οΈ heads up!$SYSTEMD_BUS_TIMEOUTis read once and cached, so callers should not rely on being able to change the default method call timeout at runtime by changing the value of$SYSTEMD_BUS_TIMEOUT. no cap, it will not work. instead, callsd_bus_set_method_call_timeout()to change the default method call timeout. periodt π
π₯ RETURN VALUE π₯
on success, these functions return a non-negative integer. on failure, they return a negative errno-style error code. classic.
π Errors
returned errors may indicate the following problems:
-EINVALβ the parametersbusorretare NULL. π
Added in version 246.
-ENOPKGβ bus objectbuscould not be resolved. π
Added in version 246.
πΈ NOTES πΈ
- functions described here are available as a shared library, which can be compiled against and linked to with the
libsystemdpkg-config(1)file. iykyk π§ - 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 politely bestie π
- 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 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. no parallel setenv shenanigans, ok? π ββοΈ
π HISTORY π
sd_bus_set_method_call_timeout() and sd_bus_get_method_call_timeout() were added in version 246. iconic behavior honestly β
π SEE ALSO π
systemd(1), sd-bus(3), sd_bus_call(3)
and that's the whole page, bestie π this one's from systemd 261.3 β go forth and set your timeouts responsibly, mwah ππ¦π
π¦ 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