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 -->
5
6<refentry id="sd_bus_reply_method_return"
7          xmlns:xi="http://www.w3.org/2001/XInclude">
8
9  <refentryinfo>
10    <title>sd_bus_reply_method_return</title>
11    <productname>systemd</productname>
12  </refentryinfo>
13
14  <refmeta>
15    <refentrytitle>sd_bus_reply_method_return</refentrytitle>
16    <manvolnum>3</manvolnum>
17  </refmeta>
18
19  <refnamediv>
20    <refname>sd_bus_reply_method_return</refname>
21    <refname>sd_bus_reply_method_returnv</refname>
22
23    <refpurpose>Reply to a D-Bus method call</refpurpose>
24  </refnamediv>
25
26  <refsynopsisdiv>
27    <funcsynopsis>
28      <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
29
30      <funcprototype>
31        <funcdef>int sd_bus_reply_method_return</funcdef>
32        <paramdef>sd_bus_message *<parameter>call</parameter></paramdef>
33        <paramdef>const char *<parameter>types</parameter></paramdef>
34        <paramdef>...</paramdef>
35      </funcprototype>
36
37      <funcprototype>
38        <funcdef>int sd_bus_reply_method_returnv</funcdef>
39        <paramdef>sd_bus_message *<parameter>call</parameter></paramdef>
40        <paramdef>const char *<parameter>types</parameter></paramdef>
41        <paramdef>va_list <parameter>ap</parameter></paramdef>
42      </funcprototype>
43    </funcsynopsis>
44  </refsynopsisdiv>
45
46  <refsect1>
47    <title>Description</title>
48
49    <para><function>sd_bus_reply_method_return()</function> sends a reply to the
50    <parameter>call</parameter> message. The type string <parameter>types</parameter> and the
51    arguments that follow it must adhere to the format described in
52    <citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
53    If no reply is expected to <parameter>call</parameter>, this function succeeds without sending a
54    reply.</para>
55  </refsect1>
56
57  <refsect1>
58    <title>Return Value</title>
59
60    <para>On success, this function returns a non-negative integer. On failure, it returns a
61    negative errno-style error code.</para>
62
63    <refsect2>
64      <title>Errors</title>
65
66      <para>Returned errors may indicate the following problems:</para>
67
68      <variablelist>
69        <varlistentry>
70          <term><constant>-EINVAL</constant></term>
71
72          <listitem><para>The input parameter <parameter>call</parameter> is
73          <constant>NULL</constant>.</para>
74
75          <para>Message <parameter>call</parameter> is not a method call message.
76          </para>
77
78          <para>Message <parameter>call</parameter> is not attached to a bus.</para>
79
80          <para>Message <parameter>m</parameter> is not a method reply message.</para>
81          </listitem>
82        </varlistentry>
83
84        <varlistentry>
85          <term><constant>-EPERM</constant></term>
86
87          <listitem><para>Message <parameter>call</parameter> has been sealed.
88          </para></listitem>
89        </varlistentry>
90
91        <varlistentry>
92          <term><constant>-ENOTCONN</constant></term>
93
94          <listitem><para>The bus to which message <parameter>call</parameter> is attached is not
95          connected.</para></listitem>
96        </varlistentry>
97
98        <varlistentry>
99          <term><constant>-ENOMEM</constant></term>
100
101          <listitem><para>Memory allocation failed.</para></listitem>
102        </varlistentry>
103      </variablelist>
104
105      <para>In addition, any error returned by
106      <citerefentry><refentrytitle>sd_bus_send</refentrytitle><manvolnum>1</manvolnum></citerefentry>
107      may be returned.</para>
108    </refsect2>
109  </refsect1>
110
111  <xi:include href="libsystemd-pkgconfig.xml" />
112
113  <refsect1>
114    <title>See Also</title>
115
116    <para>
117      <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
118      <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
119      <citerefentry><refentrytitle>sd_bus_message_new_method_return</refentrytitle><manvolnum>3</manvolnum></citerefentry>
120    </para>
121  </refsect1>
122
123</refentry>
124