]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_bus_message_set_expect_reply.xml
man: use same version in public and system ident.
[thirdparty/systemd.git] / man / sd_bus_message_set_expect_reply.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
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_bus_message_set_expect_reply" xmlns:xi="http://www.w3.org/2001/XInclude">
7
8 <refentryinfo>
9 <title>sd_bus_message_set_expect_reply</title>
10 <productname>systemd</productname>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>sd_bus_message_set_expect_reply</refentrytitle>
15 <manvolnum>3</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>sd_bus_message_set_expect_reply</refname>
20 <refname>sd_bus_message_get_expect_reply</refname>
21 <refname>sd_bus_message_set_auto_start</refname>
22 <refname>sd_bus_message_get_auto_start</refname>
23 <refname>sd_bus_message_set_allow_interactive_authorization</refname>
24 <refname>sd_bus_message_get_allow_interactive_authorization</refname>
25
26 <refpurpose>Set and query bus message metadata</refpurpose>
27 </refnamediv>
28
29 <refsynopsisdiv>
30 <funcsynopsis>
31 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
32
33 <funcprototype>
34 <funcdef>int <function>sd_bus_message_set_expect_reply</function></funcdef>
35 <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
36 <paramdef>int <parameter>b</parameter></paramdef>
37 </funcprototype>
38
39 <funcprototype>
40 <funcdef>int <function>sd_bus_message_get_expect_reply</function></funcdef>
41 <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
42 </funcprototype>
43
44 <funcprototype>
45 <funcdef>int <function>sd_bus_message_set_auto_start</function></funcdef>
46 <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
47 <paramdef>int <parameter>b</parameter></paramdef>
48 </funcprototype>
49
50 <funcprototype>
51 <funcdef>int <function>sd_bus_message_get_auto_start</function></funcdef>
52 <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
53 </funcprototype>
54
55 <funcprototype>
56 <funcdef>int <function>sd_bus_message_set_allow_interactive_authorization</function></funcdef>
57 <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
58 <paramdef>int <parameter>b</parameter></paramdef>
59 </funcprototype>
60
61 <funcprototype>
62 <funcdef>int <function>sd_bus_message_get_allow_interactive_authorization</function></funcdef>
63 <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
64 </funcprototype>
65 </funcsynopsis>
66 </refsynopsisdiv>
67
68 <refsect1>
69 <title>Description</title>
70
71 <para><function>sd_bus_message_set_expect_reply()</function> sets or clears the
72 <constant>NO_REPLY_EXPECTED</constant> flag on the message <parameter>m</parameter>. This flag matters
73 only for method call messages and is used to specify that no method return or error reply is expected.
74 It is ignored for other types. Thus, for a method call message, calling
75 <programlisting>sd_bus_message_set_expect_reply(…, 0)</programlisting> sets the flag and suppresses the
76 reply.</para>
77
78 <para><function>sd_bus_message_get_expect_reply()</function> checks if the
79 <constant>NO_REPLY_EXPECTED</constant> flag is set on the message <parameter>m</parameter>. It will
80 return positive if it is not set, and zero if it is.</para>
81
82 <para><function>sd_bus_message_set_auto_start()</function> sets or clears the
83 <constant>NO_AUTO_START</constant> flag on the message <parameter>m</parameter>. When the flag is set,
84 the bus must not launch an owner for the destination name in response to this message. Calling
85 <programlisting>sd_bus_message_set_auto_start(…, 0)</programlisting> sets the flag.</para>
86
87 <para><function>sd_bus_message_get_auto_start()</function> checks if the
88 <constant>NO_AUTO_START</constant> flag is set on the message <parameter>m</parameter>. It will return
89 positive if it is not set, and zero if it is.</para>
90
91 <para><function>sd_bus_message_set_allow_interactive_authorization()</function> sets or clears the
92 <constant>ALLOW_INTERACTIVE_AUTHORIZATION</constant> flag on the message <parameter>m</parameter>.
93 Setting this flag informs the receiver that the caller is prepared to wait for interactive authorization
94 via polkit or a similar framework. Note that setting this flag does not guarantee that the receiver will
95 actually perform interactive authorization. Also, make sure to set a suitable message timeout when using
96 this flag since interactive authorization could potentially take a long time as it depends on user input.
97 If <parameter>b</parameter> is non-zero, the flag is set.</para>
98
99 <para><function>sd_bus_message_get_allow_interactive_authorization()</function> checks if the
100 <constant>ALLOW_INTERACTIVE_AUTHORIZATION</constant> flag is set on the message <parameter>m</parameter>.
101 It will return a positive integer if the flag is set. Otherwise, it returns zero.</para>
102 </refsect1>
103
104 <refsect1>
105 <title>Return Value</title>
106
107 <para>On success, these functions return a non-negative integer. On failure, they return a negative
108 errno-style error code.</para>
109
110 <refsect2>
111 <title>Errors</title>
112
113 <para>Returned errors may indicate the following problems:</para>
114
115 <variablelist>
116 <varlistentry>
117 <term><constant>-EINVAL</constant></term>
118
119 <listitem><para>The <parameter>message</parameter> parameter is <constant>NULL</constant>.
120 </para></listitem>
121 </varlistentry>
122
123 <varlistentry>
124 <term><constant>-EPERM</constant></term>
125
126 <listitem>
127 <para>The message <parameter>message</parameter> is sealed when trying to set a flag.</para>
128
129 <para>The message <parameter>message</parameter> has wrong type.</para>
130 </listitem>
131 </varlistentry>
132 </variablelist>
133 </refsect2>
134 </refsect1>
135
136 <xi:include href="libsystemd-pkgconfig.xml" />
137
138 <refsect1>
139 <title>History</title>
140 <para><function>sd_bus_message_set_expect_reply()</function>,
141 <function>sd_bus_message_get_expect_reply()</function>,
142 <function>sd_bus_message_set_auto_start()</function>, and
143 <function>sd_bus_message_get_auto_start()</function> were added in version 240.</para>
144 <para><function>sd_bus_message_set_allow_interactive_authorization()</function> and
145 <function>sd_bus_message_get_allow_interactive_authorization()</function> were added in version 246.</para>
146 </refsect1>
147
148 <refsect1>
149 <title>See Also</title>
150
151 <para><simplelist type="inline">
152 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
153 <member><citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
154 <member><citerefentry><refentrytitle>sd_bus_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
155 </simplelist></para>
156 </refsect1>
157 </refentry>