1:255.16-alt1
[systemd_ALT.git] / man / sd_bus_set_method_call_timeout.xml
blob293bbcb67dc0d1fb23d4912443eef5b24c40920d
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.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id="sd_bus_set_method_call_timeout" xmlns:xi="http://www.w3.org/2001/XInclude">
8   <refentryinfo>
9     <title>sd_bus_set_method_call_timeout</title>
10     <productname>systemd</productname>
11   </refentryinfo>
13   <refmeta>
14     <refentrytitle>sd_bus_set_method_call_timeout</refentrytitle>
15     <manvolnum>3</manvolnum>
16   </refmeta>
18   <refnamediv>
19     <refname>sd_bus_set_method_call_timeout</refname>
20     <refname>sd_bus_get_method_call_timeout</refname>
22     <refpurpose>Set or query the default D-Bus method call timeout of a bus object</refpurpose>
23   </refnamediv>
25   <refsynopsisdiv>
26     <funcsynopsis>
27       <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
29       <funcprototype>
30         <funcdef>int <function>sd_bus_set_method_call_timeout</function></funcdef>
31         <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
32         <paramdef>uint64_t <parameter>usec</parameter></paramdef>
33       </funcprototype>
35       <funcprototype>
36         <funcdef>int <function>sd_bus_get_method_call_timeout</function></funcdef>
37         <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
38         <paramdef>uint64_t *<parameter>ret</parameter></paramdef>
39       </funcprototype>
40     </funcsynopsis>
41   </refsynopsisdiv>
43   <refsect1>
44     <title>Description</title>
46     <para><function>sd_bus_set_method_call_timeout()</function> sets the default D-Bus method call
47     timeout of <parameter>bus</parameter> to <parameter>usec</parameter> microseconds.</para>
49     <para><function>sd_bus_get_method_call_timeout()</function> queries the default D-Bus method
50     call timeout of <parameter>bus</parameter>. If no method call timeout was set using
51     <function>sd_bus_set_method_call_timeout()</function>, the timeout is read from the
52     <varname>$SYSTEMD_BUS_TIMEOUT</varname> environment variable. If this environment variable is
53     unset or does not contain a valid timeout, the implementation falls back to a predefined method
54     call timeout of 25 seconds. Note that <varname>$SYSTEMD_BUS_TIMEOUT</varname> is read once and
55     cached so callers should not rely on being able to change the default method call timeout at
56     runtime by changing the value of <varname>$SYSTEMD_BUS_TIMEOUT</varname>. Instead, call
57     <function>sd_bus_set_method_call_timeout()</function> to change the default method call timeout.
58     </para>
59   </refsect1>
61   <refsect1>
62     <title>Return Value</title>
64     <para>On success, these functions return a non-negative integer. On failure, they return a
65     negative errno-style error code.</para>
67     <refsect2>
68       <title>Errors</title>
70       <para>Returned errors may indicate the following problems:</para>
72       <variablelist>
73         <varlistentry>
74           <term><constant>-EINVAL</constant></term>
76           <listitem><para>The parameters <parameter>bus</parameter> or <parameter>ret</parameter>
77           are <constant>NULL</constant>.</para>
79           <xi:include href="version-info.xml" xpointer="v246"/></listitem>
80         </varlistentry>
82         <varlistentry>
83           <term><constant>-ENOPKG</constant></term>
85           <listitem><para>Bus object <parameter>bus</parameter> could not be resolved.</para>
87           <xi:include href="version-info.xml" xpointer="v246"/>
88           </listitem>
89         </varlistentry>
90       </variablelist>
92     </refsect2>
93   </refsect1>
95   <xi:include href="libsystemd-pkgconfig.xml" />
97   <refsect1>
98     <title>History</title>
99     <para><function>sd_bus_set_method_call_timeout()</function> and
100     <function>sd_bus_get_method_call_timeout()</function> were added in version 246.</para>
101   </refsect1>
103   <refsect1>
104     <title>See Also</title>
106     <para>
107       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
108       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
109       <citerefentry><refentrytitle>sd_bus_call</refentrytitle><manvolnum>3</manvolnum></citerefentry>
110     </para>
111   </refsect1>
113 </refentry>