]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_bus_set_sender.xml
journalctl: support `-b all` to negate effect of -b
[thirdparty/systemd.git] / man / sd_bus_set_sender.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
3a54a157
ZJS
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
0307f791 4<!-- SPDX-License-Identifier: LGPL-2.1+ -->
d97eac36 5
7647c01d
LP
6<refentry id="sd_bus_set_sender"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
d97eac36
LP
8
9 <refentryinfo>
10 <title>sd_bus_set_sender</title>
11 <productname>systemd</productname>
d97eac36
LP
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>sd_bus_set_sender</refentrytitle>
16 <manvolnum>3</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>sd_bus_set_sender</refname>
21 <refname>sd_bus_get_sender</refname>
22
23 <refpurpose>Configure default sender for outgoing messages</refpurpose>
24 </refnamediv>
25
26 <refsynopsisdiv>
27 <funcsynopsis>
28 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
29
30 <funcprototype>
31 <funcdef>int <function>sd_bus_set_sender</function></funcdef>
32 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
33 <paramdef>const char* <parameter>name</parameter></paramdef>
34 </funcprototype>
35
36 <funcprototype>
37 <funcdef>int <function>sd_bus_get_sender</function></funcdef>
38 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
39 <paramdef>const char** <parameter>name</parameter></paramdef>
40 </funcprototype>
41
42 </funcsynopsis>
43 </refsynopsisdiv>
44
45 <refsect1>
46 <title>Description</title>
47
48 <para><function>sd_bus_set_sender()</function> configures the default sender service name to use for outgoing
49 messages. The service name specified in the <parameter>name</parameter> parameter is set on all outgoing messages
50 that are sent on the connection and have no sender set yet, for example through
51 <citerefentry><refentrytitle>sd_bus_message_set_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>. Note
52 that this function is only supported on direct connections, i.e. not on connections to a bus broker as the broker
53 will fill in the sender service name automatically anyway. By default no sender name is configured, and hence
54 messages are sent without sender field set. If the <parameter>name</parameter> parameter is specified as
55 <constant>NULL</constant> the default sender service name is cleared, returning to the default state if a default
56 sender service name was set before. If passed as non-<constant>NULL</constant> the specified name must be a valid
57 unique or well-known service name.</para>
58
59 <para><function>sd_bus_get_sender()</function> may be used to query the current default service name for outgoing
60 messages.</para>
61 </refsect1>
62
63 <refsect1>
64 <title>Return Value</title>
65
66 <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style
67 error code.</para>
68 </refsect1>
69
70 <refsect1>
71 <title>Errors</title>
72
73 <para>Returned errors may indicate the following problems:</para>
74
75 <variablelist>
76 <varlistentry>
77 <term><constant>-ECHILD</constant></term>
78
79 <listitem><para>The bus connection has been created in a different process.</para></listitem>
80 </varlistentry>
81
82 <varlistentry>
83 <term><constant>-EPERM</constant></term>
84
85 <listitem><para>The specified bus connection object is a not a direct but a brokered connection.</para></listitem>
86 </varlistentry>
87 </variablelist>
88 </refsect1>
89
7647c01d 90 <xi:include href="libsystemd-pkgconfig.xml" />
d97eac36
LP
91
92 <refsect1>
93 <title>See Also</title>
94
95 <para>
96 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
97 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
98 <citerefentry><refentrytitle>sd_bus_message_set_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>
99 </para>
100 </refsect1>
101
102</refentry>