]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_bus_set_sender.xml
tree-wide: remove Lennart's copyright lines
[thirdparty/systemd.git] / man / sd_bus_set_sender.xml
CommitLineData
d97eac36
LP
1<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<!--
6 SPDX-License-Identifier: LGPL-2.1+
d97eac36
LP
7-->
8
9<refentry id="sd_bus_set_sender">
10
11 <refentryinfo>
12 <title>sd_bus_set_sender</title>
13 <productname>systemd</productname>
14
15 <authorgroup>
16 <author>
17 <contrib>Developer</contrib>
18 <firstname>Lennart</firstname>
19 <surname>Poettering</surname>
20 <email>lennart@poettering.net</email>
21 </author>
22 </authorgroup>
23 </refentryinfo>
24
25 <refmeta>
26 <refentrytitle>sd_bus_set_sender</refentrytitle>
27 <manvolnum>3</manvolnum>
28 </refmeta>
29
30 <refnamediv>
31 <refname>sd_bus_set_sender</refname>
32 <refname>sd_bus_get_sender</refname>
33
34 <refpurpose>Configure default sender for outgoing messages</refpurpose>
35 </refnamediv>
36
37 <refsynopsisdiv>
38 <funcsynopsis>
39 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
40
41 <funcprototype>
42 <funcdef>int <function>sd_bus_set_sender</function></funcdef>
43 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
44 <paramdef>const char* <parameter>name</parameter></paramdef>
45 </funcprototype>
46
47 <funcprototype>
48 <funcdef>int <function>sd_bus_get_sender</function></funcdef>
49 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
50 <paramdef>const char** <parameter>name</parameter></paramdef>
51 </funcprototype>
52
53 </funcsynopsis>
54 </refsynopsisdiv>
55
56 <refsect1>
57 <title>Description</title>
58
59 <para><function>sd_bus_set_sender()</function> configures the default sender service name to use for outgoing
60 messages. The service name specified in the <parameter>name</parameter> parameter is set on all outgoing messages
61 that are sent on the connection and have no sender set yet, for example through
62 <citerefentry><refentrytitle>sd_bus_message_set_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>. Note
63 that this function is only supported on direct connections, i.e. not on connections to a bus broker as the broker
64 will fill in the sender service name automatically anyway. By default no sender name is configured, and hence
65 messages are sent without sender field set. If the <parameter>name</parameter> parameter is specified as
66 <constant>NULL</constant> the default sender service name is cleared, returning to the default state if a default
67 sender service name was set before. If passed as non-<constant>NULL</constant> the specified name must be a valid
68 unique or well-known service name.</para>
69
70 <para><function>sd_bus_get_sender()</function> may be used to query the current default service name for outgoing
71 messages.</para>
72 </refsect1>
73
74 <refsect1>
75 <title>Return Value</title>
76
77 <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style
78 error code.</para>
79 </refsect1>
80
81 <refsect1>
82 <title>Errors</title>
83
84 <para>Returned errors may indicate the following problems:</para>
85
86 <variablelist>
87 <varlistentry>
88 <term><constant>-ECHILD</constant></term>
89
90 <listitem><para>The bus connection has been created in a different process.</para></listitem>
91 </varlistentry>
92
93 <varlistentry>
94 <term><constant>-EPERM</constant></term>
95
96 <listitem><para>The specified bus connection object is a not a direct but a brokered connection.</para></listitem>
97 </varlistentry>
98 </variablelist>
99 </refsect1>
100
101 <refsect1>
102 <title>Notes</title>
103
104 <para><function>sd_bus_set_sender()</function> and <function>sd_bus_get_sender()</function> are available as
105 a shared library, which can be compiled and linked to with the <constant>libsystemd</constant> <citerefentry
106 project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry> file.</para>
107 </refsect1>
108
109 <refsect1>
110 <title>See Also</title>
111
112 <para>
113 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
114 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
115 <citerefentry><refentrytitle>sd_bus_message_set_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>
116 </para>
117 </refsect1>
118
119</refentry>