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+ -->
6 <refentry id=
"sd_bus_reply_method_return"
7 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
10 <title>sd_bus_reply_method_return
</title>
11 <productname>systemd
</productname>
15 <refentrytitle>sd_bus_reply_method_return
</refentrytitle>
16 <manvolnum>3</manvolnum>
20 <refname>sd_bus_reply_method_return
</refname>
21 <refname>sd_bus_reply_method_returnv
</refname>
23 <refpurpose>Reply to a D-Bus method call
</refpurpose>
28 <funcsynopsisinfo>#include
<systemd/sd-bus.h
></funcsynopsisinfo>
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>
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>
47 <title>Description
</title>
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
58 <title>Return Value
</title>
60 <para>On success, this function returns a non-negative integer. On failure, it returns a
61 negative errno-style error code.
</para>
66 <para>Returned errors may indicate the following problems:
</para>
70 <term><constant>-EINVAL
</constant></term>
72 <listitem><para>The input parameter
<parameter>call
</parameter> is
73 <constant>NULL
</constant>.
</para>
75 <para>Message
<parameter>call
</parameter> is not a method call message.
78 <para>Message
<parameter>call
</parameter> is not attached to a bus.
</para>
83 <term><constant>-EPERM
</constant></term>
85 <listitem><para>Message
<parameter>call
</parameter> has been sealed.
90 <term><constant>-ENOTCONN
</constant></term>
92 <listitem><para>The bus to which message
<parameter>call
</parameter> is attached is not
93 connected.
</para></listitem>
97 <term><constant>-ENOMEM
</constant></term>
99 <listitem><para>Memory allocation failed.
</para></listitem>
103 <para>In addition, any error returned by
104 <citerefentry><refentrytitle>sd_bus_send
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
105 may be returned.
</para>
109 <xi:include href=
"libsystemd-pkgconfig.xml" />
112 <title>See Also
</title>
115 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
116 <citerefentry><refentrytitle>sd-bus
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
117 <citerefentry><refentrytitle>sd_bus_message_new_method_return
</refentrytitle><manvolnum>3</manvolnum></citerefentry>