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_MAX to disable the time-out entirely β€” no clock, no limits, no stress 😌
  • Set it to 0 to 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