SD_VARLI...E_TIMEOUT(3)
π SD_VARLI...E_TIMEOUT(3) π
okay bestie, sit down, we're talking about sd_varlink_set_relative_timeout from the sd_varlink_set_relative_timeout section of the manual, and honestly? it's giving timekeeper energy π
β¨ NAME β¨
sd_varlink_set_relative_timeout β set the method call time-out, aka the vibe check for how long your Varlink call is allowed to ghost you π
πΈ SYNOPSIS πΈ
#include <systemd/sd-varlink.h>
int sd_varlink_set_relative_timeout(sd_varlink *link, uint64_t usec);
π¦ DESCRIPTION π¦
so sd_varlink_set_relative_timeout() sets the relative timeout in Β΅s that gets enforced on Varlink method calls. fr fr, that's the whole job.
There's a default time-out of 45s (currently, as in that's what it is right now, don't come for me) that just applies on its own, and this call is how you change it.
- Set it to
UINT64_MAXto disable the time-out entirely β no clock, no limits, no stress π - Set it to
0to revert back to the default time-out π
The time-out begins whenever a method call is started, and if no response is received by the time the time-out elapses, a synthetic io.systemd.TimedOut error is raised as a client-generated reply to the method call. so like, nobody actually replies β the client just makes one up and hands it over. iconic behavior honestly.
ngl this call is particularly useful for method calls issued via sd_varlink_observe() that are supposed to remain open continuously for a long time. long-distance relationship calls need a different curfew, yk? π«Ά
β RETURN VALUE β
- On success,
sd_varlink_set_relative_timeout()returns a non-negative integer π₯³ - On failure, it returns a negative errno-style error code π
π Errors
Returned errors may indicate the following problems:
-EINVALβ an argument is invalid. one of your args said something wrong and got caught. π
π 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. slay, link it up β¨
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.
β οΈ okay so this part is important: don't be out here calling setenv() from a parallel thread while this stuff is running. do it early, before any other threads wake up. main character energy means doing your setup first, periodt.
π HISTORY π
sd_varlink_set_relative_timeout() was added in version 257. a real one, a legend, a classic π
π SEE ALSO π
and that's the whole page bestie!! this came to you from systemd 262.1, the SD_VARLI...E_TIMEOUT(3) page, and yes the truncated title is on purpose, it's the manual's little mystery π§ go forth and set your timeouts wisely ππΈ
π¦ where this page comes from
- arch rolling: systemd-libs 262.1-1 Β· LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later WITH Linux-syscall-note
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms