man-pages/man3/sd_bus_set_sender.3.html
2021-03-31 01:06:50 +01:00

134 lines
3.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SD_BUS_SET_SENDER</TITLE>
</HEAD><BODY>
<H1>SD_BUS_SET_SENDER</H1>
Section: sd_bus_set_sender (3)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sd_bus_set_sender, sd_bus_get_sender - Configure default sender for outgoing messages
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>
</B><PRE>
#include &lt;<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>&gt;
</PRE>
<DL COMPACT>
<DT id="1">
<B>int sd_bus_set_sender(sd_bus&nbsp;*</B><I>bus</I><B>, const&nbsp;char*&nbsp;</B><I>name</I><B>);</B>
<DT id="2">
<B>int sd_bus_get_sender(sd_bus&nbsp;*</B><I>bus</I><B>, const&nbsp;char**&nbsp;</B><I>name</I><B>);</B>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<B>sd_bus_set_sender()</B>
<DD>configures the default sender service name to use for outgoing messages. The service name specified in the
<I>name</I>
parameter is set on all outgoing messages that are sent on the connection and have no sender set yet, for example through
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_message_set_sender">sd_bus_message_set_sender</A></B>(3). Note that this function is only supported on direct connections, i.e. not on connections to a bus broker as the broker will fill in the sender service name automatically anyway. By default no sender name is configured, and hence messages are sent without sender field set. If the
<I>name</I>
parameter is specified as
<B>NULL</B>
the default sender service name is cleared, returning to the default state if a default sender service name was set before. If passed as non-<B>NULL</B>
the specified name must be a valid unique or well-known service name.
<P>
<B>sd_bus_get_sender()</B>
may be used to query the current default service name for outgoing messages.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
<P>
On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error code.
<A NAME="lbAF">&nbsp;</A>
<H3>Errors</H3>
<P>
Returned errors may indicate the following problems:
<P>
<B>-ECHILD</B>
<DL COMPACT><DT id="3"><DD>
The bus connection has been created in a different process.
</DL>
<P>
<B>-EPERM</B>
<DL COMPACT><DT id="4"><DD>
The specified bus connection object is a not a direct but a brokered connection.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>NOTES</H2>
<P>
These APIs are implemented as a shared library, which can be compiled and linked to with the
<B>libsystemd</B>&nbsp;<B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
file.
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus">sd-bus</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_message_set_sender">sd_bus_message_set_sender</A></B>(3)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="5"><A HREF="#lbAB">NAME</A><DD>
<DT id="6"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="7"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="8"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DL>
<DT id="9"><A HREF="#lbAF">Errors</A><DD>
</DL>
<DT id="10"><A HREF="#lbAG">NOTES</A><DD>
<DT id="11"><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:55 GMT, March 31, 2021
</BODY>
</HTML>