| 1 |
<?xml version='1.0'?> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="sd_varlink_set_relative_timeout" xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 7 |
|
| 8 |
<refentryinfo> |
| 9 |
<title>sd_varlink_set_relative_timeout</title> |
| 10 |
<productname>systemd</productname> |
| 11 |
</refentryinfo> |
| 12 |
|
| 13 |
<refmeta> |
| 14 |
<refentrytitle>sd_varlink_set_relative_timeout</refentrytitle> |
| 15 |
<manvolnum>3</manvolnum> |
| 16 |
</refmeta> |
| 17 |
|
| 18 |
<refnamediv> |
| 19 |
<refname>sd_varlink_set_relative_timeout</refname> |
| 20 |
|
| 21 |
<refpurpose>Set method call time-out</refpurpose> |
| 22 |
</refnamediv> |
| 23 |
|
| 24 |
<refsynopsisdiv> |
| 25 |
<funcsynopsis> |
| 26 |
<funcsynopsisinfo>#include <systemd/sd-varlink.h></funcsynopsisinfo> |
| 27 |
|
| 28 |
<funcprototype> |
| 29 |
<funcdef>int <function>sd_varlink_set_relative_timeout</function></funcdef> |
| 30 |
<paramdef>sd_varlink *<parameter>link</parameter></paramdef> |
| 31 |
<paramdef>uint64_t <parameter>usec</parameter></paramdef> |
| 32 |
</funcprototype> |
| 33 |
|
| 34 |
</funcsynopsis> |
| 35 |
</refsynopsisdiv> |
| 36 |
|
| 37 |
<refsect1> |
| 38 |
<title>Description</title> |
| 39 |
|
| 40 |
<para><function>sd_varlink_set_relative_timeout()</function> sets the relative timeout in µs to enforce |
| 41 |
on Varlink method calls. A default time-out of 45s (currently) applies, which may be changed with this |
| 42 |
call. Set to <constant>UINT64_MAX</constant> to disable the time-out, and to 0 to revert to revert back |
| 43 |
to the default time-out. The time-out begins whenever a method call is started, and if no response is |
| 44 |
received by the time the time-out elapses a synthetic <constant>io.systemd.TimedOut</constant> error is |
| 45 |
raised as client-generated reply to the method call.</para> |
| 46 |
|
| 47 |
<para>This call is particularly useful for method calls issued via |
| 48 |
<function>sd_varlink_observe()</function> that shall remain open continuously for a long time.</para> |
| 49 |
</refsect1> |
| 50 |
|
| 51 |
<refsect1> |
| 52 |
<title>Return Value</title> |
| 53 |
|
| 54 |
<para>On success, <function>sd_varlink_set_relative_timeout()</function> returns a non-negative integer. On |
| 55 |
failure, it returns a negative errno-style error code.</para> |
| 56 |
|
| 57 |
<refsect2> |
| 58 |
<title>Errors</title> |
| 59 |
|
| 60 |
<para>Returned errors may indicate the following problems:</para> |
| 61 |
|
| 62 |
<variablelist> |
| 63 |
<varlistentry> |
| 64 |
<term><constant>-EINVAL</constant></term> |
| 65 |
|
| 66 |
<listitem><para>An argument is invalid.</para></listitem> |
| 67 |
</varlistentry> |
| 68 |
</variablelist> |
| 69 |
</refsect2> |
| 70 |
</refsect1> |
| 71 |
|
| 72 |
<xi:include href="libsystemd-pkgconfig.xml" /> |
| 73 |
|
| 74 |
<refsect1> |
| 75 |
<title>History</title> |
| 76 |
<para><function>sd_varlink_set_relative_timeout()</function> was added in version 257.</para> |
| 77 |
</refsect1> |
| 78 |
|
| 79 |
<refsect1> |
| 80 |
<title>See Also</title> |
| 81 |
|
| 82 |
<para><simplelist type="inline"> |
| 83 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 84 |
<member><citerefentry><refentrytitle>sd-varlink</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 85 |
</simplelist></para> |
| 86 |
</refsect1> |
| 87 |
|
| 88 |
</refentry> |