---
name: "sd_varlink_set_relative_timeout"
section: "3"
platform: "linux"
package: "systemd-libs"
version: "262.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/sd_varlink_set_relative_timeout"
---

# sd\_varlink\_set\_relative\_timeout(3)

Set method call time-out

## NAME

sd\_varlink\_set\_relative\_timeout - Set method call time-out

## SYNOPSIS

```
#include <systemd/sd-varlink.h>
```

**int sd\_varlink\_set\_relative\_timeout(sd\_varlink \****link***, uint64\_t** *usec***);**

## DESCRIPTION

**sd\_varlink\_set\_relative\_timeout()** sets the relative timeout in s to enforce on Varlink method calls. A default time-out of 45s (currently) applies, which may be changed with this call. Set to **UINT64\_MAX** to disable the time-out, and to 0 to revert 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 client-generated reply to the method call.

This call is particularly useful for method calls issued via **sd\_varlink\_observe()** that shall remain open continuously for a long time.

## 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.

## NOTES

Functions described here are available as a shared library, which can be compiled against and linked to with the **libsystemd** [**pkg-config**(1)](/pkg-config/1.md) file.

The code described here uses [**getenv**(3)](/getenv/3.md), which is declared to be not multi-thread-safe. This means that the code calling the functions described here must not call [**setenv**(3)](/setenv/3.md) 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.

## HISTORY

**sd\_varlink\_set\_relative\_timeout()** was added in version 257.

## SEE ALSO

[**systemd**(1)](/systemd/1.md), [**sd-varlink**(3)](/sd-varlink/3.md)
